2000-02-18 03:39:52 +08:00
|
|
|
/*
|
2007-03-15 Eric Blake <ebb9@byu.net>
* libc/stdio/local.h (cantwrite, FREEUB, FREELB): Make reentrant.
(__smakebuf): Rename...
(__smakebuf_r): to this.
* libc/stdio/fvwrite.h (__swsetup_r): Rename, from __swsetup.
* libc/stdio/makebuf.c (__smakebuf): Detect failed asprint
allocation, then rename...
(__smakebuf_r): ...to this and fix reentrancy.
* libc/stdio/wsetup.c (__swsetup): Detect failed asprintf
allocation, then rename...
(__swsetup_r): ...to this and fix reentrancy.
* libc/stdio/fseek.c (_fseek_r): Fix reentrancy.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/fclose.c (_fclose_r): Likewise.
* libc/stdio/fread.c (_fread_r): Likewise.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/wbuf.c (__swbuf_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Set errno properly on
failed asprintf allocation, and fix reentrancy.
* libc/stdio/snprintf.c (snprintf, _snprintf_r): Report overflow,
as required by POSIX.
* libc/stdio/sniprintf.c (sniprintf, _sniprintf_r): Likewise.
* libc/stdio/vsnprintf.c (vsnprintf, _vsnprintf_r): Likewise.
* libc/stdio/vsniprintf.c (vsniprintf, _vsniprintf_r): Likewise.
2007-03-16 02:40:48 +08:00
|
|
|
* Copyright (c) 1990, 2007 The Regents of the University of California.
|
2000-02-18 03:39:52 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms are permitted
|
|
|
|
* provided that the above copyright notice and this paragraph are
|
|
|
|
* duplicated in all such forms and that any documentation,
|
2020-01-29 02:54:53 +08:00
|
|
|
* and/or other materials related to such
|
2000-02-18 03:39:52 +08:00
|
|
|
* distribution and use acknowledge that the software was developed
|
|
|
|
* by the University of California, Berkeley. The name of the
|
|
|
|
* University may not be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* %W% (Berkeley) %G% */
|
|
|
|
#include <_ansi.h>
|
|
|
|
|
|
|
|
/*
|
2006-06-15 04:49:11 +08:00
|
|
|
* I/O descriptors for __sfvwrite_r().
|
2000-02-18 03:39:52 +08:00
|
|
|
*/
|
|
|
|
struct __siov {
|
2017-12-04 10:53:22 +08:00
|
|
|
const void *iov_base;
|
2000-02-18 03:39:52 +08:00
|
|
|
size_t iov_len;
|
|
|
|
};
|
|
|
|
struct __suio {
|
|
|
|
struct __siov *uio_iov;
|
|
|
|
int uio_iovcnt;
|
2013-10-31 18:35:54 +08:00
|
|
|
size_t uio_resid;
|
2000-02-18 03:39:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-12-04 13:54:48 +08:00
|
|
|
extern int __sfvwrite_r (struct _reent *, FILE *, struct __suio *);
|
|
|
|
extern int __swsetup_r (struct _reent *, FILE *);
|