From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id A0C0D385781A for ; Tue, 29 Jun 2021 13:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0C0D385781A Received: by mail-pf1-x435.google.com with SMTP id s14so15906429pfg.0 for ; Tue, 29 Jun 2021 06:21:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zVpE/1Ou0/AeSboeBH3kLFapmGWl9/4FaHQGqtv1lH0=; b=KaRv3zO4qOzRIfTNJrZZeTR2O+6uK+4co6STnK0WnyU4v5sCS3y8MG35TzWRdO83V6 fTvKZ9bqnM2dHLXvyenS9xnTlM9lFDhSXGRxxyv3oenA9S7dkeRlolc4WX9nl5jmoF/z J1h9EhKd0lezBhPmodXMzKFD8TXLXXUJxSa1IJLA05LdBuL8Fp9UNP/3z7zXGyZv0zMx wdfm35YZu8vmLfmF39aBi0pOmoDjnjEelCWxty3iWl9cpfr5u9Jp6CC9KFUK/r5WiQG+ I7vD7Am7kVi+PivqPvRxoH836NH9Nnm+jfu0s0h0KBoKEN/tS47XiFT7GZRY9Ph404dy 9dBQ== X-Gm-Message-State: AOAM5336AG/or/fZunve4KWpI/tgyRxoNG3mVhEMds6rDTZu+vmYRNYf wqWQjJROF1AUdekl3LVkO9ZKnA== X-Google-Smtp-Source: ABdhPJzGveZHDexoHMuItz/IcdZvImi6+Z1p/pNWFdnkIIa+BoPgHoVSqAr6XJN5n8YFLhX6pEVtjA== X-Received: by 2002:a62:150c:0:b029:30d:fe79:c343 with SMTP id 12-20020a62150c0000b029030dfe79c343mr5195552pfv.29.1624972893641; Tue, 29 Jun 2021 06:21:33 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id e4sm17605395pfa.29.2021.06.29.06.21.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 06:21:33 -0700 (PDT) Subject: Re: [PATCH 1/3] login: Hidden prototypes for _getpt, __ptsname_r, grantpt, unlockpt To: libc-alpha@sourceware.org, Florian Weimer References: From: Adhemerval Zanella Message-ID: <3144a2de-8d30-284e-a1fa-3a552d1aa6ad@linaro.org> Date: Tue, 29 Jun 2021 10:21:30 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2021 13:21:40 -0000 LGTM, thanks. Reviewed-by: Adhemerval Zanella 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 > #include > #include > - > +#include > > /* 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 > #include > #include > +#include > > /* 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) >