From owner-svn-src-head@freebsd.org Sun Dec 20 23:05:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC5AA4D78D; Sun, 20 Dec 2015 23:05:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9A75195A; Sun, 20 Dec 2015 23:05:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKN5KQK008236; Sun, 20 Dec 2015 23:05:20 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKN5KL7008232; Sun, 20 Dec 2015 23:05:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512202305.tBKN5KL7008232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 23:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292521 - in head/lib/libc: gen iconv net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 23:05:22 -0000 Author: jilles Date: Sun Dec 20 23:05:20 2015 New Revision: 292521 URL: https://svnweb.freebsd.org/changeset/base/292521 Log: libc: Use namespace.h in a few more files. libc now no longer calls fstat(), socketpair() and wait(), only the underscore-prefixed versions (_waitpid() instead of wait()). Modified: head/lib/libc/gen/getpeereid.c head/lib/libc/gen/sysconf.c head/lib/libc/iconv/citrus_mmap.c head/lib/libc/net/rcmdsh.c Modified: head/lib/libc/gen/getpeereid.c ============================================================================== --- head/lib/libc/gen/getpeereid.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/gen/getpeereid.c Sun Dec 20 23:05:20 2015 (r292521) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "un-namespace.h" int getpeereid(int s, uid_t *euid, gid_t *egid) @@ -43,7 +45,7 @@ getpeereid(int s, uid_t *euid, gid_t *eg int error; xuclen = sizeof(xuc); - error = getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); if (xuc.cr_version != XUCRED_VERSION) Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/gen/sysconf.c Sun Dec 20 23:05:20 2015 (r292521) @@ -36,6 +36,7 @@ static char sccsid[] = "@(#)sysconf.c 8. #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include /* we just need the limits */ #include #include +#include "un-namespace.h" #include "../stdlib/atexit.h" #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ @@ -575,10 +577,10 @@ yesno: case _SC_IPV6: #if _POSIX_IPV6 == 0 sverrno = errno; - value = socket(PF_INET6, SOCK_DGRAM, 0); + value = _socket(PF_INET6, SOCK_DGRAM, 0); errno = sverrno; if (value >= 0) { - close(value); + _close(value); return (200112L); } else return (0); Modified: head/lib/libc/iconv/citrus_mmap.c ============================================================================== --- head/lib/libc/iconv/citrus_mmap.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/iconv/citrus_mmap.c Sun Dec 20 23:05:20 2015 (r292521) @@ -27,6 +27,7 @@ * SUCH DAMAGE. */ +#include "namespace.h" #include #include #include @@ -40,6 +41,7 @@ #include #include #include +#include "un-namespace.h" #include "citrus_namespace.h" #include "citrus_region.h" @@ -57,10 +59,10 @@ _citrus_map_file(struct _citrus_region * _region_init(r, NULL, 0); - if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) + if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) return (errno); - if (fstat(fd, &st) == -1) { + if (_fstat(fd, &st) == -1) { ret = errno; goto error; } @@ -78,7 +80,7 @@ _citrus_map_file(struct _citrus_region * _region_init(r, head, (size_t)st.st_size); error: - (void)close(fd); + (void)_close(fd); return (ret); } Modified: head/lib/libc/net/rcmdsh.c ============================================================================== --- head/lib/libc/net/rcmdsh.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/net/rcmdsh.c Sun Dec 20 23:05:20 2015 (r292521) @@ -36,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -48,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "un-namespace.h" /* * This is a replacement rcmd() function that uses the rsh(1) @@ -99,7 +101,7 @@ rcmdsh(char **ahost, int rport, const ch } /* Get a socketpair we'll use for stdin and stdout. */ - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { + if (_socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { perror("rcmdsh: socketpair"); return (-1); } @@ -112,8 +114,8 @@ rcmdsh(char **ahost, int rport, const ch /* * Child. We use sp[1] to be stdin/stdout, and close sp[0]. */ - (void)close(sp[0]); - if (dup2(sp[1], 0) == -1 || dup2(0, 1) == -1) { + (void)_close(sp[0]); + if (_dup2(sp[1], 0) == -1 || _dup2(0, 1) == -1) { perror("rcmdsh: dup2 failed"); _exit(255); } @@ -156,9 +158,9 @@ rcmdsh(char **ahost, int rport, const ch _exit(255); } else { /* Parent. close sp[1], return sp[0]. */ - (void)close(sp[1]); + (void)_close(sp[1]); /* Reap child. */ - (void)wait(NULL); + (void)_waitpid(cpid, NULL, 0); return (sp[0]); } /* NOTREACHED */