kern/64313: FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOCK flag

Valentin Nechayev netch at ivb.nn.kiev.ua
Sun Mar 21 07:10:06 PST 2004


The following reply was made to PR kern/64313; it has been noted by GNATS.

From: Valentin Nechayev <netch at ivb.nn.kiev.ua>
To: Lars =?iso-8859-1?Q?K=F6ller?= <lars at koellers.net>
Cc: FreeBSD-gnats-submit at freebsd.org
Subject: Re: kern/64313: FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOCK flag
Date: Sun, 21 Mar 2004 17:04:41 +0200

  Mon, Mar 15, 2004 at 21:32:43, lkoeller (Lars Koeller) wrote about "kern/64313: FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOCK flag": 
 
 LKl> 	     * The pthreads implementation under the hood sets O_NONBLOCK
 LKl> 	     * implicitly on all fds. This setting is not visible to the user
 LKl> 	     * application but is relied upon by the pthreads library to prevent
 LKl> 	     * blocking syscalls in one thread from halting all threads in the
 LKl> 	     * process. When a process exit()s or exec()s, the implicit
 LKl> 	     * O_NONBLOCK flags are removed from all fds, EVEN THOSE IT INHERITED.
 
 This is unavoidable feature of libc_r. It can't detect whether O_NONBLOCK
 was set by itself or by another application, and can't organize thread sleeping
 without O_NONBLOCK.
 If this is critical, use another thread library (e.g. linuxthreads on 4.x,
 libkse or libthr on 5.x).
 Libc_r is unrepairable for your request (unless brain-damaged unix api
 with its per-opened-object O_NONBLOCK will be fixed). So your PR is
 meaningless and should be closed.
 
 
 -netch-


More information about the freebsd-threads mailing list