diff options
author | Peter Galbavy <peter@cvs.openbsd.org> | 1998-07-21 13:54:06 +0000 |
---|---|---|
committer | Peter Galbavy <peter@cvs.openbsd.org> | 1998-07-21 13:54:06 +0000 |
commit | 2979ca23937f55308c22a0cf2acb66a4525843c0 (patch) | |
tree | 028173e908f14aa9b6c604cbab6f002858dbe4c4 | |
parent | 0294ed9251849ce79ab3d4cc45841a9f6de82844 (diff) |
fix up those 13 broken merges
-rw-r--r-- | lib/libpthread/Makefile | 24 | ||||
-rw-r--r-- | lib/libpthread/include/stdio.h | 193 | ||||
-rw-r--r-- | lib/libpthread/stdio/fprintf.c | 3 | ||||
-rw-r--r-- | lib/libpthread/stdio/fscanf.c | 3 | ||||
-rw-r--r-- | lib/libpthread/stdio/fseek.c | 18 | ||||
-rw-r--r-- | lib/libpthread/stdio/ftell.c | 15 | ||||
-rw-r--r-- | lib/libpthread/stdio/funopen.c | 17 | ||||
-rw-r--r-- | lib/libpthread/stdio/scanf.c | 5 | ||||
-rw-r--r-- | lib/libpthread/stdio/snprintf.c | 4 | ||||
-rw-r--r-- | lib/libpthread/stdio/sprintf.c | 6 | ||||
-rw-r--r-- | lib/libpthread/stdio/sscanf.c | 3 | ||||
-rw-r--r-- | lib/libpthread/stdio/tempnam.c | 4 | ||||
-rw-r--r-- | lib/libpthread/stdio/vfscanf.c | 5 |
13 files changed, 164 insertions, 136 deletions
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index 594cb54326f..0af5927b9b2 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -1,21 +1,17 @@ -# from: @(#)Makefile 5.2 (Berkeley) 3/5/91 +# Generated automatically from Makefile.in by configure. +# @(#)Makefile 5.2 (Berkeley) 3/5/91 +# LIB=pthread NOPIC= no CPPFLAGS+= -DPTHREAD_KERNEL -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE_ARCH} -.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" -.include "${.CURDIR}/pthreads/Makefile.inc" -.include "${.CURDIR}/stdio/Makefile.inc" +.include "${srcdir}/pthreads/Makefile.inc" +.include "${srcdir}/stdlib/Makefile.inc" +.include "${srcdir}/stdio/Makefile.inc" +.include "${srcdir}/string/Makefile.inc" +.include "${srcdir}/gen/Makefile.inc" +.include "${srcdir}/net/Makefile.inc" +.include "${srcdir}/scripts/Makefile.inc" -all beforedepend: pthread - -CLEANFILES+=pthread - -pthread: - if [ ! -e pthread ]; then \ - ln -s ${.CURDIR}/include pthread; \ - fi - .include <bsd.lib.mk> - diff --git a/lib/libpthread/include/stdio.h b/lib/libpthread/include/stdio.h index 9efae3e47af..22b263edb75 100644 --- a/lib/libpthread/include/stdio.h +++ b/lib/libpthread/include/stdio.h @@ -35,21 +35,21 @@ * SUCH DAMAGE. * * from: @(#)stdio.h 5.17 (Berkeley) 6/3/91 - * $Id: stdio.h,v 1.2 1997/04/13 17:08:35 briggs Exp $ $provenid: stdio.h,v 1.18 1994/02/07 03:32:06 proven Exp $ + * $Id: stdio.h,v 1.3 1998/07/21 13:53:52 peter Exp $ */ #ifndef _STDIO_H_ #define _STDIO_H_ #include <sys/cdefs.h> +#include <pthread/types.h> #include <pthread/posix.h> +#include <sys/__stdio.h> #ifndef NULL #define NULL 0 #endif -typedef long fpos_t; /* Must match off_t <sys/types.h> */ - #define _FSTDIO /* Define for new stdio with functions. */ /* @@ -185,53 +185,62 @@ __END_DECLS * Functions defined in ANSI C standard. */ __BEGIN_DECLS -void clearerr __P((FILE *)); -int fclose __P((FILE *)); -int feof __P((FILE *)); -int ferror __P((FILE *)); -int fflush __P((FILE *)); -int fgetc __P((FILE *)); -int fgetpos __P((FILE *, fpos_t *)); -char * fgets __P((char *, size_t, FILE *)); -FILE * fopen __P((const char *, const char *)); -int fprintf __P((FILE *, const char *, ...)); -int fputc __P((int, FILE *)); -int fputs __P((const char *, FILE *)); -size_t fread __P((void *, size_t, size_t, FILE *)); -FILE * freopen __P((const char *, const char *, FILE *)); -int fscanf __P((FILE *, const char *, ...)); -int fseek __P((FILE *, long, int)); -int fsetpos __P((FILE *, const fpos_t *)); -long ftell __P((const FILE *)); -size_t fwrite __P((const void *, size_t, size_t, FILE *)); -int getc __P((FILE *)); -int getchar __P((void)); -char * gets __P((char *)); +void clearerr __P_((FILE *)); +int fclose __P_((FILE *)); +int feof __P_((FILE *)); +int ferror __P_((FILE *)); +int fflush __P_((FILE *)); +int fgetc __P_((FILE *)); +int fgetpos __P_((FILE *, fpos_t *)); +char * fgets __P_((char *, size_t, FILE *)); +FILE * fopen __P_((const char *, const char *)); +int fprintf __P_((FILE *, const char *, ...)); +int fputc __P_((int, FILE *)); +int fputs __P_((const char *, FILE *)); +size_t fread __P_((void *, size_t, size_t, FILE *)); +FILE * freopen __P_((const char *, const char *, FILE *)); +int fscanf __P_((FILE *, const char *, ...)); +int fseek __P_((FILE *, long, int)); +int fsetpos __P_((FILE *, const fpos_t *)); +long ftell __P_((const FILE *)); +size_t fwrite __P_((const void *, size_t, size_t, FILE *)); +int getc __P_((FILE *)); +int getchar __P_((void)); +char * gets __P_((char *)); #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) extern int sys_nerr; /* perror(3) external variables */ +/* Under NetBSD and BSD 4.4, at least, this is expected to be a const + array of pointers to const. If you take `const' back out of this + declaration, please make it conditional on __NetBSD__ and bsd4_4. */ +#ifdef HAVE_SYS_ERRLIST_WITHOUT_CONST extern char *sys_errlist[]; +#else +extern const char *const sys_errlist[]; +#endif #endif -void perror __P((const char *)); -int printf __P((const char *, ...)); -int putc __P((int, FILE *)); -int putchar __P((int)); -int puts __P((const char *)); -int remove __P((const char *)); -int rename __P((const char *, const char *)); -void rewind __P((FILE *)); -int scanf __P((const char *, ...)); -void setbuf __P((FILE *, char *)); -int setvbuf __P((FILE *, char *, int, size_t)); -int sprintf __P((char *, const char *, ...)); -int sscanf __P((const char *, const char *, ...)); -FILE *tmpfile __P((void)); -char *tmpnam __P((char *)); -int ungetc __P((int, FILE *)); -int vfprintf __P((FILE *, const char *, va_list)); -int vprintf __P((const char *, va_list)); -int vsprintf __P((char *, const char *, va_list)); +void perror __P_((const char *)); +int printf __P_((const char *, ...)); +int putc __P_((int, FILE *)); +int putchar __P_((int)); +int puts __P_((const char *)); +int remove __P_((const char *)); +int rename __P_((const char *, const char *)); +void rewind __P_((FILE *)); +int scanf __P_((const char *, ...)); +void setbuf __P_((FILE *, char *)); +int setvbuf __P_((FILE *, char *, int, size_t)); +int sprintf __P_((char *, const char *, ...)); +int sscanf __P_((const char *, const char *, ...)); +FILE * tmpfile __P_((void)); +char * tmpnam __P_((char *)); +int ungetc __P_((int, FILE *)); +int vfprintf __P_((FILE *, const char *, pthread_va_list)); +int vprintf __P_((const char *, pthread_va_list)); +int vsprintf __P_((char *, const char *, pthread_va_list)); +char *mprintf __P_((const char *, ...)); +char *vmprintf __P_((const char *, pthread_va_list)); __END_DECLS /* @@ -242,10 +251,21 @@ __END_DECLS #define L_cuserid 9 /* size for cuserid(); UT_NAMESIZE + 1 */ __BEGIN_DECLS -char *ctermid __P((char *)); -char *cuserid __P((char *)); -FILE *fdopen __P((int, const char *)); -int fileno __P((FILE *)); +char * ctermid __P_((char *)); +char * cuserid __P_((char *)); +FILE * fdopen __P_((int, const char *)); +int fileno __P_((FILE *)); +__END_DECLS +#endif /* not ANSI */ + +/* + * Functions defined in POSIX 1003.4a. (1c) + */ +#ifndef _ANSI_SOURCE +__BEGIN_DECLS +void flockfile __P_((FILE *)); +void funlockfile __P_((FILE *)); +int ftrylockfile __P_((FILE *)); __END_DECLS #endif /* not ANSI */ @@ -254,19 +274,19 @@ __END_DECLS */ #if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE) __BEGIN_DECLS -char *fgetline __P((FILE *, size_t *)); -int fpurge __P((FILE *)); -int getw __P((FILE *)); -int pclose __P((FILE *)); -FILE *popen __P((const char *, const char *)); -int putw __P((int, FILE *)); -void setbuffer __P((FILE *, char *, int)); -int setlinebuf __P((FILE *)); -char *tempnam __P((const char *, const char *)); -int snprintf __P((char *, size_t, const char *, ...)); -int vsnprintf __P((char *, size_t, const char *, va_list)); -int vscanf __P((const char *, va_list)); -int vsscanf __P((const char *, const char *, va_list)); +char *fgetline __P_((FILE *, size_t *)); +int fpurge __P_((FILE *)); +int getw __P_((FILE *)); +int pclose __P_((FILE *)); +FILE *popen __P_((const char *, const char *)); +int putw __P_((int, FILE *)); +void setbuffer __P_((FILE *, char *, int)); +int setlinebuf __P_((FILE *)); +char *tempnam __P_((const char *, const char *)); +int snprintf __P_((char *, size_t, const char *, ...)); +int vsnprintf __P_((char *, size_t, const char *, pthread_va_list)); +int vscanf __P_((const char *, pthread_va_list)); +int vsscanf __P_((const char *, const char *, pthread_va_list)); __END_DECLS /* @@ -280,7 +300,7 @@ __END_DECLS * Stdio function-access interface. */ __BEGIN_DECLS -FILE *funopen __P((const void *, +FILE *funopen __P_((const void *, int (*)(void *, char *, int), int (*)(void *, const char *, int), fpos_t (*)(void *, fpos_t, int), @@ -294,11 +314,9 @@ __END_DECLS * Functions internal to the implementation. */ __BEGIN_DECLS -int __srget __P((FILE *)); -int __svfscanf __P((FILE *, const char *, va_list)); -int __swbuf __P((int, FILE *)); -void flockfile __P((FILE *fp)); -void funlockfile __P((FILE *fp)); +int __srget __P_((FILE *)); +int __svfscanf __P_((FILE *, const char *, pthread_va_list)); +int __swbuf __P_((int, FILE *)); __END_DECLS /* @@ -306,38 +324,35 @@ __END_DECLS * define function versions in the C library. */ #define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) -static __inline int __getc(FILE *_p) -{ - int ret; - flockfile(_p); - ret = __sgetc(_p); - funlockfile(_p); - return(ret); -} -#define getc(fp) __gets(fp) -#define getchar() getc(stdin) -#define getc_unlocked(fp) __sgetc(fp) -#define getchar_unlocked() getc_unlocked(stdin) +__BEGIN_DECLS +int __getc __P_((FILE *)); +__END_DECLS + +#define getc(fp) __getc(fp) +#define getchar() getc(stdin) +#define getc_unlocked(fp) __sgetc(fp) +#define getchar_unlocked() getc_unlocked(stdin) -static __inline int __sputc(int _c, FILE *_p) +#ifdef __CAN_DO_EXTERN_INLINE +__INLINE int __sputc(int _c, FILE *_p) { if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) return (*_p->_p++ = _c); else return (__swbuf(_c, _p)); } +#else +__BEGIN_DECLS +int __sputc __P_((int, FILE *)); +__END_DECLS +#endif -static __inline int __putc(int _c, FILE *_p) -{ - int ret; - flockfile(_p); - ret = __sputc(_c, _p); - funlockfile(_p); - return(ret); -} +__BEGIN_DECLS +int __putc __P_((int, FILE *)); +__END_DECLS -#define putc(x, fp) __putc(x, fp); +#define putc(x, fp) __putc(x, fp) #define putchar(x) putc(x, stdout) #define putc_unlocked(x, fp) __sputc(x, fp) #define putchar_unlocked(x) putc_unlocked(x, stdout) diff --git a/lib/libpthread/stdio/fprintf.c b/lib/libpthread/stdio/fprintf.c index 6101c6d2860..ab159072863 100644 --- a/lib/libpthread/stdio/fprintf.c +++ b/lib/libpthread/stdio/fprintf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)fprintf.c 5.6 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: fprintf.c,v 1.2 1997/07/25 20:30:20 mickey Exp $"; +static char *rcsid = "$Id: fprintf.c,v 1.3 1998/07/21 13:53:53 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <pthread.h> diff --git a/lib/libpthread/stdio/fscanf.c b/lib/libpthread/stdio/fscanf.c index 2c0f44e7e89..9a946124fbd 100644 --- a/lib/libpthread/stdio/fscanf.c +++ b/lib/libpthread/stdio/fscanf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)fscanf.c 5.1 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: fscanf.c,v 1.2 1997/07/25 20:30:21 mickey Exp $"; +static char *rcsid = "$Id: fscanf.c,v 1.3 1998/07/21 13:53:54 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <pthread.h> diff --git a/lib/libpthread/stdio/fseek.c b/lib/libpthread/stdio/fseek.c index 70ea8bea384..15176414f98 100644 --- a/lib/libpthread/stdio/fseek.c +++ b/lib/libpthread/stdio/fseek.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,9 +37,10 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)fseek.c 5.7 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: fseek.c,v 1.2 1997/07/25 20:30:22 mickey Exp $"; +static char *rcsid = "$Id: fseek.c,v 1.3 1998/07/21 13:53:56 peter Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <pthread.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -69,8 +71,7 @@ fseek(fp, offset, whence) int havepos; /* make sure stdio is set up */ - if (!__sdidinit) - __sinit(); + __sinit (); flockfile(fp); @@ -88,10 +89,11 @@ fseek(fp, offset, whence) if (fp->_flags & __SOFF) curoff = fp->_offset; else { - curoff = __sseek(fp, (fpos_t)0, SEEK_CUR); - if (curoff == -1L) + curoff = __sseek(fp, (off_t)0, SEEK_CUR); + if (curoff == -1L) { funlockfile(fp); return (EOF); + } } if (fp->_flags & __SRD) { curoff -= fp->_r; @@ -155,7 +157,7 @@ fseek(fp, offset, whence) if (fp->_flags & __SOFF) curoff = fp->_offset; else { - curoff = __sseek(fp, 0L, SEEK_CUR); + curoff = __sseek(fp, (off_t)0, SEEK_CUR); if (curoff == POS_ERR) goto dumb; } @@ -208,7 +210,7 @@ fseek(fp, offset, whence) * ensures that we only read one block, rather than two. */ curoff = target & ~(fp->_blksize - 1); - if (__sseek(fp, 0L, SEEK_CUR) != POS_ERR) { + if (__sseek(fp, (off_t)curoff, SEEK_SET) != POS_ERR) { fp->_r = 0; fp->_p = fp->_bf._base; if (HASUB(fp)) @@ -230,7 +232,7 @@ fseek(fp, offset, whence) * do it. Allow the seek function to change fp->_bf._base. */ dumb: - if (__sflush(fp) || __sseek(fp, offset, whence) == POS_ERR) { + if (__sflush(fp) || __sseek(fp, (off_t)offset, whence) == POS_ERR) { funlockfile(fp); return (EOF); } diff --git a/lib/libpthread/stdio/ftell.c b/lib/libpthread/stdio/ftell.c index 57dce109ac9..8d3f228bbd0 100644 --- a/lib/libpthread/stdio/ftell.c +++ b/lib/libpthread/stdio/ftell.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)ftell.c 5.4 (Berkeley) 2/5/91";*/ -static char *rcsid = "$Id: ftell.c,v 1.4 1997/02/28 16:22:31 kstailey Exp $"; +static char *rcsid = "$Id: ftell.c,v 1.5 1998/07/21 13:53:57 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <pthread.h> @@ -51,18 +52,18 @@ long ftell(fp) register const FILE *fp; { - register fpos_t pos; + long pos; - flockfile(fp); + flockfile((FILE *)fp); /* * Find offset of underlying I/O object, then * adjust for buffered bytes. */ - if (fp->_flags & __SOFF) + if (fp->_flags & __SOFF) { pos = fp->_offset; - else { - pos = lseek(fp->_file, (fpos_t)0, SEEK_CUR); + } else { + pos = (long)__sseek((FILE *)fp, (off_t)0, SEEK_CUR); } if (pos != -1L) { @@ -84,6 +85,6 @@ ftell(fp) pos += fp->_p - fp->_bf._base; } } - funlockfile(fp); + funlockfile((FILE *)fp); return (pos); } diff --git a/lib/libpthread/stdio/funopen.c b/lib/libpthread/stdio/funopen.c index c77aaf47a90..8a0079871f1 100644 --- a/lib/libpthread/stdio/funopen.c +++ b/lib/libpthread/stdio/funopen.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,10 +37,12 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)funopen.c 5.2 (Berkeley) 2/5/91";*/ -static char *rcsid = "$Id: funopen.c,v 1.2 1997/07/25 20:30:22 mickey Exp $"; +static char *rcsid = "$Id: funopen.c,v 1.3 1998/07/21 13:53:58 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <pthread.h> +#include <stdlib.h> +#include <fcntl.h> #include <stdio.h> #include <errno.h> #include "local.h" @@ -74,20 +77,22 @@ funopen(cookie, readfn, writefn, seekfn, closefn) } if (fd_ops = (struct fd_ops*)malloc(sizeof(struct fd_ops))) { - if ((!(fd = fd_allocate())) < OK) { + if ((fd = fd_allocate()) >= OK) { /* Set functions */ - fd_ops->seek = seekfn; - fd_ops->read = readfn; - fd_ops->write = writefn; + fd_ops->seek = (off_t(*)())seekfn; + fd_ops->read = (pthread_ssize_t(*)())readfn; + fd_ops->write = (pthread_ssize_t(*)())writefn; fd_ops->close = closefn; + fd_ops->use_kfds = 2; /* Alloc space for funtion pointer table */ fd_table[fd]->type = FD_HALF_DUPLEX; fd_table[fd]->ops = fd_ops; + fd_table[fd]->flags = O_RDWR; /* Save the cookie, it's important */ - fd_table[fd]->fd.ptr = cookie; + fd_table[fd]->fd.ptr = (void *)cookie; if (fp = fdopen(fd, flags)) return(fp); diff --git a/lib/libpthread/stdio/scanf.c b/lib/libpthread/stdio/scanf.c index adaa4a0a78a..6d023a4bba2 100644 --- a/lib/libpthread/stdio/scanf.c +++ b/lib/libpthread/stdio/scanf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)scanf.c 5.3 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: scanf.c,v 1.2 1997/07/25 20:30:23 mickey Exp $"; +static char *rcsid = "$Id: scanf.c,v 1.3 1998/07/21 13:53:59 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <pthread.h> @@ -65,7 +66,7 @@ scanf(fmt, va_alist) #endif flockfile(stdin); ret = __svfscanf(stdin, fmt, ap); - flockfile(stdin); + funlockfile(stdin); va_end(ap); return (ret); } diff --git a/lib/libpthread/stdio/snprintf.c b/lib/libpthread/stdio/snprintf.c index ae3f03d4530..a009da8f3aa 100644 --- a/lib/libpthread/stdio/snprintf.c +++ b/lib/libpthread/stdio/snprintf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)snprintf.c 5.1 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: snprintf.c,v 1.2 1997/07/25 20:30:23 mickey Exp $"; +static char *rcsid = "$Id: snprintf.c,v 1.3 1998/07/21 13:54:00 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -67,6 +68,7 @@ snprintf(str, n, fmt, va_alist) #else va_start(ap); #endif + f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n - 1; diff --git a/lib/libpthread/stdio/sprintf.c b/lib/libpthread/stdio/sprintf.c index d93cfc46285..6d6906967fc 100644 --- a/lib/libpthread/stdio/sprintf.c +++ b/lib/libpthread/stdio/sprintf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,16 +37,16 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)sprintf.c 5.7 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: sprintf.c,v 1.2 1997/07/25 20:30:24 mickey Exp $"; +static char *rcsid = "$Id: sprintf.c,v 1.3 1998/07/21 13:54:01 peter Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <limits.h> #include <stdio.h> #ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif -#include <limits.h> #include "local.h" #ifdef __STDC__ @@ -61,6 +62,7 @@ sprintf(str, fmt, va_alist) va_list ap; FILE f; + f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; diff --git a/lib/libpthread/stdio/sscanf.c b/lib/libpthread/stdio/sscanf.c index 1ca458fb4d2..cd3db6640a4 100644 --- a/lib/libpthread/stdio/sscanf.c +++ b/lib/libpthread/stdio/sscanf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)sscanf.c 5.1 (Berkeley) 1/20/91";*/ -static char *rcsid = "$Id: sscanf.c,v 1.2 1997/07/25 20:30:24 mickey Exp $"; +static char *rcsid = "$Id: sscanf.c,v 1.3 1998/07/21 13:54:02 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> diff --git a/lib/libpthread/stdio/tempnam.c b/lib/libpthread/stdio/tempnam.c index 584c8f9442e..4a8107a05ff 100644 --- a/lib/libpthread/stdio/tempnam.c +++ b/lib/libpthread/stdio/tempnam.c @@ -33,7 +33,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)tempnam.c 5.1 (Berkeley) 2/22/91";*/ -static char *rcsid = "$Id: tempnam.c,v 1.3 1997/02/15 04:57:42 angelos Exp $"; +static char *rcsid = "$Id: tempnam.c,v 1.4 1998/07/21 13:54:04 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -41,7 +41,7 @@ static char *rcsid = "$Id: tempnam.c,v 1.3 1997/02/15 04:57:42 angelos Exp $"; #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <paths.h> +/* #include <paths.h> */ char * tempnam(dir, pfx) diff --git a/lib/libpthread/stdio/vfscanf.c b/lib/libpthread/stdio/vfscanf.c index afdd7604360..723e37c5a7a 100644 --- a/lib/libpthread/stdio/vfscanf.c +++ b/lib/libpthread/stdio/vfscanf.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 1993, 1994 Chris Provenzano. * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -36,7 +37,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)vfscanf.c 5.7 (Berkeley) 12/14/92";*/ -static char *rcsid = "$Id: vfscanf.c,v 1.2 1997/07/25 20:30:25 mickey Exp $"; +static char *rcsid = "$Id: vfscanf.c,v 1.3 1998/07/21 13:54:05 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -98,7 +99,7 @@ static u_char *__sccl(); __svfscanf(fp, fmt0, ap) register FILE *fp; char const *fmt0; - va_list ap; + pthread_va_list ap; { register u_char *fmt = (u_char *)fmt0; register int c; /* character from format, or conversion */ |