-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Florian Weimer on 8/28/2009 6:52 AM: >> If the caller requested O_CLOEXEC, then your version takes 3, 5, or >> 7 syscalls depending on how many std fds were closed, while my >> version takes 3 syscalls regardless of how many std fds were closed. > > I really don't see a way around that. You can't pick a descriptor and > hope that it's unused.
fcntl(,F_DUPFD,3) is NOT like dup2. It picks the next available descriptor that is at least 3. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqX1HEACgkQ84KuGfSFAYAzYQCgnwad5k39bZJqw3Wg1vMED/Fd zjYAmwenJlImBUE33geRdHC6aoVSx7JG =omNI -----END PGP SIGNATURE-----