From patchwork Tue Jun 28 16:39:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 13442 Received: (qmail 34191 invoked by alias); 28 Jun 2016 16:43:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 33938 invoked by uid 89); 28 Jun 2016 16:43:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1, 47, stat64, vers, __fsfilcnt_t X-HELO: na01-bn1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , , , , , , , , Yury Norov , Yury Norov Subject: [PATCH 18/23] [AARCH64] ILP32: support stat syscall family Date: Tue, 28 Jun 2016 19:39:33 +0300 Message-ID: <1467131978-669-19-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1467131978-669-1-git-send-email-ynorov@caviumnetworks.com> References: <1467131978-669-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: AM5PR0901CA0029.eurprd09.prod.outlook.com (10.164.186.167) To DM3PR07MB2249.namprd07.prod.outlook.com (10.164.33.147) X-MS-Office365-Filtering-Correlation-Id: 7ab5dbeb-491c-4994-ce9f-08d39f734072 X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 2:SoIeQrU0JDBIYKacuXFKWWUTgbqzluqsDj93iMLNHFLDNELX9zEzHRH9+qLMFErZFuEEBs5/DyH4rhrlFQG0knObAS6cICRXd2Psw4KPQKZSl3W0rF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ACCTJkWxioggRJk2pYrbPRV77uMTCYexv4HGYbUsPkDOTvT9F2ZcRvtn+keRwjoj/dvglk9TWHJt+XGCC+d0uGDfa01MWRt6jdglxeQRDBziDpaFQNb0MdNtxdivTmWC5EvNKnsdAtqDkw/PLkqu1JJvbRY71kkuQGCYQ35+Z3+G/daK0uIt7SRcqH7gbycM9Lpe7TVOuTGdzUzcL91wYFBnRoUy20slhDysHS2Y4G4shQ9pFj7A0V6NhC06e/vDpgsnVjIGbWqc4SkMJ9R+tu1Vm+cpfCUUglLM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:DM3PR07MB2249; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2249; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 4:YTH+I9fPJLkRKZJGRPS1ViGOcdKxpttbFa0rCqpNv/eCo60XfcaLQ/lHmDhqr9wr/tYEnc2/VN9NBwt9iOlWyT4ig5OA/J7BYN6X7jthgqflpOw5bJf3dmI6wTnQDgJQZUjo1+eGuQprBdJQl+zIvJjm9UnOsIJT8WVdpjaF4+6aJT+DnT9EE+3QvVqwKVTgR65oG0J89d7//dY2Oyrj3jqc1Xs30DFcZ9t25klQGJ0gmsEAeyQIp2zPh/uSPIS0MRufkNowP1kx2BHprLT4lFC5Gf6odJJOyu3ax/HEOl8mCLY2QDTs+wbUFyR72a3BOwg76mbj4jCiRwzJGPLEJRqnaXDRJkv9khr3ClMQVVmymecVyBWUCdsxn48PH40+5spqyb1XmVYAaGKdVEJf0hB/ZvGScjsin1bvtQJ1564njGsm6I6/amEp/UKg3KwB X-Forefront-PRVS: 0987ACA2E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(40224003)(7846002)(4001430100002)(50466002)(7736002)(305945005)(97736004)(48376002)(81166006)(81156014)(5001770100001)(586003)(2906002)(4326007)(106356001)(105586002)(229853001)(66066001)(3846002)(107886002)(68736007)(47776003)(19580405001)(6116002)(189998001)(50226002)(19580395003)(76506005)(2950100001)(575784001)(5003940100001)(77096005)(33646002)(42186005)(76176999)(36756003)(8676002)(50986999)(101416001)(15975445007)(92566002)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2249; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR07MB2249; 23:AijVOXw1lXBBUfdTEj6IwgoDv8R4VBVQK2acMAibT?= =?us-ascii?Q?XkWsHCy3XDMSvZ6hbNPzsBBLF/IA+iTr1ROQHq3sUeITHHVOSE0Dbu12Rlyr?= =?us-ascii?Q?EzDXUgDjAUW8f53HGoqbQJGYuArVPUu8nPR4W+vB1rHa62Gi2uz5KvsxZ6zq?= =?us-ascii?Q?gY9XWa+s36jPcWyNzMKw8kqJb3e8wUld9SINzSYopr4QGJzgCnudatXxXHtp?= =?us-ascii?Q?hxrTnsm2sS0CCoAeeSwQsl10GYNgL1VYp8OIfcBlY7JCObyRUWbKiLSLEHxj?= =?us-ascii?Q?hoBE8WH2gaISdROZHCkg3NOCWjqTv5bS3IOUYaL7NOV7ixm2WT7lFqu8nPZP?= =?us-ascii?Q?iyz7fElmJafRgDPKQoZQPAGmTj/uIor9MdlKaRx1+C/dVczCKNBQuIAUv6b0?= =?us-ascii?Q?W5UcJfO+blzYDLW+syzpX/ztz1NhfL+mO97Gvotup8R8nQxMzMQoQAZuhBMx?= =?us-ascii?Q?Edw2H+y1uFstEDSnV0JgtNEy1coVvhIyg6o5dkfKT3qHFr5IIa5g0wj8KjJS?= =?us-ascii?Q?44ENTUufcgIud7CFamo2mAqG1KJfQGiVBjrJk6KJCO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8g9WxgS/SoK6CmCXi9Je/00Bx2TqbdBDpDQ07ljvjepAZkNtnf6k5FupvB84BgdVb2yBKxPAqQRi1u5JXmyEAEKmca+UZb/VeVc0nRpi/Oi9f0sfslP8h5NDZ+Dz2paotHlgTO83eCOOGYNnmPPtbml1CnR; 5:2BbkVL+a8hpY+YDmHIWO3FaqFqqeT8qe1AHtsimYtlJWRL1iBJP04He/i5watmTl3t+POxWKrmk1Mee0MDjQj/H4xAM3hEw27Jy6dw6uzkUmAqSyb15VV/X+eWR9Quz0+MNjM4SvduOy5bnq6P5M4A==; 24:F+ichK1nDho+L+Bq6VVtyQwP1KkHDfB0srSX4i2TzfC+vCB5Q0UIn9uq9uf7xrvBNuno/2fGnQPfR7xFLPUSkLafZljqVWXR3ne+dCgiSds=; 7:WquEIsrSoMO4nJ1i5DLKnvAGCq7ornJ3INAWOOt5vnRH6UVZzD9OPrceJD+IYqsHTX3gSrt4snXrY18jf4r9A8Xc7xbDud2r9SP5khIMV+TszdR2Us4Mrj2WT+/1nF5Z3kV96Wbg3O9Cly1lu6wB2EsYWN/WEC91ClDaBYpsuIPKip1ko1yh+giiTNT/rJNfVFZ+d8HsEGdcr3AKMaGkfpGOP+ajTt3v+anaGS7mPzMcVzeNUlv3pdiomiHTCpwNK8/I0mj7qoKfaUYmJS4UWQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 16:42:53.6709 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2249 From: Yury Norov stat and statfs structures has their layouts identical to lp64 after changing off_t, ino_t etc sizes to 64-bit. It means we can pass it to kernel same way as lp64 does. Signed-off-by: Yury Norov --- sysdeps/unix/sysv/linux/aarch64/bits/stat.h | 195 +++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/bits/statfs.h | 64 +++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c | 51 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c | 44 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c | 48 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c | 52 ++++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c | 30 ++++ sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c | 29 +++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c | 47 +++++ sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c | 47 +++++ 14 files changed, 759 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/stat.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/statfs.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/stat.h b/sysdeps/unix/sysv/linux/aarch64/bits/stat.h new file mode 100644 index 0000000..eec6789 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/stat.h @@ -0,0 +1,195 @@ +/* Copyright (C) 1992-2015 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STAT_H +#define _BITS_STAT_H 1 + +/* Versions of the `struct stat' data structure. */ +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL + +/* Versions of the `xmknod' interface. */ +#define _MKNOD_VER_LINUX 0 + +#ifdef __ILP32__ +#include +struct __kernel_timespec + { + unsigned long long tv_sec; /* Seconds. */ + long long tv_nsec; /* Nanoseconds. */ + }; +#define conv_timespec(u, k) do { \ + (u)->tv_sec = (k)->tv_sec; \ + (u)->tv_nsec = (k)->tv_nsec; \ +} while (0) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define __type3264(type, name) \ + type (name); type name##_pad +#else +#define __type3264(type, name) \ + type name##_pad; type name +#endif + +#else +#define __kernel_timespec timespec +#define conv_timespec(u, k) +#define __type3264(type, name) type name +#endif /* __ILP32__ */ + +struct stat + { + __dev_t st_dev; /* Device. */ + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + union { + struct timespec st_atim; /* Time of last access. */ + struct __kernel_timespec __st_atim; + }; + union { + struct timespec st_mtim; /* Time of last modification. */ + struct __kernel_timespec __st_mtim; + }; + union { + struct timespec st_ctim; /* Time of last status change. */ + struct __kernel_timespec __st_ctim; + }; +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __type3264(__time_t, st_atime); /* Time of last access. */ + __type3264(unsigned long int, st_atimensec); /* Nsecs of last access. */ + __type3264(__time_t, st_mtime); /* Time of last modification. */ + __type3264(unsigned long int, st_mtimensec); /* Nsecs of last modification. */ + __type3264(__time_t, st_ctime); /* Time of last status change. */ + __type3264(unsigned long int, st_ctimensec); /* Nsecs of last status change. */ +#endif + int __glibc_reserved[2]; + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + union { + struct timespec st_atim; /* Time of last access. */ + struct __kernel_timespec __st_atim; + }; + union { + struct timespec st_mtim; /* Time of last modification. */ + struct __kernel_timespec __st_mtim; + }; + union { + struct timespec st_ctim; /* Time of last status. */ + struct __kernel_timespec __st_ctim; + }; +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __type3264(__time_t, st_atime); /* Time of last access. */ + __type3264(unsigned long int, st_atimensec); /* Nsecs of last access. */ + __type3264(__time_t, st_mtime); /* Time of last modification. */ + __type3264(unsigned long int, st_mtimensec); /* Nsecs of last modification. */ + __type3264(__time_t, st_ctime); /* Time of last status change. */ + __type3264(unsigned long int, st_ctimensec); /* Nsecs of last status change. */ +#endif + int __glibc_reserved[2]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* POSIX.1b objects. Note that these macros always evaluate to zero. But + they do it by enforcing the correct use of the macros. */ +#define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) +#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#ifdef __USE_ATFILE +# define UTIME_NOW ((1l << 30) - 1l) +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#endif /* bits/stat.h */ diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h new file mode 100644 index 0000000..29273a3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h @@ -0,0 +1,64 @@ +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#ifndef _SYS_STATFS_H +# error "Never include directly; use instead." +#endif + +#include +#include +#include + +struct statfs + { + unsigned long long f_type; + unsigned long long f_bsize; + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_bavail; + __fsfilcnt_t f_files; + __fsfilcnt_t f_ffree; + __fsid_t f_fsid; + unsigned long long f_namelen; + unsigned long long f_frsize; + unsigned long long f_flags; + unsigned long long f_spare[4]; + }; + +#ifdef __USE_LARGEFILE64 +struct statfs64 + { + unsigned long long f_type; + unsigned long long f_bsize; + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_bavail; + __fsfilcnt_t f_files; + __fsfilcnt_t f_ffree; + __fsid_t f_fsid; + unsigned long long f_namelen; + unsigned long long f_frsize; + unsigned long long f_flags; + unsigned long long f_spare[4]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATFS_F_NAMELEN +#define _STATFS_F_FRSIZE +#define _STATFS_F_FLAGS diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c new file mode 100644 index 0000000..8e900fd --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include + +/* Return information about the filesystem on which FD resides. */ +int +__fstatfs (int fd, struct statfs *buf) +{ + return INLINE_SYSCALL (fstatfs64, 2, fd, buf); +} +weak_alias (__fstatfs, fstatfs) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c new file mode 100644 index 0000000..b37d238 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c @@ -0,0 +1,29 @@ +/* Return information about the filesystem on which FD resides. + Copyright (C) 1996-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 + . */ + +#include +#include +#include + +/* Return information about the filesystem on which FD resides. */ +int +__fstatfs64 (int fd, struct statfs64 *buf) +{ + return INLINE_SYSCALL (fstatfs64, 2, fd, buf); +} +weak_alias (__fstatfs64, fstatfs64) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c new file mode 100644 index 0000000..83df0e4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c @@ -0,0 +1,51 @@ +//#include +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file FD in BUF. */ +int +__fxstat (int vers, int fd, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstat64, 2, fd, buf); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + + return rc; + + } + + errno = EINVAL; + return -1; +} + +hidden_def (__fxstat) +weak_alias (__fxstat, _fxstat); diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c new file mode 100644 index 0000000..6e8a583 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c @@ -0,0 +1,44 @@ +/* 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 + . */ + +#include +#include +#include +#include + +#include +#include + +#include + +/* Get information about the file FD in BUF. */ + +int +___fxstat64 (int vers, int fd, struct stat64 *buf) +{ + int result; + result = INLINE_SYSCALL (fstat64, 2, fd, buf); + if (!result) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + return result; +} +strong_alias (___fxstat64, __fxstat64) +hidden_def (__fxstat64) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c new file mode 100644 index 0000000..fb03a7d --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c @@ -0,0 +1,48 @@ +//#include +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ +int +__fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, fd, file, buf, flag); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + return rc; + } + + errno = EINVAL; + return -1; +} +libc_hidden_def (__fxstatat) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c new file mode 100644 index 0000000..9d36ff4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c @@ -0,0 +1,52 @@ +//#include +/* 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 + . */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ + +int +__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) +{ + if (__glibc_unlikely (vers != _STAT_VER_LINUX)) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); + + int result; + INTERNAL_SYSCALL_DECL (err); + + result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag); + if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) { + conv_timespec(&st->st_atim, &st->__st_atim); + conv_timespec(&st->st_mtim, &st->__st_mtim); + conv_timespec(&st->st_ctim, &st->__st_ctim); + return 0; + } + else + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, + err)); +} +libc_hidden_def (__fxstatat64) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c new file mode 100644 index 0000000..e8de70e --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat.c @@ -0,0 +1,47 @@ +//#include +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ +int +__lxstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, + AT_SYMLINK_NOFOLLOW); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + return rc; + } + errno = EINVAL; + return -1; +} +hidden_def (__lxstat) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c new file mode 100644 index 0000000..50de0b1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ +int +__lxstat64 (int vers, const char *name, struct stat64 *buf) +{ + int result; + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, + AT_SYMLINK_NOFOLLOW); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + return rc; + } + errno = EINVAL; + return -1; +} +hidden_def (__lxstat64) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c new file mode 100644 index 0000000..bf70a7a --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include + +/* Return information about the filesystem on which FILE resides. */ +int +__statfs (const char *file, struct statfs *buf) +{ + return INLINE_SYSCALL (statfs64, 2, file, buf); +} +libc_hidden_def (__statfs) +weak_alias (__statfs, statfs) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c new file mode 100644 index 0000000..b99ab94 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2011-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include + +/* Return information about the filesystem on which FILE resides. */ +int +__statfs64 (const char *file, struct statfs64 *buf) +{ + return INLINE_SYSCALL (statfs64, 2, file, buf); +} +weak_alias (__statfs64,statfs64) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c new file mode 100644 index 0000000..b4e8423 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c @@ -0,0 +1,47 @@ +//#include +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ +int +__xstat (int vers, const char *name, struct stat *buf) +{ + if (vers == _STAT_VER_KERNEL) + { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + return rc; + } + + errno = EINVAL; + return -1; +} +hidden_def (__xstat) diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c new file mode 100644 index 0000000..e4f4cd5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c @@ -0,0 +1,47 @@ +//#include +/* Copyright (C) 2011-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 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 + . */ + +#include +#include +#include +#include +#include + +#include +#include + +/* Get information about the file NAME in BUF. */ +int +__xstat64 (int vers, const char *name, struct stat64 *buf) +{ + if (vers == _STAT_VER_KERNEL) { + int rc = INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); + if (!rc) { + conv_timespec(&buf->st_atim, &buf->__st_atim); + conv_timespec(&buf->st_mtim, &buf->__st_mtim); + conv_timespec(&buf->st_ctim, &buf->__st_ctim); + } + + return rc; + } + + errno = EINVAL; + return -1; +} +hidden_def (__xstat64)