This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

F_GETLK etc. cleanup for <bits/fcntl.h>


With my change to properly define F_GETLK etc in <bits/fcntl-linux.h>, 
we can cleanup <bits/fcntl.h> a bit more. Doing that I also noticed that
I left some defines in the s390 header.

Here's a patch, ok to install?

Andreas

2012-10-22  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/x86/bits/fcntl.h (F_GETLK, F_SETLK)
	(F_SETLKW) [__x86_64]: Remove, provided by <bits/fcntl-linux.h>.
	(F_GETLK, F_SETLK, F_SETLKW) [!__USE_FILE_OFFSET64 && !__x86_64__]:
	Likewise.
	(F_GETLK, F_SETLK, F_SETLKW) [__USE_FILE_OFFSET64 && ! __x86_64__]:
	Likewise.
	(F_GETLK64, F_SETLK64, F_SETLKW64) [!__x86_64__]: Likewise.

	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (F_GETLK, F_SETLK)
	(F_SETLKW) [__USE_FILE_OFFSET64]: Remove, provided by
	<bits/fcntl-linux.h>.
	(F_GETLK64, F_SETLK64, F_SETLKW64) [__WORDSIZE == 64]: Likewise.

	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h (F_DUPFD, F_GETFD)
	(F_SETFD, F_GETFL, F_SETFL): Remove, provided by <bits/fcntl-linux.h>.
	(F_GETLK, F_SETLK, F_SETLKW) [__WORDSIZE == 64]: Likewise.
	(F_GETLK, F_SETLK, F_SETLKW, F_GETLK64, F_SETLK64, F_SETLKW64)
	[__WORDSIZE != 64]: Likewise.

diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index 6f53fbc..5d26b4c 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -31,33 +31,11 @@
 # endif
 #endif
 
-/* Values for the second argument to `fcntl'.  */
-#define F_DUPFD		0	/* Duplicate file descriptor.  */
-#define F_GETFD		1	/* Get file descriptor flags.  */
-#define F_SETFD		2	/* Set file descriptor flags.  */
-#define F_GETFL		3	/* Get file status flags.  */
-#define F_SETFL		4	/* Set file status flags.  */
 #if __WORDSIZE == 64
-# define F_GETLK	5	/* Get record locking info.  */
-# define F_SETLK	6	/* Set record locking info (non-blocking).  */
-# define F_SETLKW	7	/* Set record locking info (blocking).	*/
 /* Not necessary, we always have 64-bit offsets.  */
 # define F_GETLK64	5	/* Get record locking info.  */
 # define F_SETLK64	6	/* Set record locking info (non-blocking).  */
 # define F_SETLKW64	7	/* Set record locking info (blocking).	*/
-#else
-# ifndef __USE_FILE_OFFSET64
-#  define F_GETLK	5	/* Get record locking info.  */
-#  define F_SETLK	6	/* Set record locking info (non-blocking).  */
-#  define F_SETLKW	7	/* Set record locking info (blocking).	*/
-# else
-#  define F_GETLK	F_GETLK64  /* Get record locking info.	*/
-#  define F_SETLK	F_SETLK64  /* Set record locking info (non-blocking).*/
-#  define F_SETLKW	F_SETLKW64 /* Set record locking info (blocking).  */
-# endif
-# define F_GETLK64	12	/* Get record locking info.  */
-# define F_SETLK64	13	/* Set record locking info (non-blocking).  */
-# define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
 
 struct flock
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index b8496a9..ba48856 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -59,20 +59,12 @@
 # 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).  */
-#else
-# define F_GETLK	F_GETLK64  /* Get record locking info.  */
-# define F_SETLK	F_SETLK64  /* Set record locking info (non-blocking).*/
-# define F_SETLKW	F_SETLKW64 /* Set record locking info (blocking).  */
 #endif
 
 #if __WORDSIZE == 64
 # define F_GETLK64	7	/* Get record locking info.  */
 # define F_SETLK64	8	/* Set record locking info (non-blocking).  */
 # define F_SETLKW64	9	/* Set record locking info (blocking).  */
-#else
-# define F_GETLK64	12	/* Get record locking info.  */
-# define F_SETLK64	13	/* Set record locking info (non-blocking).  */
-# define F_SETLKW64	14	/* Set record locking info (blocking).  */
 #endif
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
index dcf4fc0..9251e75 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
@@ -27,26 +27,10 @@
 #endif
 
 #ifdef __x86_64__
-# define F_GETLK	5	/* Get record locking info.  */
-# define F_SETLK	6	/* Set record locking info (non-blocking).  */
-# define F_SETLKW	7	/* Set record locking info (blocking).	*/
 /* Not necessary, we always have 64-bit offsets.  */
 # define F_GETLK64	5	/* Get record locking info.  */
 # define F_SETLK64	6	/* Set record locking info (non-blocking).  */
 # define F_SETLKW64	7	/* Set record locking info (blocking).	*/
-#else
-# ifndef __USE_FILE_OFFSET64
-#  define F_GETLK	5	/* Get record locking info.  */
-#  define F_SETLK	6	/* Set record locking info (non-blocking).  */
-#  define F_SETLKW	7	/* Set record locking info (blocking).	*/
-# else
-#  define F_GETLK	F_GETLK64  /* Get record locking info.	*/
-#  define F_SETLK	F_SETLK64  /* Set record locking info (non-blocking).*/
-#  define F_SETLKW	F_SETLKW64 /* Set record locking info (blocking).  */
-# endif
-# define F_GETLK64	12	/* Get record locking info.  */
-# define F_SETLK64	13	/* Set record locking info (non-blocking).  */
-# define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
 
 

-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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