threads/75795: applications linked with -lc_r can't close() fd
opened by kqueue().
roman at trifle.net
Tue Jan 4 14:00:45 GMT 2005
>Synopsis: applications linked with -lc_r can't close() fd opened by kqueue().
>Arrival-Date: Tue Jan 04 14:00:45 GMT 2005
>Originator: Roman Nikitchenko
Trifle Co. Ltd.
FreeBSD hc.apex.dp.ua 5.3-STABLE FreeBSD 5.3-STABLE #0: Fri Dec 24 14:26:40 EET 2004 root at hc.apex.dp.ua:/usr/obj/usr/src/sys/HC i386
Any application that uses kqueue() can't close() obtained descriptors if linked with libc_r. It is FREEBSD-5.3 related problem. The errno is set to 6 (device not configured) after close.
Applications which uses signals need to be linked against libc_r as KSE has some problems with signals (kse_thr_interrupt).
Do "g++ -lc_r" for source like this:
/* --- begin --- */
int poller = kqueue();
printf( "poller: %d\n", poller );
int r = close( poller );
if ( r<0 ) perror( "kqueue" );
/* --- end --- */
More information about the freebsd-threads