On Fri, Jul 03, 2009 at 12:10:17PM +0200, Dejan Muhamedagic wrote:
> > All those FDs should probably be opened with the "O_CLOEXEC" flag,
> > or alternatively by
> > flags = fcntl(fd, F_GETFD); /*error handling*/
> > fcntl(fd, F_SETFD, flags | FD_CLOEXEC); /*error handling*/
> 
> Never heard of CLOEXEC. According to the manpage it's also linux
> specific.

fcntl FD_CLOEXEC is POSIX.

O_CLOEXEC is linux specific, and was introduced in linux 2.6.23 (or so
the manpage says), to avoid the race in multi-threaded applications:
t1:     t2:
 open
          exec -----> inherited fd :(
 fcntl(FD_CLOEXEC)

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to