Something utterly bizarre is going on - if I add a line warn "flags '$flags'"; in lockf() just above the return statement, it works, even with the eval!
It happens on different machines, all debian stable 64bit . I will try a vanilla perl tomorrow. From strace, the length parameter which I'm trying to pass through pack as 0 is (sometimes) corrupted. strace when it goes wrong:
And when it goes right:root@geedorah:~# strace perl foo.pl 2>&1 |grep fcntl fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=-858311 +8848}) = -1 EINVAL (Invalid argument) fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0 root@geedorah:~#
root@geedorah:~# strace perl foo.pl 2>&1 |grep fcntl fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
In reply to Re^2: fcntl failure after eval
by flipper
in thread fcntl failure after eval
by flipper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |