public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH 28/30] Linux: Make generic fcntl.h the default one
Date: Tue, 6 Dec 2022 12:36:02 -0500	[thread overview]
Message-ID: <88a45e8e-d803-bf90-57b1-328842283bb3@redhat.com> (raw)
In-Reply-To: <20221019221433.1082017-29-adhemerval.zanella@linaro.org>

On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote:
> It is currently used for csky, arc, nios2, and or1k.  Newer 64 bit
> architecture, like riscv32 and loongarch, reimplement it to override
> F_GETLK64/F_SETLK64/F_SETLKW64.

LGTM.

No regressions on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>


> ---
>  sysdeps/unix/sysv/linux/bits/fcntl.h         | 56 +++++++++++++++++++-
>  sysdeps/unix/sysv/linux/generic/bits/fcntl.h | 55 -------------------
>  2 files changed, 54 insertions(+), 57 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/bits/fcntl.h
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h
> index be40350e82..112ee96df5 100644
> --- a/sysdeps/unix/sysv/linux/bits/fcntl.h
> +++ b/sysdeps/unix/sysv/linux/bits/fcntl.h
> @@ -1,3 +1,55 @@
> -/* bits/fcntl.h is architecture specific.  */
> -#error "This file must be supplied by every Linux architecture."
> +/* O_*, F_*, FD_* bit values for the generic Linux ABI.
> +   Copyright (C) 2011-2022 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
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef	_FCNTL_H
> +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
> +#endif
> +
> +#include <bits/wordsize.h>
> +
> +#if __WORDSIZE == 64
> +# define __O_LARGEFILE	0
> +#endif
> +
> +struct flock
> +  {
> +    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
> +    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
> +#ifndef __USE_FILE_OFFSET64
> +    __off_t l_start;	/* Offset where the lock begins.  */
> +    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
> +#else
> +    __off64_t l_start;	/* Offset where the lock begins.  */
> +    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
> +#endif
> +    __pid_t l_pid;	/* Process holding the lock.  */
> +  };
> +
> +#ifdef __USE_LARGEFILE64
> +struct flock64
> +  {
> +    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
> +    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
> +    __off64_t l_start;	/* Offset where the lock begins.  */
> +    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
> +    __pid_t l_pid;	/* Process holding the lock.  */
> +  };
> +#endif
> +
> +/* Include generic Linux declarations.  */
> +#include <bits/fcntl-linux.h>

OK. Move generic to linux. Flattens the structure and one less file to maintain.

> diff --git a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
> deleted file mode 100644
> index 112ee96df5..0000000000
> --- a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -/* O_*, F_*, FD_* bit values for the generic Linux ABI.
> -   Copyright (C) 2011-2022 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
> -   <https://www.gnu.org/licenses/>.  */
> -
> -#ifndef	_FCNTL_H
> -# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
> -#endif
> -
> -#include <bits/wordsize.h>
> -
> -#if __WORDSIZE == 64
> -# define __O_LARGEFILE	0
> -#endif
> -
> -struct flock
> -  {
> -    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
> -    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
> -#ifndef __USE_FILE_OFFSET64
> -    __off_t l_start;	/* Offset where the lock begins.  */
> -    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
> -#else
> -    __off64_t l_start;	/* Offset where the lock begins.  */
> -    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
> -#endif
> -    __pid_t l_pid;	/* Process holding the lock.  */
> -  };
> -
> -#ifdef __USE_LARGEFILE64
> -struct flock64
> -  {
> -    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
> -    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
> -    __off64_t l_start;	/* Offset where the lock begins.  */
> -    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
> -    __pid_t l_pid;	/* Process holding the lock.  */
> -  };
> -#endif
> -
> -/* Include generic Linux declarations.  */
> -#include <bits/fcntl-linux.h>

-- 
Cheers,
Carlos.


  reply	other threads:[~2022-12-06 17:36 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 22:14 [PATCH 00/30] Remove Linux generic sysdep Adhemerval Zanella
2022-10-19 22:14 ` [PATCH 01/30] linux: Fix generic struct_stat for 64 bit time (BZ# 29657) Adhemerval Zanella
2022-10-25 17:50   ` Joseph Myers
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 02/30] linux: Consolidate dl-origin.c Adhemerval Zanella
2022-10-19 22:14 ` [PATCH 03/30] Linux: consolidate chmod implementation Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 04/30] Linux: consolidate chown implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 05/30] Linux: consolidate dup2 implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 06/30] Lninux: consolidate epoll_create implementation Adhemerval Zanella
2022-10-21  8:57   ` Florian Weimer
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 07/30] Linux: consolidate inotify_init implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 08/30] Linux: consolidate lchown implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 09/30] Linux: consolidate link implementation Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 10/30] Linux: consolidate mkdir implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 11/30] Linux: consolidate readlink implementation Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 12/30] Linux: consolidate rmdir implementation Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 13/30] Linux: consolidate symlink implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 14/30] Linux: consolidate unlink implementation Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 15/30] Linux: consolidate sendfile implementation Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 16/30] Linux: Move wordsize-32 Version to default Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-12-07  0:10     ` Joseph Myers
2022-12-07 20:19       ` Adhemerval Zanella Netto
2022-10-19 22:14 ` [PATCH 17/30] Linux: consolidate ____longjmp_chk Adhemerval Zanella
2022-12-05 16:40   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 18/30] Linux: Assume and consolidate bind wire-up syscall Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 19/30] Linux: Assume iand consolidate socket " Adhemerval Zanella
2022-12-05 16:39   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 20/30] Linux: Assume and consolidate socketpair " Adhemerval Zanella
2022-12-06 16:15   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 21/30] Linux: Assume and consolidate listen " Adhemerval Zanella
2022-12-06 16:17   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 22/30] Linux: Assume and consolidate getsockname " Adhemerval Zanella
2022-10-20  0:01   ` Joseph Myers
2022-10-20 18:12     ` Adhemerval Zanella Netto
2022-12-06 16:18   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 23/30] Linux: Assume and consolidate getpeername " Adhemerval Zanella
2022-10-20  0:02   ` Joseph Myers
2022-12-06 16:20   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 24/30] Linux: Assume and consolidate shutdown " Adhemerval Zanella
2022-12-06 16:23   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 25/30] Linux: Remove unused generic Makefile Adhemerval Zanella
2022-12-06 17:24   ` Carlos O'Donell
2022-12-07 21:19     ` Adhemerval Zanella Netto
2022-10-19 22:14 ` [PATCH 26/30] Linux: Remove generic sysdep Adhemerval Zanella
2022-12-06 17:29   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 27/30] Linux: make generic xstatver.h the default one Adhemerval Zanella
2022-12-06 17:33   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 28/30] Linux: Make generic fcntl.h " Adhemerval Zanella
2022-12-06 17:36   ` Carlos O'Donell [this message]
2022-10-19 22:14 ` [PATCH 29/30] Linux: Consolidate typesizes.h Adhemerval Zanella
2022-12-06 17:47   ` Carlos O'Donell
2022-10-19 22:14 ` [PATCH 30/30] Linux: Remove generic Implies Adhemerval Zanella
2022-12-06 17:50   ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88a45e8e-d803-bf90-57b1-328842283bb3@redhat.com \
    --to=carlos@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).