diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-08-28 00:42:35 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-08-28 00:42:35 +0200 |
commit | 0b01862fafb75fbf7bb272466e5c7d55cb3f83a3 (patch) | |
tree | 050886ead362eaefe460becbea0544d52779b487 /sysdeps | |
parent | 9a079e270a9bec7e1fe28aeda63e07c1bb808d44 (diff) |
[WIP] [PATCH] Fix lockf64 support
struct flock64 uses 64bit values. This introduces other values for F_GETLK,
F_SETLK, F_SETLKW to distinguish between both.
* sysdeps/mach/hurd/bits/fcntl.h (F_GETLK64, F_SETLK64, F_SETLKW64): New macros
[__USE_FILE_OFFSET64] (F_GETLK, F_SETLK, F_SETLKW): Define to F_GETLK64,
F_SETLK64, F_SETLKW64, respectively.
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): TODO: F_GET/SETLK/W64 cases.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/bits/fcntl.h | 9 | ||||
-rw-r--r-- | sysdeps/mach/hurd/fcntl.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h index 9d598a1bf2..1c652c8405 100644 --- a/sysdeps/mach/hurd/bits/fcntl.h +++ b/sysdeps/mach/hurd/bits/fcntl.h @@ -163,9 +163,18 @@ # define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ # define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ #endif +#ifdef __USE_FILE_OFFSET64 +#define F_GETLK F_GETLK64 +#define F_SETLK F_SETLK64 +#define F_SETLKW F_SETLKW64 +#else #define F_GETLK 7 /* Get record locking info. */ #define F_SETLK 8 /* Set record locking info (non-blocking). */ #define F_SETLKW 9 /* Set record locking info (blocking). */ +#endif +#define F_GETLK64 10 /* Get record locking info. */ +#define F_SETLK64 11 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 12 /* Set record locking info (blocking). */ #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate, set FD_CLOEXEC on new one. */ diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c index 70180fa9c6..ccc53dbb2d 100644 --- a/sysdeps/mach/hurd/fcntl.c +++ b/sysdeps/mach/hurd/fcntl.c @@ -128,6 +128,8 @@ __libc_fcntl (int fd, int cmd, ...) case F_SETLK: case F_SETLKW: { + /* XXX: TODO: replace with conversion to flock64 and actual + implementation. */ /* XXX We need new RPCs to support POSIX.1 fcntl file locking!! For the time being we support the whole-file case only, @@ -179,6 +181,13 @@ __libc_fcntl (int fd, int cmd, ...) return __flock (fd, cmd); } + case F_GETLK64: + case F_SETLK64: + case F_SETLKW64: + { + struct flock64 *fl = va_arg (ap, struct flock64 *); + /* TODO: implementation */ + } case F_GETFL: /* Get per-open flags. */ if (err = HURD_FD_PORT_USE (d, __io_get_openmodes (port, &result))) |