From patchwork Sat Nov 29 11:29:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 4006 Received: (qmail 4706 invoked by alias); 29 Nov 2014 11:30:00 -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 4693 invoked by uid 89); 29 Nov 2014 11:29:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Sat, 29 Nov 2014 11:29:53 +0000 From: Joseph Myers To: Subject: Remove excess declarations from unistd.h for XPG3/XPG4 (bug 17665) Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 For XPG3/XPG4 (defined __USE_XOPEN && !defined __USE_UNIX98), unistd.h declares many functions that should only be declared for __USE_MISC (none of them are in XPG3/XPG4): sethostname sethostid getdomainname setdomainname vhangup revoke profil acct getusershell endusershell setusershell daemon. The whole block with the [__USE_MISC || (__USE_XOPEN && !__USE_UNIX98)] conditional contains only functions that are not in XPG3/XPG4, so this patch simply changes the conditional. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by this patch). 2014-11-29 Joseph Myers [BZ #17665] * posix/unistd.h [__USE_MISC || (__USE_XOPEN && !__USE_UNIX98)]: Change conditional to [__USE_MISC]. diff --git a/posix/unistd.h b/posix/unistd.h index ac81d92..59b3139 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -880,7 +880,7 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); #endif -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) +#if defined __USE_MISC /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (const char *__name, size_t __len) @@ -935,7 +935,7 @@ extern void setusershell (void) __THROW; /* Rewind and re-read the file. */ terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ extern int daemon (int __nochdir, int __noclose) __THROW __wur; -#endif /* Use misc || X/Open. */ +#endif /* Use misc. */ #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)