Bug 19730 - Problems locking a file opened with FILE_OFFSET_BITS 64
Problems locking a file opened with FILE_OFFSET_BITS 64
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-24 19:20 EDT by Gerd v. Egidy
Modified: 2016-11-24 11:17 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-25 06:28:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
the program (482 bytes, text/plain)
2000-10-24 19:21 EDT, Gerd v. Egidy
no flags Details

  None (edit)
Description Gerd v. Egidy 2000-10-24 19:20:51 EDT
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
Comment 1 Gerd v. Egidy 2000-10-24 19:21:46 EDT
Created attachment 4633 [details]
the program
Comment 2 Jakub Jelinek 2000-10-25 06:28:24 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.