diff options
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 18 | ||||
-rw-r--r-- | lib/libc/stdlib/random.c | 6 | ||||
-rw-r--r-- | lib/libc/stdlib/realpath.c | 6 | ||||
-rw-r--r-- | lib/libc/stdlib/system.c | 5 |
4 files changed, 17 insertions, 18 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index bf41790..ac0dd48 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -72,7 +72,7 @@ static int fdzero; # define MMAP_FD fdzero # define INIT_MMAP() \ - { if ((fdzero = _libc_open("/dev/zero", O_RDWR, 0000)) == -1) \ + { if ((fdzero = _open("/dev/zero", O_RDWR, 0000)) == -1) \ wrterror("open of /dev/zero"); } # define MADV_FREE MADV_DONTNEED #endif /* __sparc__ */ @@ -275,10 +275,10 @@ static void wrterror(char *p) { char *q = " error: "; - _libc_write(STDERR_FILENO, __progname, strlen(__progname)); - _libc_write(STDERR_FILENO, malloc_func, strlen(malloc_func)); - _libc_write(STDERR_FILENO, q, strlen(q)); - _libc_write(STDERR_FILENO, p, strlen(p)); + _write(STDERR_FILENO, __progname, strlen(__progname)); + _write(STDERR_FILENO, malloc_func, strlen(malloc_func)); + _write(STDERR_FILENO, q, strlen(q)); + _write(STDERR_FILENO, p, strlen(p)); suicide = 1; abort(); } @@ -289,10 +289,10 @@ wrtwarning(char *p) char *q = " warning: "; if (malloc_abort) wrterror(p); - _libc_write(STDERR_FILENO, __progname, strlen(__progname)); - _libc_write(STDERR_FILENO, malloc_func, strlen(malloc_func)); - _libc_write(STDERR_FILENO, q, strlen(q)); - _libc_write(STDERR_FILENO, p, strlen(p)); + _write(STDERR_FILENO, __progname, strlen(__progname)); + _write(STDERR_FILENO, malloc_func, strlen(malloc_func)); + _write(STDERR_FILENO, q, strlen(q)); + _write(STDERR_FILENO, p, strlen(p)); } /* diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 1729589..e8e8254 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -298,11 +298,11 @@ srandomdev() len = rand_deg * sizeof state[0]; done = 0; - fd = _libc_open("/dev/urandom", O_RDONLY, 0); + fd = _open("/dev/urandom", O_RDONLY, 0); if (fd >= 0) { - if (_libc_read(fd, (void *) state, len) == (ssize_t) len) + if (_read(fd, (void *) state, len) == (ssize_t) len) done = 1; - _libc_close(fd); + _close(fd); } if (!done) { diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index b956513..0217dde 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -67,7 +67,7 @@ realpath(path, resolved) int symlinks = 0; /* Save the starting point. */ - if ((fd = _libc_open(".", O_RDONLY)) < 0) { + if ((fd = _open(".", O_RDONLY)) < 0) { (void)strcpy(resolved, "."); return (NULL); } @@ -154,12 +154,12 @@ loop: } /* It's okay if the close fails, what's an fd more or less? */ - (void)_libc_close(fd); + (void)_close(fd); return (resolved); err1: serrno = errno; (void)fchdir(fd); -err2: (void)_libc_close(fd); +err2: (void)_close(fd); errno = serrno; return (NULL); } diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c index 0039c078..236a8b0 100644 --- a/lib/libc/stdlib/system.c +++ b/lib/libc/stdlib/system.c @@ -84,7 +84,7 @@ __system(command) _exit(127); default: /* parent */ do { - pid = _libc_waitpid(pid, &pstat, 0); + pid = _wait4(pid, &pstat, 0, (struct rusage *)0); } while (pid == -1 && errno == EINTR); break; } @@ -94,5 +94,4 @@ __system(command) return(pid == -1 ? -1 : pstat); } -__weak_reference(__system, _libc_system); -__weak_reference(_libc_system, system); +__weak_reference(__system, system); |