From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbcFUIoh (ORCPT ); Tue, 21 Jun 2016 04:44:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:53659 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbcFUIii (ORCPT ); Tue, 21 Jun 2016 04:38:38 -0400 From: Andreas Schwab To: Yury Norov Cc: , , , , , , , , , , , Yury Norov Subject: Re: [PATCH 22/27] [AARCH64] ILP32: support stat syscall family References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> <1466485631-3532-24-git-send-email-ynorov@caviumnetworks.com> X-Yow: I'm dressing up in an ill-fitting IVY-LEAGUE SUIT!! Too late... Date: Tue, 21 Jun 2016 10:38:30 +0200 In-Reply-To: <1466485631-3532-24-git-send-email-ynorov@caviumnetworks.com> (Yury Norov's message of "Tue, 21 Jun 2016 08:07:06 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > 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..81a8626 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h > @@ -0,0 +1,72 @@ > +/* 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 > + > +/* 64-bit libc uses the kernel's 'struct statfs', accessed via the > + statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64' > + and accesses it via the statfs64() syscall. All the various > + APIs offered by libc use the kernel shape for their struct statfs > + structure; the only difference is that 32-bit programs not > + using __USE_FILE_OFFSET64 only see the low 32 bits of some > + of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */ Is that comment accurate? > 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..d7b90bb > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c > @@ -0,0 +1,72 @@ > +/* 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 > +#include > +#include > +#include > + > +/* Defined in statfs64.c. */ > +extern int __no_statfs64 attribute_hidden; No need for probing, statfs64 is always available. > 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..f651921 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c > @@ -0,0 +1,54 @@ > +/* 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; > +} > + > +#include > + > +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) No need for compat symbols in a new port. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."