aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>2000-01-27 23:07:25 +0000
committerJason Evans <jasone@FreeBSD.org>2000-01-27 23:07:25 +0000
commit9233c4d9426e03b28e043baeefb6d5a37dc4086e (patch)
tree8606358bf2ae9c436cce380d290e7a73f9cddfc6 /lib/libc/stdio
parent072229cdbb757229b7e11f102da326679db27d0e (diff)
downloadsrc-9233c4d9426e03b28e043baeefb6d5a37dc4086e.tar.gz
src-9233c4d9426e03b28e043baeefb6d5a37dc4086e.zip
Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
Notes
Notes: svn path=/head/; revision=56698
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/fdopen.c2
-rw-r--r--lib/libc/stdio/fopen.c2
-rw-r--r--lib/libc/stdio/freopen.c6
-rw-r--r--lib/libc/stdio/gets.c2
-rw-r--r--lib/libc/stdio/mktemp.c2
-rw-r--r--lib/libc/stdio/stdio.c6
-rw-r--r--lib/libc/stdio/tmpfile.c2
7 files changed, 11 insertions, 11 deletions
diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c
index 1c56a9d466b6..44341b39a500 100644
--- a/lib/libc/stdio/fdopen.c
+++ b/lib/libc/stdio/fdopen.c
@@ -63,7 +63,7 @@ fdopen(fd, mode)
return (NULL);
/* Make sure the mode the user wants is a subset of the actual mode. */
- if ((fdflags = _libc_fcntl(fd, F_GETFL, 0)) < 0)
+ if ((fdflags = _fcntl(fd, F_GETFL, 0)) < 0)
return (NULL);
tmp = fdflags & O_ACCMODE;
if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) {
diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c
index d41122c5bbe9..1ef6bda15da1 100644
--- a/lib/libc/stdio/fopen.c
+++ b/lib/libc/stdio/fopen.c
@@ -60,7 +60,7 @@ fopen(file, mode)
return (NULL);
if ((fp = __sfp()) == NULL)
return (NULL);
- if ((f = _libc_open(file, oflags, DEFFILEMODE)) < 0) {
+ if ((f = _open(file, oflags, DEFFILEMODE)) < 0) {
fp->_flags = 0; /* release */
return (NULL);
}
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c
index 39399f3b907a..f6fa7541f5a7 100644
--- a/lib/libc/stdio/freopen.c
+++ b/lib/libc/stdio/freopen.c
@@ -100,13 +100,13 @@ freopen(file, mode, fp)
}
/* Get a new descriptor to refer to the new file. */
- f = _libc_open(file, oflags, DEFFILEMODE);
+ f = _open(file, oflags, DEFFILEMODE);
if (f < 0 && isopen) {
/* If out of fd's close the old one and try again. */
if (errno == ENFILE || errno == EMFILE) {
(void) (*fp->_close)(fp->_cookie);
isopen = 0;
- f = _libc_open(file, oflags, DEFFILEMODE);
+ f = _open(file, oflags, DEFFILEMODE);
}
}
sverrno = errno;
@@ -147,7 +147,7 @@ freopen(file, mode, fp)
*/
if (wantfd >= 0 && f != wantfd) {
if (dup2(f, wantfd) >= 0) {
- (void)_libc_close(f);
+ (void)_close(f);
f = wantfd;
}
}
diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c
index 42c5da2e57fc..1f9be80c6dd6 100644
--- a/lib/libc/stdio/gets.c
+++ b/lib/libc/stdio/gets.c
@@ -59,7 +59,7 @@ gets(buf)
"warning: this program uses gets(), which is unsafe.\n";
if (!warned) {
- (void) _libc_write(STDERR_FILENO, w, sizeof(w) - 1);
+ (void) _write(STDERR_FILENO, w, sizeof(w) - 1);
warned = 1;
}
for (s = buf; (c = getchar()) != '\n';)
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index 98f017019568..13e15d40027a 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -163,7 +163,7 @@ _gettemp(path, doopen, domkdir, slen)
for (;;) {
if (doopen) {
if ((*doopen =
- _libc_open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
+ _open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
return(1);
if (errno != EEXIST)
return(0);
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index 777f33677ec0..b8a3f47aa148 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -60,7 +60,7 @@ __sread(cookie, buf, n)
register FILE *fp = cookie;
register int ret;
- ret = _libc_read(fp->_file, buf, (size_t)n);
+ ret = _read(fp->_file, buf, (size_t)n);
/* if the read succeeded, update the current offset */
if (ret >= 0)
fp->_offset += ret;
@@ -80,7 +80,7 @@ __swrite(cookie, buf, n)
if (fp->_flags & __SAPP)
(void) lseek(fp->_file, (off_t)0, SEEK_END);
fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
- return (_libc_write(fp->_file, buf, (size_t)n));
+ return (_write(fp->_file, buf, (size_t)n));
}
fpos_t
@@ -107,5 +107,5 @@ __sclose(cookie)
void *cookie;
{
- return (_libc_close(((FILE *)cookie)->_file));
+ return (_close(((FILE *)cookie)->_file));
}
diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c
index d4beac6be13f..a0162c24f153 100644
--- a/lib/libc/stdio/tmpfile.c
+++ b/lib/libc/stdio/tmpfile.c
@@ -74,7 +74,7 @@ tmpfile()
if ((fp = fdopen(fd, "w+")) == NULL) {
sverrno = errno;
- (void)_libc_close(fd);
+ (void)_close(fd);
errno = sverrno;
return (NULL);
}