#
251044 |
|
27-May-2013 |
gad |
Change the closeallfds() routine to use closefrom() when it is available (closefrom() was added to FreeBSD in 8.0-release). The selection is made at compile-time, as I still compile a FreeBSD-based version of lpr&friends on other platforms.
While testing I out that (at least on my system) lpd has been closing 11095 fd's, when there are only 6 fd's open. The old code took 120 times more clocktime than calling closefrom(). (although that was still less than 2/1000-ths of a second!)
Reviewed by: jilles MFC after: 2 weeks
|
#
117540 |
|
14-Jul-2003 |
gad |
Introduce a new lp.cdefs.h file, which will be used to make it somewhat easier to build this lpr on other operating systems. This simply includes <sys/cdefs.h> when that is appropriate, and then checks for any cdefs-ish macros that lpr uses, and defines them if they don't already exist. This is only a start at making freebsd's lpr less of a hassle to port. It is mainly added so all of lpr can be changed to use the __FBSDID() macro, without making it *more* of a hassle to build on other OS's.
Reviewed by: discussed with bde and obrien MFC after: 15 days
|