This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: BZ#15722: create all sockets with SOCK_CLOEXEC

On Thu, Dec 11, 2014 at 11:29:34AM -0800, Roland McGrath wrote:
> This is a temporary fd used only within this function, never left open.
> If there is no underlying SOCK_CLOEXEC support, then calling fcntl after
> the fact is no more guarantee of anything than calling close in this
> function (and adds some overhead).  My inclination is not to pretend to
> offer any race-free leaklessness if we cannot in fact offer it across
> the board.
> Perhaps we actually can require SOCK_CLOEXEC support nowadays, but we
> haven't ever explicitly said so before.  (For Linux configurations,
> __ASSUME_SOCK_CLOEXEC is always set since we now support only kernels
> new enough.  For the Hurd, *_CLOEXEC are actually implemented entirely
> in libc, though SOCK_CLOEXEC is not actually implemented yet.  The other
> OS port forthcoming is NaCl, which does not have exec at all yet.)
At least it allows skip fcntl part entirely, linux is not problem and
for other systems should add both at same time, or we could handle
SOCK_CLOEXEC in wrapper by fcntl. 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]