Message179803
The following extract of _close_open_fd_range_safe() is not correct:
#ifdef O_CLOEXEC
fd_dir_fd = open(FD_DIR, O_RDONLY | O_CLOEXEC, 0);
#else
fd_dir_fd = open(FD_DIR, O_RDONLY, 0);
#ifdef FD_CLOEXEC
{
int old = fcntl(fd_dir_fd, F_GETFD);
if (old != -1)
fcntl(fd_dir_fd, F_SETFD, old | FD_CLOEXEC);
}
#endif
#endif
On Linux older than 2.6.23, O_CLOEXEC may be defined by the glibc whereas the kernel does not support it. In this case, the flag is simply ignored and close-on-exec flag is not set on the file descriptor. |
|
Date |
User |
Action |
Args |
2013-01-12 14:54:13 | vstinner | set | recipients:
+ vstinner, neologix |
2013-01-12 14:54:13 | vstinner | set | messageid: <1358002453.56.0.227593845503.issue16946@psf.upfronthosting.co.za> |
2013-01-12 14:54:13 | vstinner | link | issue16946 messages |
2013-01-12 14:54:12 | vstinner | create | |
|