fcntl: setting FD_CLOEXEC flag with F_SETFD returns ENOTSUP
llugin opened this issue · comments
found on e7cde04
reproduction:
test.c
int fd = open("myfile", O_WRONLY | O_CREAT | O_TRUNC, 0666);
int ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
$ pf INTERCEPT_LOG=intercept.log ./test
intercept.log fragment:
/lib/x86_64-linux-gnu/libc.so.6 0xf645e -- open("myfile", O_WRONLY | O_CREAT | O_TRUNC, 0666) = ?
/lib/x86_64-linux-gnu/libc.so.6 0xf645e -- open("myfile", O_WRONLY | O_CREAT | O_TRUNC, 0666) = 5
/lib/x86_64-linux-gnu/libc.so.6 0xf6b05 -- fcntl(5, 2 (F_SETFD), 2) = ?
/lib/x86_64-linux-gnu/libc.so.6 0xf6b05 -- fcntl(5, 2 (F_SETFD), 2) = -95
found cause:
in libpmemfile-posix/fcntl.c:pmemfile_fcntl(): no appropriate return statement inside 'case PMEMFILE_F_SETFD:' in switch(cmd) instruction.