The following Program, compiled and ran under RH7 with glibc 2.1.94-3 and a 2.2 kernel, failes. The same prog compiled and ran under RH6.2, glibc 2.1.2-11 works perfectly. The Program: #define _FILE_OFFSET_BITS 64 #include <stdio.h> #include <fcntl.h> #include <errno.h> int main() { struct flock plockb; int lock_failed; int fd; fd = open("test", O_RDWR | O_CREAT, 0644); plockb.l_type = F_WRLCK; plockb.l_whence = SEEK_SET; plockb.l_start=0; plockb.l_len=0; lock_failed = fcntl(fd, F_SETLK, &plockb); if(lock_failed) { printf("errno: %i string: %s\n",errno,strerror(errno)); } else { printf("success\n"); } close(fd); } strace with RH7: open("test", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = 3 fcntl64(3, 0xd /* F_??? */, 0xbffffb10) = -1 ENOSYS (Function not implemented) fcntl(3, 0xd /* F_??? */, 0xbffffaa0) = -1 EINVAL (Invalid argument) strace with RH6.2: open("test", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = 3 fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
Created attachment 4633 [details] the program
It would work with 2.4 kernels. I hope I've fixed this in http://sources.redhat.com/ml/libc-hacker/2000-10/msg00084.html If Ulrich accepts this, it will make into next glibc errata.