public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH 1/3] login: Hidden prototypes for _getpt, __ptsname_r, grantpt, unlockpt
Date: Tue, 29 Jun 2021 10:21:30 -0300	[thread overview]
Message-ID: <3144a2de-8d30-284e-a1fa-3a552d1aa6ad@linaro.org> (raw)
In-Reply-To: <d034541e130b49c4b2069f0947328b7d1e60e4c2.1624275874.git.fweimer@redhat.com>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

On 21/06/2021 08:46, Florian Weimer via Libc-alpha wrote:
> ---
>  include/stdlib.h                   | 6 ++++++
>  login/getpt.c                      | 1 +
>  login/grantpt.c                    | 2 +-
>  login/ptsname.c                    | 1 +
>  sysdeps/mach/hurd/ptsname.c        | 1 +
>  sysdeps/unix/bsd/getpt.c           | 3 ++-
>  sysdeps/unix/bsd/unlockpt.c        | 1 +
>  sysdeps/unix/grantpt.c             | 1 +
>  sysdeps/unix/sysv/linux/getpt.c    | 2 ++
>  sysdeps/unix/sysv/linux/grantpt.c  | 1 +
>  sysdeps/unix/sysv/linux/ptsname.c  | 1 +
>  sysdeps/unix/sysv/linux/unlockpt.c | 1 +
>  12 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/include/stdlib.h b/include/stdlib.h
> index e2453c1896..1f6e1508e4 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -137,6 +137,12 @@ libc_hidden_proto (__libc_reallocarray)
>  
>  extern int __libc_system (const char *line);
>  
> +extern __typeof (getpt) __getpt;
> +extern __typeof (ptsname_r) __ptsname_r;
> +libc_hidden_proto (__getpt)
> +libc_hidden_proto (__ptsname_r)
> +libc_hidden_proto (grantpt)
> +libc_hidden_proto (unlockpt)
>  
>  extern double __strtod_internal (const char *__restrict __nptr,
>  				 char **__restrict __endptr, int __group)
> diff --git a/login/getpt.c b/login/getpt.c
> index 585bc3bffd..9b71765705 100644
> --- a/login/getpt.c
> +++ b/login/getpt.c
> @@ -27,6 +27,7 @@ __getpt (void)
>    __set_errno (ENOSYS);
>    return -1;
>  }
> +libc_hidden_def (__getpt)
>  weak_alias (__getpt, getpt)
>  
>  /* We cannot define posix_openpt in general for BSD systems.  */
> diff --git a/login/grantpt.c b/login/grantpt.c
> index 7dc5db3fb7..939096682a 100644
> --- a/login/grantpt.c
> +++ b/login/grantpt.c
> @@ -28,5 +28,5 @@ grantpt (int fd __attribute__ ((unused)))
>    __set_errno (ENOSYS);
>    return -1;
>  }
> -
> +libc_hidden_def (grantpt)
>  stub_warning (grantpt)
> diff --git a/login/ptsname.c b/login/ptsname.c
> index c42f27d07b..ae94fbddf4 100644
> --- a/login/ptsname.c
> +++ b/login/ptsname.c
> @@ -38,6 +38,7 @@ __ptsname_r (int fd __attribute__ ((unused)),
>    __set_errno (ENOSYS);
>    return ENOSYS;
>  }
> +libc_hidden_def (__ptsname_r)
>  weak_alias (__ptsname_r, ptsname_r)
>  
>  stub_warning(ptsname)
> diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c
> index d5f21a766f..5405b8f981 100644
> --- a/sysdeps/mach/hurd/ptsname.c
> +++ b/sysdeps/mach/hurd/ptsname.c
> @@ -88,4 +88,5 @@ __ptsname_r (int fd, char *buf, size_t buflen)
>  {
>    return __ptsname_internal (fd, buf, buflen, NULL);
>  }
> +libc_hidden_def (__ptsname_r)
>  weak_alias (__ptsname_r, ptsname_r)
> diff --git a/sysdeps/unix/bsd/getpt.c b/sysdeps/unix/bsd/getpt.c
> index 1dde0cc4f1..2fa6632327 100644
> --- a/sysdeps/unix/bsd/getpt.c
> +++ b/sysdeps/unix/bsd/getpt.c
> @@ -20,7 +20,7 @@
>  #include <fcntl.h>
>  #include <string.h>
>  #include <unistd.h>
> -
> +#include <stdlib.h>
>  
>  /* Prefix for master pseudo terminal nodes.  */
>  #define _PATH_PTY "/dev/pty"
> @@ -79,6 +79,7 @@ __getpt (void)
>  {
>    return __bsd_openpt (O_RDWR);
>  }
> +libc_hidden_def (__getpt)
>  weak_alias (__getpt, getpt)
>  
>  int
> diff --git a/sysdeps/unix/bsd/unlockpt.c b/sysdeps/unix/bsd/unlockpt.c
> index 6cfdb93d36..181e615cc6 100644
> --- a/sysdeps/unix/bsd/unlockpt.c
> +++ b/sysdeps/unix/bsd/unlockpt.c
> @@ -39,3 +39,4 @@ unlockpt (int fd)
>      }
>    return __revoke (buf);
>  }
> +libc_hidden_def (unlockpt)
> diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c
> index 46b6f56629..6269ee2bd6 100644
> --- a/sysdeps/unix/grantpt.c
> +++ b/sysdeps/unix/grantpt.c
> @@ -258,3 +258,4 @@ grantpt (int fd)
>  
>    return retval;
>  }
> +libc_hidden_def (grantpt)
> diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
> index 784110abbf..52532f7190 100644
> --- a/sysdeps/unix/sysv/linux/getpt.c
> +++ b/sysdeps/unix/sysv/linux/getpt.c
> @@ -19,6 +19,7 @@
>  #include <fcntl.h>
>  #include <unistd.h>
>  #include <paths.h>
> +#include <stdlib.h>
>  
>  /* Path to the master pseudo terminal cloning device.  */
>  #define _PATH_DEVPTMX _PATH_DEV "ptmx"
> @@ -37,4 +38,5 @@ __getpt (void)
>  {
>    return __posix_openpt (O_RDWR);
>  }
> +libc_hidden_def (__getpt)
>  weak_alias (__getpt, getpt)
> diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
> index b4addfded9..57e988fe36 100644
> --- a/sysdeps/unix/sysv/linux/grantpt.c
> +++ b/sysdeps/unix/sysv/linux/grantpt.c
> @@ -39,3 +39,4 @@ grantpt (int fd)
>      __set_errno (EINVAL);
>    return ret;
>  }
> +libc_hidden_def (grantpt)
> diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c
> index b9701da514..9f78ef42d8 100644
> --- a/sysdeps/unix/sysv/linux/ptsname.c
> +++ b/sysdeps/unix/sysv/linux/ptsname.c
> @@ -79,4 +79,5 @@ __ptsname_r (int fd, char *buf, size_t buflen)
>    __set_errno (save_errno);
>    return 0;
>  }
> +libc_hidden_def (__ptsname_r)
>  weak_alias (__ptsname_r, ptsname_r)
> diff --git a/sysdeps/unix/sysv/linux/unlockpt.c b/sysdeps/unix/sysv/linux/unlockpt.c
> index 57d08d8e96..ae5148afe7 100644
> --- a/sysdeps/unix/sysv/linux/unlockpt.c
> +++ b/sysdeps/unix/sysv/linux/unlockpt.c
> @@ -35,3 +35,4 @@ unlockpt (int fd)
>      __set_errno (EINVAL);
>    return ret;
>  }
> +libc_hidden_def (unlockpt)
> 

  reply	other threads:[~2021-06-29 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 11:46 [PATCH 0/3] Move libutil into libc Florian Weimer
2021-06-21 11:46 ` [PATCH 1/3] login: Hidden prototypes for _getpt, __ptsname_r, grantpt, unlockpt Florian Weimer
2021-06-29 13:21   ` Adhemerval Zanella [this message]
2021-06-21 11:46 ` [PATCH 2/3] login: Rework hidden prototypes for __setutent, __utmpname, __endutent Florian Weimer
2021-06-29 13:22   ` Adhemerval Zanella
2021-06-21 11:47 ` [PATCH 3/3] login: Move libutil into libc Florian Weimer
2021-06-29 14:09   ` Adhemerval Zanella

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=3144a2de-8d30-284e-a1fa-3a552d1aa6ad@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --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).