-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Kerrisk wrote:
If the range of the existing parameter can indeed be restricted as
needed for the flags it is the better approach for programmers since all
that is needed for a programmer to do is to write
fd = socket(PF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0);
if (fd == -1 && errno == EINVAL)
{
fd = socket(PF_INET, SOCK_STREAM, 0);
if (fd != -1)
fcntl(fd, F_SETFD, FD_CLOEXEC);
}
No autoconf code needed to detect the presence of a new function. You
can even imagine that convenience libraries will do the above
automatically (not libc, though, where you want to recognize this
situation).
Use O_CLOEXEC, normal filesystem operation.
New flag.
Yes, they are all related interfaces. Using the same name indicates
similarity.
And just to complicate things even more:
if we'd go with sys_indirect we can have single way to specify
close-on-exec for all syscalls. That would be at the syscall level. At
the API level we'd still need separate names and possibly values.
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFIFemb2ijCOnn/RHQRAjNCAJ0QCvEJoynwbPveUZQqsyVnEAHtmgCZAe0R
jNlcvQFI06n2ckFhEqUcEbE=
=sJhN
-----END PGP SIGNATURE-----
--