X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/stdio/FreeBSD/funopen.c diff --git a/stdio/FreeBSD/funopen.c b/stdio/FreeBSD/funopen.c index 040c806..408f0f4 100644 --- a/stdio/FreeBSD/funopen.c +++ b/stdio/FreeBSD/funopen.c @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -38,7 +34,7 @@ static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/funopen.c,v 1.5 2002/05/28 16:59:39 alfred Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/funopen.c,v 1.7 2009/12/05 19:31:38 ed Exp $"); #include #include @@ -46,11 +42,11 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/funopen.c,v 1.5 2002/05/28 16:59:39 alfre #include "local.h" FILE * -funopen(cookie, readfn, writefn, seekfn, closefn) - const void *cookie; - int (*readfn)(), (*writefn)(); - fpos_t (*seekfn)(void *cookie, fpos_t off, int whence); - int (*closefn)(); +funopen(const void *cookie, + int (*readfn)(void *, char *, int), + int (*writefn)(void *, const char *, int), + fpos_t (*seekfn)(void *, fpos_t, int), + int (*closefn)(void *)) { FILE *fp; int flags; @@ -67,7 +63,8 @@ funopen(cookie, readfn, writefn, seekfn, closefn) else flags = __SRW; /* read-write */ } - if ((fp = __sfp()) == NULL) + /* funopen in not covered in SUSv3, so never count the streams */ + if ((fp = __sfp(0)) == NULL) return (NULL); fp->_flags = flags; fp->_file = -1;