new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/fxstat.c>
new file mode 100644
@@ -0,0 +1,46 @@
+//#include <sysdeps/unix/sysv/linux/fxstat64.c>
+/* fxstat64 using Linux fstat64 system call.
+ Copyright (C) 1997-2016 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+#include <xstatconv.h>
+
+/* Get information about the file FD in BUF. */
+
+int
+___fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+ struct kernel_stat kbuf;
+ int result;
+
+ result = INLINE_SYSCALL (fstat64, 2, fd, &kbuf);
+ if (result)
+ return result;
+
+ return __xstat64_conv(vers, &kbuf, buf);
+}
+strong_alias (___fxstat64, __fxstat64)
+hidden_def (__fxstat64)
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/fxstatat.c>
new file mode 100644
@@ -0,0 +1,42 @@
+/* Copyright (C) 2005-2016 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+#include <xstatconv.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+/* Get information about the file NAME in BUF. */
+int
+__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
+{
+ int result;
+ struct kernel_stat kst;
+ result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, &kst, flag);
+ if (result)
+ return 0;
+
+ return __xstat64_conv (vers, &kst, st);
+}
+libc_hidden_def (__fxstatat64)
new file mode 100644
@@ -0,0 +1,25 @@
+#define __NR_fstat __NR_fstat64
+#define __NR_newfstatat __NR_fstatat64
+
+struct kernel_stat {
+ unsigned long long st_dev; /* Device. */
+ unsigned long long st_ino; /* File serial number. */
+ unsigned int st_mode; /* File mode. */
+ unsigned int st_nlink; /* Link count. */
+ unsigned int st_uid; /* User ID of the file's owner. */
+ unsigned int st_gid; /* Group ID of the file's group. */
+ unsigned long long st_rdev; /* Device number, if device. */
+ unsigned long long __pad1;
+ long long st_size; /* Size of file, in bytes. */
+ int st_blksize; /* Optimal block size for I/O. */
+ int __pad2;
+ long long st_blocks; /* Number 512-byte blocks allocated. */
+ long long st_atime_sec; /* Time of last access. */
+ unsigned long long st_atime_nsec;
+ long long st_mtime_sec; /* Time of last modification. */
+ unsigned long long st_mtime_nsec;
+ long long st_ctime_sec; /* Time of last status change. */
+ unsigned long long st_ctime_nsec;
+ unsigned int __unused4;
+ unsigned int __unused5;
+};
new file mode 100644
@@ -0,0 +1,40 @@
+/* Get information about the file NAME in BUF.
+
+ Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
+
+ 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include "xstatconv.h"
+
+int
+__lxstat (int vers, const char *name, struct stat *buf)
+{
+ struct kernel_stat kbuf;
+ int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, &kbuf,
+ AT_SYMLINK_NOFOLLOW);
+ return rc ?: __xstat_conv (vers, &kbuf, buf);
+}
+hidden_def (__lxstat)
new file mode 100644
@@ -0,0 +1,39 @@
+/* lxstat64 using Linux lstat64 system call.
+ Copyright (C) 1997-2016 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include "xstatconv.h"
+
+/* Get information about the file NAME in BUF. */
+int
+___lxstat64 (int vers, const char *name, struct stat64 *buf)
+{
+ struct kernel_stat kbuf;
+ int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, &kbuf,
+ AT_SYMLINK_NOFOLLOW);
+ return rc ?: __xstat64_conv (vers, &kbuf, buf);
+}
+strong_alias (___lxstat64, __lxstat64);
+hidden_def (__lxstat64)
new file mode 100644
@@ -0,0 +1,66 @@
+/* Convert between the kernel's `struct stat' format, and libc's.
+ Copyright (C) 1991-2016 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+int
+__xstat_conv (int vers, struct kernel_stat *kbuf, struct stat *buf)
+{
+ buf->st_dev = kbuf->st_dev;
+ buf->st_ino = kbuf->st_ino;
+ buf->st_mode = kbuf->st_mode;
+ buf->st_nlink = kbuf->st_nlink;
+ buf->st_uid = kbuf->st_uid;
+ buf->st_gid = kbuf->st_gid;
+ buf->st_rdev = kbuf->st_rdev;
+ buf->st_size = kbuf->st_size;
+ buf->st_blksize = kbuf->st_blksize;
+ buf->st_blocks = kbuf->st_blocks;
+ buf->st_atim.tv_sec = kbuf->st_atime_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atime_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtime_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtime_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctime_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctime_nsec;
+
+ return 0;
+}
+
+int
+__xstat64_conv (int vers, struct kernel_stat *kbuf, struct stat64 *buf)
+{
+ buf->st_dev = kbuf->st_dev;
+ buf->st_ino = kbuf->st_ino;
+ buf->st_mode = kbuf->st_mode;
+ buf->st_nlink = kbuf->st_nlink;
+ buf->st_uid = kbuf->st_uid;
+ buf->st_gid = kbuf->st_gid;
+ buf->st_rdev = kbuf->st_rdev;
+ buf->st_size = kbuf->st_size;
+ buf->st_blksize = kbuf->st_blksize;
+ buf->st_blocks = kbuf->st_blocks;
+ buf->st_atim.tv_sec = kbuf->st_atime_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atime_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtime_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtime_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctime_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctime_nsec;
+
+ return 0;
+}