diff options
author | jasone <jasone@FreeBSD.org> | 2000-01-12 09:23:48 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-01-12 09:23:48 +0000 |
commit | 75903038bc52105bc7479fe5f2b75f22f10c1c50 (patch) | |
tree | c9e28eda650bbd7eaa3eb22c8d7c75d00a96a451 /lib/libc/stdio | |
parent | 688bb99b3f790aad607b949661d0361486bbe346 (diff) | |
download | FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.zip FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.tar.gz |
Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/fdopen.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fopen.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/freopen.c | 6 | ||||
-rw-r--r-- | lib/libc/stdio/gets.c | 2 | ||||
-rw-r--r-- | lib/libc/stdio/mktemp.c | 2 | ||||
-rw-r--r-- | lib/libc/stdio/stdio.c | 6 | ||||
-rw-r--r-- | lib/libc/stdio/tmpfile.c | 4 |
7 files changed, 17 insertions, 11 deletions
diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index 48ea401..1c56a9d 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -61,7 +63,7 @@ fdopen(fd, mode) return (NULL); /* Make sure the mode the user wants is a subset of the actual mode. */ - if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0) + if ((fdflags = _libc_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 9199755..d41122c 100644 --- a/lib/libc/stdio/fopen.c +++ b/lib/libc/stdio/fopen.c @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -58,7 +60,7 @@ fopen(file, mode) return (NULL); if ((fp = __sfp()) == NULL) return (NULL); - if ((f = open(file, oflags, DEFFILEMODE)) < 0) { + if ((f = _libc_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 9de6724..39399f3 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 = open(file, oflags, DEFFILEMODE); + f = _libc_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 = open(file, oflags, DEFFILEMODE); + f = _libc_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) close(f); + (void)_libc_close(f); f = wantfd; } } diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c index da90fe2..42c5da2 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) write(STDERR_FILENO, w, sizeof(w) - 1); + (void) _libc_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 cd24449..98f0170 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 = - open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) + _libc_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 e12dc28..777f336 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 = read(fp->_file, buf, (size_t)n); + ret = _libc_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 (write(fp->_file, buf, (size_t)n)); + return (_libc_write(fp->_file, buf, (size_t)n)); } fpos_t @@ -107,5 +107,5 @@ __sclose(cookie) void *cookie; { - return (close(((FILE *)cookie)->_file)); + return (_libc_close(((FILE *)cookie)->_file)); } diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c index 3c5e97e..d4beac6 100644 --- a/lib/libc/stdio/tmpfile.c +++ b/lib/libc/stdio/tmpfile.c @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -72,7 +74,7 @@ tmpfile() if ((fp = fdopen(fd, "w+")) == NULL) { sverrno = errno; - (void)close(fd); + (void)_libc_close(fd); errno = sverrno; return (NULL); } |