This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix fcntl (was Re: status?)


Hi!

On Wed, Oct 25, 2000 at 01:18:21AM -0700, Ulrich Drepper wrote:
> could you please give me some status for the architectures?  I have
> one more problem to look at tomorrow and then all I plan to do before
> the next pre-release is done.  Unless I get some problem reports now
> that is.

This patch is needed so that -D_FILE_OFFSET_BITS=64 compiled programs
using fcntl work on non-LFS kernels (it is untested but I think it
should be obvious, will test later on).
As for the status, I need to update sparc32 and sparc64 ulps (hopefully
today), otherwise sparc32 should be ok, sparc64 has still some issues with
libm miscompilations so I'm not yet sure which libm make check failures are
due to compiler, which are due to not precise enough constants in
libm-test.inc and which are real bugs in ldbl-128 code (but sparc64 should
not be a showstopper for the beta release).

2000-10-25  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl): When
	converting struct flock64 to struct flock and back, use fcntl commands
	which work on struct flock.

--- libc/sysdeps/unix/sysv/linux/i386/fcntl.c.jj	Fri Sep  8 17:55:11 2000
+++ libc/sysdeps/unix/sysv/linux/i386/fcntl.c	Wed Oct 25 11:08:57 2000
@@ -84,7 +84,7 @@ __libc_fcntl (int fd, int cmd, ...)
 	fl.l_whence = fl64->l_whence;
 	fl.l_pid = fl64->l_pid;
 
-	res = INLINE_SYSCALL (fcntl, 3, fd, cmd, &fl);
+	res = INLINE_SYSCALL (fcntl, 3, fd, F_GETLK, &fl);
 	if (res  != 0)
 	  return res;
 	/* Everything ok, convert back.  */
@@ -120,7 +120,7 @@ __libc_fcntl (int fd, int cmd, ...)
 	fl.l_type = fl64->l_type;
 	fl.l_whence = fl64->l_whence;
 	fl.l_pid = fl64->l_pid;
-	return INLINE_SYSCALL (fcntl, 3, fd, cmd, &fl);
+	return INLINE_SYSCALL (fcntl, 3, fd, cmd + F_SETLK - F_SETLK64, &fl);
       }
     default:
       return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);


	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]