]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Make generic fcntl.h the default one
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Wed, 19 Oct 2022 22:14:31 +0000 (19:14 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 7 Dec 2022 17:40:52 +0000 (14:40 -0300)
It is currently used for csky, arc, nios2, and or1k.  Newer 64 bit
architecture, like riscv32 and loongarch, reimplement it to override
F_GETLK64/F_SETLK64/F_SETLKW64.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/bits/fcntl.h
sysdeps/unix/sysv/linux/generic/bits/fcntl.h [deleted file]

index be40350e825d46ae07099f2c9511c6b53962ffb7..112ee96df5bf3badd66f8559dec5d8867413fc75 100644 (file)
@@ -1,3 +1,55 @@
-/* bits/fcntl.h is architecture specific.  */
-#error "This file must be supplied by every Linux architecture."
+/* O_*, F_*, FD_* bit values for the generic Linux ABI.
+   Copyright (C) 2011-2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef        _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __O_LARGEFILE 0
+#endif
+
+struct flock
+  {
+    short int l_type;  /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;        /* Where `l_start' is relative to (like `lseek').  */
+#ifndef __USE_FILE_OFFSET64
+    __off_t l_start;   /* Offset where the lock begins.  */
+    __off_t l_len;     /* Size of the locked area; zero means until EOF.  */
+#else
+    __off64_t l_start; /* Offset where the lock begins.  */
+    __off64_t l_len;   /* Size of the locked area; zero means until EOF.  */
+#endif
+    __pid_t l_pid;     /* Process holding the lock.  */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    short int l_type;  /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;        /* Where `l_start' is relative to (like `lseek').  */
+    __off64_t l_start; /* Offset where the lock begins.  */
+    __off64_t l_len;   /* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;     /* Process holding the lock.  */
+  };
+#endif
+
+/* Include generic Linux declarations.  */
+#include <bits/fcntl-linux.h>
diff --git a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
deleted file mode 100644 (file)
index 112ee96..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* O_*, F_*, FD_* bit values for the generic Linux ABI.
-   Copyright (C) 2011-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef        _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __O_LARGEFILE 0
-#endif
-
-struct flock
-  {
-    short int l_type;  /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
-    short int l_whence;        /* Where `l_start' is relative to (like `lseek').  */
-#ifndef __USE_FILE_OFFSET64
-    __off_t l_start;   /* Offset where the lock begins.  */
-    __off_t l_len;     /* Size of the locked area; zero means until EOF.  */
-#else
-    __off64_t l_start; /* Offset where the lock begins.  */
-    __off64_t l_len;   /* Size of the locked area; zero means until EOF.  */
-#endif
-    __pid_t l_pid;     /* Process holding the lock.  */
-  };
-
-#ifdef __USE_LARGEFILE64
-struct flock64
-  {
-    short int l_type;  /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
-    short int l_whence;        /* Where `l_start' is relative to (like `lseek').  */
-    __off64_t l_start; /* Offset where the lock begins.  */
-    __off64_t l_len;   /* Size of the locked area; zero means until EOF.  */
-    __pid_t l_pid;     /* Process holding the lock.  */
-  };
-#endif
-
-/* Include generic Linux declarations.  */
-#include <bits/fcntl-linux.h>