aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-21 15:53:53 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-10-09 17:02:07 -0300
commit81b83ff61f95f30ad53d6075247af0ea61a0b16e (patch)
tree8d1eb0eaa4170a5af411253e667016efb314b9d5 /sysdeps/mach
parentaa03f722f3b994aaf81e72a8904bf33196780930 (diff)
downloadglibc-81b83ff61f95f30ad53d6075247af0ea61a0b16e.tar
glibc-81b83ff61f95f30ad53d6075247af0ea61a0b16e.tar.gz
glibc-81b83ff61f95f30ad53d6075247af0ea61a0b16e.tar.bz2
glibc-81b83ff61f95f30ad53d6075247af0ea61a0b16e.zip
linux: Move xmknod{at} to compat symbols
It also decouple mknod{at} from xmknod{at}. The riscv32 ABI was added on 2.33, so it is safe to remove the old __xmknot{at} symbols and just provide the newer mknod{at} ones. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/xmknod.c17
-rw-r--r--sysdeps/mach/hurd/xmknodat.c12
2 files changed, 23 insertions, 6 deletions
diff --git a/sysdeps/mach/hurd/xmknod.c b/sysdeps/mach/hurd/xmknod.c
index 0ab4f1b719..a1b5af086d 100644
--- a/sysdeps/mach/hurd/xmknod.c
+++ b/sysdeps/mach/hurd/xmknod.c
@@ -15,12 +15,9 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <sys/types.h>
#include <sys/stat.h>
-
+#include <fcntl.h>
+#include <shlib-compat.h>
/* Create a device file named FILE_NAME, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
@@ -31,3 +28,13 @@ __xmknod (int vers, const char *file_name, mode_t mode, dev_t *dev)
return __xmknodat (vers, AT_FDCWD, file_name, mode, dev);
}
libc_hidden_def (__xmknod)
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+int
+__xmknod_compat (int vers, const char *file_name, mode_t mode, dev_t *dev)
+{
+ return __xmknod (vers, file_name, mode, dev);
+}
+
+compat_symbol (libc, __xmknod_compat, __xmknod, GLIBC_2_0);
+#endif
diff --git a/sysdeps/mach/hurd/xmknodat.c b/sysdeps/mach/hurd/xmknodat.c
index 4239d1ea91..90724694d5 100644
--- a/sysdeps/mach/hurd/xmknodat.c
+++ b/sysdeps/mach/hurd/xmknodat.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
+#include <shlib-compat.h>
/* Create a device file named PATH relative to FD, with permission and
special bits MODE and device number DEV (which can be constructed
@@ -116,5 +117,14 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
return __hurd_fail (err);
return 0;
}
-
libc_hidden_def (__xmknodat)
+
+#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+int
+__xmknodat_compat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
+{
+ return __xmknodat (vers, fd, path, mode, dev);
+}
+
+compat_symbol (libc, __xmknodat_compat, __xmknodat, GLIBC_2_4);
+#endif