lp(4)
π lp(4) β the line printer device page, bestie edition π
Okay so this is from the Kernel Interfaces Manual, and it's all about lp β as in, line printer devices. Yes, actual printers, vintage energy, but hear me out because this is lowkey iconic. π¨οΈβ¨
β¨ NAME β¨
lp β line printer devices. That's it, that's the name, short and slay.
πΈ SYNOPSIS πΈ
#include <linux/lp.h>
That's the whole vibe. Include the header, get the toys. π
π¦ CONFIGURATION π¦
So lp[0β2] are character devices for your parallel line printers, and they have major number 6 and minor number 0β2. Those minor numbers match up with the printer port base addresses like this:
lp0β0x03bclp1β0x0378lp2β0x0278
Usually they have mode 220 and they're owned by user root and group lp. Classic.
Now, the way that you can talk to printer ports is either with polling or with interrupts. Interrupts are the recommended route when high traffic is expected β think laser printers, they're doing the most. For typical dot matrix printers, polling will usually be enough, no cap. The default is polling. π«Ά
π DESCRIPTION π
The following ioctl(2) calls are supported, and they are giving main character energy, one by one:
int ioctl(int fd, LPTIME, int arg)β Sets the amount of time that the driver sleeps before rechecking the printer when the printer's buffer appears to be filled, and it sets it toarg. Fast printer? Decrease this number. Slow printer? Increase it. It's measured in hundredths of a second, and the default2means 0.02 seconds. Heads up: it influences only the polling driver.int ioctl(int fd, LPCHAR, int arg)β Sets the maximum number of busy-wait iterations which the polling driver does while waiting for the printer to get ready for receiving a character, and sets it toarg. Printing too slow? Increase the number. System getting too slow? Decrease it. Default is1000. Again, it influences only the polling driver.int ioctl(int fd, LPABORT, int arg)β Ifargis0, the printer driver will retry on errors; otherwise it will abort. The default is0.int ioctl(int fd, LPABORTOPEN, int arg)β Ifargis0,open(2)will be aborted on error; otherwise the error will be ignored. The default is to ignore it.int ioctl(int fd, LPCAREFUL, int arg)β Ifargis0, then the out-of-paper, offline, and error signals are required to be false on all writes; otherwise they are ignored. The default is to ignore them.int ioctl(int fd, LPWAIT, int arg)β Sets the number of busy waiting iterations to wait before strobing the printer to accept a just-written character, and the number of iterations to wait before turning the strobe off again, and it sets both of those toarg. The specification says this time should be 0.5 microseconds, but experience has shown the delay caused by the code is already enough. For that reason, the default value is0. This one is used for both the polling and the interrupt driver.int ioctl(int fd, LPSETIRQ, int arg)β Thisioctl(2)requires superuser privileges, bestie, so act accordingly. π It takes anintcontaining the new IRQ as argument. As a side effect, the printer will be reset. Whenargis0, the polling driver will be used, which is also the default.int ioctl(int fd, LPGETIRQ, int *arg)β Stores the currently used IRQ inarg.int ioctl(int fd, LPGETSTATUS, int *arg)β Stores the value of the status port inarg. The bits mean the following:LP_PBUSYβ inverted busy input, active highLP_PACKβ unchanged acknowledge input, active lowLP_POUTPAβ unchanged out-of-paper input, active highLP_PSELECDβ unchanged selected input, active highLP_PERRORPβ unchanged error input, active low
Refer to your printer manual for the meaning of the signals. And note that undocumented bits may also be set, depending on your printer. π
int ioctl(int fd, LPRESET)β Resets the printer. No argument is used. Simple, clean, periodt.
π FILES π
/dev/lp*
π SEE ALSO π
That's the whole page, and honestly? Ate. π This was served to you fresh from Linux man-pages 6.20, dated 2025-09-21 β go forth and print responsibly, bestie. π§β¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms