statx for older glibc versions

OBS-URL: https://build.opensuse.org/package/show/Base:System/psmisc?expand=0&rev=110
This commit is contained in:
Dr. Werner Fink 2018-11-05 07:52:51 +00:00 committed by Git OBS Bridge
parent d16db3722d
commit 6fc55b0b96
3 changed files with 18 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From dcc25d4e18d2a61f8a72670282210a0abdce7f30 Mon Sep 17 00:00:00 2001
From 7181b4125fc2a1057dffffaa643e6bcb549fd0eb Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
Date: Fri, 2 Nov 2018 14:27:00 +0100
Subject: [PATCH] Use new statx(2) system call to avoid hangs on NFS
@ -9,10 +9,10 @@ Signed-off-by: Werner Fink <werner@suse.de>
configure.ac | 38 +++---
src/fuser.c | 86 +++-----------
src/statx.c | 147 +++++++++++++++++++++++
src/statx.h | 61 ++++++++++
src/statx.h | 66 +++++++++++
src/timeout.c | 372 ----------------------------------------------------------
src/timeout.h | 45 -------
7 files changed, 242 insertions(+), 511 deletions(-)
7 files changed, 247 insertions(+), 511 deletions(-)
create mode 100644 src/statx.c
create mode 100644 src/statx.h
delete mode 100644 src/timeout.c
@ -448,10 +448,10 @@ index 0000000..2554da7
+}
diff --git src/statx.h src/statx.h
new file mode 100644
index 0000000..846e67d
index 0000000..548583d
--- /dev/null
+++ src/statx.h
@@ -0,0 +1,61 @@
@@ -0,0 +1,66 @@
+/*
+ * statx.h - Map modern statx(2) system call to older stat(2), lstat(2),
+ * and fstat(2) replacements named {,l,f}statn()
@ -478,6 +478,11 @@ index 0000000..846e67d
+
+extern int stat_flags;
+#if defined(HAVE_DECL_SYS_STATX) && HAVE_DECL_SYS_STATX == 1
+# ifndef HAVE_STATX
+# define _ASM_GENERIC_FCNTL_H /* Avoid collisions between asm/fcntl.h and bits/fcntl.h ! */
+# include <linux/fcntl.h> /* Definition of AT_* and AT_STATX_* constants ! */
+# include <linux/stat.h> /* Provides 'struct statx' and STATX_* ! */
+# endif
+extern int statn(const char*, unsigned int, struct stat*);
+extern int fstatn(int, unsigned int, struct stat*);
+extern int lstatn(const char*, unsigned int, struct stat*);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Nov 5 07:48:25 UTC 2018 - Dr. Werner Fink <werner@suse.de>
- Modify patch 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
to support older systems with statx kernel support
-------------------------------------------------------------------
Fri Nov 2 13:37:49 UTC 2018 - Dr. Werner Fink <werner@suse.de>

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -24,6 +24,7 @@ BuildRequires: gcc-c++
BuildRequires: gettext-devel
BuildRequires: glibc-devel
BuildRequires: libselinux-devel
BuildRequires: linux-glibc-devel >= 4.12
BuildRequires: ncurses-devel
Url: https://gitlab.com/psmisc/psmisc/
Version: 23.2