History log of /netbsd-current/include/stdio.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.104 11-Sep-2021 rillig

stdio.h: remove outdated comment for vscanf

When these functions where added to stdio.h 1.72 on 2008-08-04, the
conditional included _NETBSD_SOURCE.

The additional condition was removed in stdio.h 1.99 from 2020-03-20,
but the comment was not updated.


# 1.103 11-Sep-2021 rillig

stdio.h: sync comment for struct __sFILE with reality

In stdio.h 1.1 from 1993-03-21, the struct had a member named _ub for
the ungetc buffer. That member was repurposed in stdio.h 1.42 from
2001-12-07 in order to support wide characters.

Remove the reference to the 'WARNING above' since there is no such
warning and even when this comment was added in stdio.h 1.20 from
1998-02-02, there was none.


# 1.102 11-Sep-2021 rillig

stdio.h: remove outdated comment about fpos_t

The 'fairly grotesque' from 1994-04-03 referred to the conditional
definition of the type fpos_t, using two different integer types that
both happened to be 64-bit.

When stdio was changed on 2012-01-22 to keep track of the mbstate, the
conditional type definition was removed and the comment no longer made
sense.


# 1.101 11-Sep-2021 rillig

stdio.h: fix typo in comment


# 1.100 11-Sep-2021 rillig

stdio.h: fix typo in comment


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.99 20-Mar-2020 joerg

Fix visibility of various C99 features, esp. for C++11.


Revision tags: is-mlppp-base
# 1.98 13-Dec-2019 mrg

move P_tmpdir from "/var/tmp/" to "/tmp/".

the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.

a survey of other platforms shows only OSX also uses /var/tmp,
everyone else has switched to /tmp long ago.


cons: some smaller systems may have a smaller /tmp than /var/tmp,
and this may cause builds to fail with out of space earlier.
point the build to /var/tmp using TMPDIR in this case.

one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.97 17-Mar-2016 christos

branches: 1.97.8; 1.97.16; 1.97.18;
gcc 5, my patience is waning.


# 1.96 24-Mar-2015 wiz

Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin


# 1.95 05-Mar-2015 dholland

One vscanf_l is ample.


# 1.94 04-Mar-2015 christos

PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve.


# 1.93 20-Jan-2015 christos

add popenve().


# 1.92 13-Oct-2014 christos

add open_{,w}memstream


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.91 07-Aug-2014 christos

branches: 1.91.2;
cast to LHS type and minor KNF.


# 1.90 23-May-2014 joerg

Fix use of getline and friends in C++ code.


# 1.89 19-May-2014 kleink

Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008. From Jarmo Jaakkola in PR standards/48788.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.88 04-May-2013 christos

branches: 1.88.4;
add the signal safe prototypes


# 1.87 26-Apr-2013 joerg

Don't pollute the name space with the various stdio macros for C++.


# 1.86 19-Apr-2013 joerg

Add missing __BEGIN_DECLS/__END_DECLS.


# 1.85 19-Apr-2013 joerg

Add scanf_l and wscanf_l families.


# 1.84 19-Apr-2013 joerg

Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.


# 1.83 17-Apr-2013 joerg

White space


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.82 18-Apr-2012 christos

branches: 1.82.2;
specify size of the array to help -fmudflap


Revision tags: yamt-pagecache-base4
# 1.81 27-Mar-2012 christos

funopen2()


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base
# 1.80 22-Jan-2012 christos

branches: 1.80.2;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.79 17-Jul-2011 joerg

branches: 1.79.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.78 24-Sep-2010 tnozaki

add fmemopen(3) derrived from POSIX:2008.
libc minor bump.


# 1.77 06-Sep-2010 christos

Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1
# 1.76 25-Feb-2010 joerg

Consistently use __printflike and __scanflike.


Revision tags: uebayasi-xip-base
# 1.75 11-Jan-2010 joerg

branches: 1.75.2;
Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.


Revision tags: matt-premerge-20091211
# 1.74 13-Jul-2009 roy

Add implementations for getdelim(3) and getline(3).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2
# 1.73 21-Sep-2008 christos

branches: 1.73.6;
add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.72 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase
# 1.71 13-Mar-2008 christos

branches: 1.71.4;
Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.70 02-Aug-2007 kristerw

branches: 1.70.2; 1.70.6; 1.70.8;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.69 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


# 1.68 02-Feb-2007 christos

remove __SAFE


# 1.67 09-Dec-2006 bjh21

defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.


Revision tags: netbsd-4-base
# 1.66 22-Nov-2006 christos

branches: 1.66.2;
Don't expose _ss functions for 4.0. Requested by core.


# 1.65 27-Oct-2006 christos

- flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.


Revision tags: abandoned-netbsd-4-base
# 1.64 10-May-2006 mrg

add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes.


# 1.63 27-Dec-2005 perry

inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.


# 1.62 24-Dec-2005 perry

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.61 25-May-2005 kleink

Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072.


# 1.60 25-May-2005 kleink

Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section.


# 1.59 25-May-2005 kleink

Add restrict qualifiers to fopen()/freopen() arguments.


Revision tags: netbsd-3-base
# 1.58 09-Feb-2005 kleink

branches: 1.58.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.


# 1.57 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.56 01-Jul-2004 kleink

Tidy up the namespace: lint -> __lint__.


# 1.55 10-May-2004 drochner

remove fgetstr() from public sight


# 1.54 21-Apr-2004 christos

add fgetstr


Revision tags: netbsd-2-0-base
# 1.53 07-Aug-2003 agc

branches: 1.53.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.52 05-Jun-2003 bjh21

P_tmpdir isn't in POSIX, so only define it for _XOPEN_SOURCE and
_NETBSD_SOURCE.


# 1.51 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.50 27-Feb-2003 kleink

As with _REENTRANT, don't provide simple non-locking macro versions of
several functions when _PTHREADS is defined (usually via cc -pthread).


# 1.49 18-Jan-2003 christos

avoid TMP_MAX redefinition


# 1.48 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.47 20-Dec-2002 atatat

Spelling police. "__resitrct" was not spelled cirectly enough.


# 1.46 30-Nov-2002 lukem

- Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).


# 1.45 24-May-2002 thorpej

* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.


# 1.44 24-May-2002 thorpej

Parameterize the vfscanf macro's arguments. Without them, 3rd party
software can become greatly confused.

This fixes 4 GCC 3.2 testsuite failures.

This is a stop-gap measure which can be easily applied to the 1.6
release branch. A different fix for the trunk is forthcoming.


# 1.43 24-May-2002 thorpej

Add a scanf format attribute to __svfscanf().


Revision tags: netbsd-1-6-base
# 1.42 07-Dec-2001 yamt

branches: 1.42.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.


# 1.41 29-Dec-2000 kleink

branches: 1.41.2;
Sprinkle some __restrict into stdio.


# 1.40 18-Dec-2000 christos

protect against multiple declarations.


# 1.39 15-Nov-2000 briggs

Move fmtcheck() prototype to stdio.h. It makes more sense to declare it
with the formatting functions with which it is meant to be used. Thanks
to Klaus Klein for "encouraging" me to make this change.


# 1.38 28-Jul-2000 kleink

Avoid recursion with traditional cpp.


# 1.37 23-Jul-2000 mycroft

This is a HACK so that libc can compile with -ansi.


# 1.36 16-Jul-2000 enami

- Fix couple of typos.
- Protect some func. decls. added recently with __{BEGIN,END}_DECLS.


# 1.35 15-Jul-2000 drochner

fix obvious typo


# 1.34 08-Jul-2000 kleink

XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.


# 1.33 26-Jun-2000 kleink

Get rid of the inclusion of <sys/types.h> and define fpos_t using __off_t.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.32 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.31 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.30 20-Nov-1998 kleink

* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions.
* Don't define a macro version of fileno() in a _REENTRANT environment.


# 1.29 28-Sep-1998 kleink

Move 1003.1c-1995 declarations inside the appropriate name space protection
wrapper, and make sure we won't use these decl's as such with C++ linkage(!).
Also, make _XOPEN_SOURCE protection of popen()/pclose() decl's a bit more
restrictive.


# 1.28 28-Aug-1998 tv

Use __format__, __printf__ for consistency


# 1.27 28-Aug-1998 perry

add asprintf and vasprintf, originally written by Todd Miller for OpenBSD


# 1.26 30-Jul-1998 mycroft

__Namespace__ __protection__.


# 1.25 27-Jul-1998 mycroft

Nuke tmpnam() as well.


# 1.24 27-Jul-1998 mycroft

If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.


# 1.23 11-May-1998 drochner

add missing backslash


# 1.22 11-May-1998 kleink

Reorganize name space protection.


# 1.21 14-Feb-1998 kleink

If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_rename() instead of rename() in order to remove the requirement of
linking against libposix.


# 1.20 02-Feb-1998 perry

merge lite-2


# 1.19 19-Jan-1998 jtc

Added function declarations for flockfile(), ftrylockfile(), funlockfile(),
getc_unlocked(), getchar_unlocked(), putc_unlocked(), & putchar_unlocked().
Added macro definitions for the latter four functions.

Changed so that getc(), putc(), clearerr(), feof() and ferror() macros
are not defined if _REENTRANT is defined so that thread-safe function
versions will be used instead.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.18 25-Apr-1996 jtc

Fix typo, __STRICT_ANSI_ -> __STRICT_ANSI__


# 1.17 20-Jan-1996 jtc

Removed declarations for sys_nerr & sys_errlist (moved to errno.h)


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 25-Mar-1995 jtc

change second arg of fgets() from size_t to int


# 1.15 22-Mar-1995 jtc

Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.


# 1.14 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.13 22-May-1994 cgd

_VA_LIST_ -> _BSD_VA_LIST_


# 1.12 21-May-1994 cgd

add _BSD's to ansi types


# 1.11 03-Apr-1994 cgd

fpos_t is now a 64-bit quantity


# 1.10 04-Jan-1994 cgd

rename fgetline() and sharpen axe for bostic...


# 1.9 02-Dec-1993 mycroft

Add `const's to sys_errlist decl to match 4.4.


# 1.8 01-Dec-1993 jtc

Use GCC's format attribute (for bug detection with -Wformat).


# 1.7 11-Oct-1993 jtc

Restore define for L_cuserid and add cuserid prototype.
It was provided, but not documented.


# 1.6 06-Oct-1993 jtc

cuserid() was removed by 1990's revision of 1003.1, and we never provided it
so don't define the L_cuserid constant.


# 1.5 04-Oct-1993 jtc

fread and fwrite both return size_t, not int.


# 1.4 04-Oct-1993 cgd

sscanf takes a const char * as the first arg; the man page was (already)
correct.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 17-Apr-1993 sef

`inline' is not present in gcc when -ansi is given; use __inline instead.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.100 11-Sep-2021 rillig

stdio.h: fix typo in comment


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.99 20-Mar-2020 joerg

Fix visibility of various C99 features, esp. for C++11.


Revision tags: is-mlppp-base
# 1.98 13-Dec-2019 mrg

move P_tmpdir from "/var/tmp/" to "/tmp/".

the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.

a survey of other platforms shows only OSX also uses /var/tmp,
everyone else has switched to /tmp long ago.


cons: some smaller systems may have a smaller /tmp than /var/tmp,
and this may cause builds to fail with out of space earlier.
point the build to /var/tmp using TMPDIR in this case.

one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.97 17-Mar-2016 christos

branches: 1.97.8; 1.97.16; 1.97.18;
gcc 5, my patience is waning.


# 1.96 24-Mar-2015 wiz

Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin


# 1.95 05-Mar-2015 dholland

One vscanf_l is ample.


# 1.94 04-Mar-2015 christos

PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve.


# 1.93 20-Jan-2015 christos

add popenve().


# 1.92 13-Oct-2014 christos

add open_{,w}memstream


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.91 07-Aug-2014 christos

branches: 1.91.2;
cast to LHS type and minor KNF.


# 1.90 23-May-2014 joerg

Fix use of getline and friends in C++ code.


# 1.89 19-May-2014 kleink

Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008. From Jarmo Jaakkola in PR standards/48788.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.88 04-May-2013 christos

branches: 1.88.4;
add the signal safe prototypes


# 1.87 26-Apr-2013 joerg

Don't pollute the name space with the various stdio macros for C++.


# 1.86 19-Apr-2013 joerg

Add missing __BEGIN_DECLS/__END_DECLS.


# 1.85 19-Apr-2013 joerg

Add scanf_l and wscanf_l families.


# 1.84 19-Apr-2013 joerg

Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.


# 1.83 17-Apr-2013 joerg

White space


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.82 18-Apr-2012 christos

branches: 1.82.2;
specify size of the array to help -fmudflap


Revision tags: yamt-pagecache-base4
# 1.81 27-Mar-2012 christos

funopen2()


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base
# 1.80 22-Jan-2012 christos

branches: 1.80.2;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.79 17-Jul-2011 joerg

branches: 1.79.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.78 24-Sep-2010 tnozaki

add fmemopen(3) derrived from POSIX:2008.
libc minor bump.


# 1.77 06-Sep-2010 christos

Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1
# 1.76 25-Feb-2010 joerg

Consistently use __printflike and __scanflike.


Revision tags: uebayasi-xip-base
# 1.75 11-Jan-2010 joerg

branches: 1.75.2;
Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.


Revision tags: matt-premerge-20091211
# 1.74 13-Jul-2009 roy

Add implementations for getdelim(3) and getline(3).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2
# 1.73 21-Sep-2008 christos

branches: 1.73.6;
add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.72 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase
# 1.71 13-Mar-2008 christos

branches: 1.71.4;
Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.70 02-Aug-2007 kristerw

branches: 1.70.2; 1.70.6; 1.70.8;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.69 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


# 1.68 02-Feb-2007 christos

remove __SAFE


# 1.67 09-Dec-2006 bjh21

defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.


Revision tags: netbsd-4-base
# 1.66 22-Nov-2006 christos

branches: 1.66.2;
Don't expose _ss functions for 4.0. Requested by core.


# 1.65 27-Oct-2006 christos

- flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.


Revision tags: abandoned-netbsd-4-base
# 1.64 10-May-2006 mrg

add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes.


# 1.63 27-Dec-2005 perry

inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.


# 1.62 24-Dec-2005 perry

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.61 25-May-2005 kleink

Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072.


# 1.60 25-May-2005 kleink

Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section.


# 1.59 25-May-2005 kleink

Add restrict qualifiers to fopen()/freopen() arguments.


Revision tags: netbsd-3-base
# 1.58 09-Feb-2005 kleink

branches: 1.58.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.


# 1.57 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.56 01-Jul-2004 kleink

Tidy up the namespace: lint -> __lint__.


# 1.55 10-May-2004 drochner

remove fgetstr() from public sight


# 1.54 21-Apr-2004 christos

add fgetstr


Revision tags: netbsd-2-0-base
# 1.53 07-Aug-2003 agc

branches: 1.53.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.52 05-Jun-2003 bjh21

P_tmpdir isn't in POSIX, so only define it for _XOPEN_SOURCE and
_NETBSD_SOURCE.


# 1.51 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.50 27-Feb-2003 kleink

As with _REENTRANT, don't provide simple non-locking macro versions of
several functions when _PTHREADS is defined (usually via cc -pthread).


# 1.49 18-Jan-2003 christos

avoid TMP_MAX redefinition


# 1.48 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.47 20-Dec-2002 atatat

Spelling police. "__resitrct" was not spelled cirectly enough.


# 1.46 30-Nov-2002 lukem

- Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).


# 1.45 24-May-2002 thorpej

* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.


# 1.44 24-May-2002 thorpej

Parameterize the vfscanf macro's arguments. Without them, 3rd party
software can become greatly confused.

This fixes 4 GCC 3.2 testsuite failures.

This is a stop-gap measure which can be easily applied to the 1.6
release branch. A different fix for the trunk is forthcoming.


# 1.43 24-May-2002 thorpej

Add a scanf format attribute to __svfscanf().


Revision tags: netbsd-1-6-base
# 1.42 07-Dec-2001 yamt

branches: 1.42.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.


# 1.41 29-Dec-2000 kleink

branches: 1.41.2;
Sprinkle some __restrict into stdio.


# 1.40 18-Dec-2000 christos

protect against multiple declarations.


# 1.39 15-Nov-2000 briggs

Move fmtcheck() prototype to stdio.h. It makes more sense to declare it
with the formatting functions with which it is meant to be used. Thanks
to Klaus Klein for "encouraging" me to make this change.


# 1.38 28-Jul-2000 kleink

Avoid recursion with traditional cpp.


# 1.37 23-Jul-2000 mycroft

This is a HACK so that libc can compile with -ansi.


# 1.36 16-Jul-2000 enami

- Fix couple of typos.
- Protect some func. decls. added recently with __{BEGIN,END}_DECLS.


# 1.35 15-Jul-2000 drochner

fix obvious typo


# 1.34 08-Jul-2000 kleink

XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.


# 1.33 26-Jun-2000 kleink

Get rid of the inclusion of <sys/types.h> and define fpos_t using __off_t.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.32 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.31 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.30 20-Nov-1998 kleink

* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions.
* Don't define a macro version of fileno() in a _REENTRANT environment.


# 1.29 28-Sep-1998 kleink

Move 1003.1c-1995 declarations inside the appropriate name space protection
wrapper, and make sure we won't use these decl's as such with C++ linkage(!).
Also, make _XOPEN_SOURCE protection of popen()/pclose() decl's a bit more
restrictive.


# 1.28 28-Aug-1998 tv

Use __format__, __printf__ for consistency


# 1.27 28-Aug-1998 perry

add asprintf and vasprintf, originally written by Todd Miller for OpenBSD


# 1.26 30-Jul-1998 mycroft

__Namespace__ __protection__.


# 1.25 27-Jul-1998 mycroft

Nuke tmpnam() as well.


# 1.24 27-Jul-1998 mycroft

If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.


# 1.23 11-May-1998 drochner

add missing backslash


# 1.22 11-May-1998 kleink

Reorganize name space protection.


# 1.21 14-Feb-1998 kleink

If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_rename() instead of rename() in order to remove the requirement of
linking against libposix.


# 1.20 02-Feb-1998 perry

merge lite-2


# 1.19 19-Jan-1998 jtc

Added function declarations for flockfile(), ftrylockfile(), funlockfile(),
getc_unlocked(), getchar_unlocked(), putc_unlocked(), & putchar_unlocked().
Added macro definitions for the latter four functions.

Changed so that getc(), putc(), clearerr(), feof() and ferror() macros
are not defined if _REENTRANT is defined so that thread-safe function
versions will be used instead.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.18 25-Apr-1996 jtc

Fix typo, __STRICT_ANSI_ -> __STRICT_ANSI__


# 1.17 20-Jan-1996 jtc

Removed declarations for sys_nerr & sys_errlist (moved to errno.h)


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 25-Mar-1995 jtc

change second arg of fgets() from size_t to int


# 1.15 22-Mar-1995 jtc

Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.


# 1.14 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.13 22-May-1994 cgd

_VA_LIST_ -> _BSD_VA_LIST_


# 1.12 21-May-1994 cgd

add _BSD's to ansi types


# 1.11 03-Apr-1994 cgd

fpos_t is now a 64-bit quantity


# 1.10 04-Jan-1994 cgd

rename fgetline() and sharpen axe for bostic...


# 1.9 02-Dec-1993 mycroft

Add `const's to sys_errlist decl to match 4.4.


# 1.8 01-Dec-1993 jtc

Use GCC's format attribute (for bug detection with -Wformat).


# 1.7 11-Oct-1993 jtc

Restore define for L_cuserid and add cuserid prototype.
It was provided, but not documented.


# 1.6 06-Oct-1993 jtc

cuserid() was removed by 1990's revision of 1003.1, and we never provided it
so don't define the L_cuserid constant.


# 1.5 04-Oct-1993 jtc

fread and fwrite both return size_t, not int.


# 1.4 04-Oct-1993 cgd

sscanf takes a const char * as the first arg; the man page was (already)
correct.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 17-Apr-1993 sef

`inline' is not present in gcc when -ansi is given; use __inline instead.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.99 20-Mar-2020 joerg

Fix visibility of various C99 features, esp. for C++11.


# 1.98 13-Dec-2019 mrg

move P_tmpdir from "/var/tmp/" to "/tmp/".

the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.

a survey of other platforms shows only OSX also uses /var/tmp,
everyone else has switched to /tmp long ago.


cons: some smaller systems may have a smaller /tmp than /var/tmp,
and this may cause builds to fail with out of space earlier.
point the build to /var/tmp using TMPDIR in this case.

one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.97 17-Mar-2016 christos

gcc 5, my patience is waning.


# 1.96 24-Mar-2015 wiz

Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin


# 1.95 05-Mar-2015 dholland

One vscanf_l is ample.


# 1.94 04-Mar-2015 christos

PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve.


# 1.93 20-Jan-2015 christos

add popenve().


# 1.92 13-Oct-2014 christos

add open_{,w}memstream


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.91 07-Aug-2014 christos

branches: 1.91.2;
cast to LHS type and minor KNF.


# 1.90 23-May-2014 joerg

Fix use of getline and friends in C++ code.


# 1.89 19-May-2014 kleink

Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008. From Jarmo Jaakkola in PR standards/48788.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.88 04-May-2013 christos

branches: 1.88.4;
add the signal safe prototypes


# 1.87 26-Apr-2013 joerg

Don't pollute the name space with the various stdio macros for C++.


# 1.86 19-Apr-2013 joerg

Add missing __BEGIN_DECLS/__END_DECLS.


# 1.85 19-Apr-2013 joerg

Add scanf_l and wscanf_l families.


# 1.84 19-Apr-2013 joerg

Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.


# 1.83 17-Apr-2013 joerg

White space


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.82 18-Apr-2012 christos

branches: 1.82.2;
specify size of the array to help -fmudflap


Revision tags: yamt-pagecache-base4
# 1.81 27-Mar-2012 christos

funopen2()


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base
# 1.80 22-Jan-2012 christos

branches: 1.80.2;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.79 17-Jul-2011 joerg

branches: 1.79.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.78 24-Sep-2010 tnozaki

add fmemopen(3) derrived from POSIX:2008.
libc minor bump.


# 1.77 06-Sep-2010 christos

Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1
# 1.76 25-Feb-2010 joerg

Consistently use __printflike and __scanflike.


Revision tags: uebayasi-xip-base
# 1.75 11-Jan-2010 joerg

branches: 1.75.2;
Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.


Revision tags: matt-premerge-20091211
# 1.74 13-Jul-2009 roy

Add implementations for getdelim(3) and getline(3).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2
# 1.73 21-Sep-2008 christos

branches: 1.73.6;
add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.72 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase
# 1.71 13-Mar-2008 christos

branches: 1.71.4;
Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.70 02-Aug-2007 kristerw

branches: 1.70.2; 1.70.6; 1.70.8;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.69 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


# 1.68 02-Feb-2007 christos

remove __SAFE


# 1.67 09-Dec-2006 bjh21

defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.


Revision tags: netbsd-4-base
# 1.66 22-Nov-2006 christos

branches: 1.66.2;
Don't expose _ss functions for 4.0. Requested by core.


# 1.65 27-Oct-2006 christos

- flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.


Revision tags: abandoned-netbsd-4-base
# 1.64 10-May-2006 mrg

add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes.


# 1.63 27-Dec-2005 perry

inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.


# 1.62 24-Dec-2005 perry

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.61 25-May-2005 kleink

Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072.


# 1.60 25-May-2005 kleink

Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section.


# 1.59 25-May-2005 kleink

Add restrict qualifiers to fopen()/freopen() arguments.


Revision tags: netbsd-3-base
# 1.58 09-Feb-2005 kleink

branches: 1.58.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.


# 1.57 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.56 01-Jul-2004 kleink

Tidy up the namespace: lint -> __lint__.


# 1.55 10-May-2004 drochner

remove fgetstr() from public sight


# 1.54 21-Apr-2004 christos

add fgetstr


Revision tags: netbsd-2-0-base
# 1.53 07-Aug-2003 agc

branches: 1.53.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.52 05-Jun-2003 bjh21

P_tmpdir isn't in POSIX, so only define it for _XOPEN_SOURCE and
_NETBSD_SOURCE.


# 1.51 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.50 27-Feb-2003 kleink

As with _REENTRANT, don't provide simple non-locking macro versions of
several functions when _PTHREADS is defined (usually via cc -pthread).


# 1.49 18-Jan-2003 christos

avoid TMP_MAX redefinition


# 1.48 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.47 20-Dec-2002 atatat

Spelling police. "__resitrct" was not spelled cirectly enough.


# 1.46 30-Nov-2002 lukem

- Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).


# 1.45 24-May-2002 thorpej

* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.


# 1.44 24-May-2002 thorpej

Parameterize the vfscanf macro's arguments. Without them, 3rd party
software can become greatly confused.

This fixes 4 GCC 3.2 testsuite failures.

This is a stop-gap measure which can be easily applied to the 1.6
release branch. A different fix for the trunk is forthcoming.


# 1.43 24-May-2002 thorpej

Add a scanf format attribute to __svfscanf().


Revision tags: netbsd-1-6-base
# 1.42 07-Dec-2001 yamt

branches: 1.42.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.


# 1.41 29-Dec-2000 kleink

branches: 1.41.2;
Sprinkle some __restrict into stdio.


# 1.40 18-Dec-2000 christos

protect against multiple declarations.


# 1.39 15-Nov-2000 briggs

Move fmtcheck() prototype to stdio.h. It makes more sense to declare it
with the formatting functions with which it is meant to be used. Thanks
to Klaus Klein for "encouraging" me to make this change.


# 1.38 28-Jul-2000 kleink

Avoid recursion with traditional cpp.


# 1.37 23-Jul-2000 mycroft

This is a HACK so that libc can compile with -ansi.


# 1.36 16-Jul-2000 enami

- Fix couple of typos.
- Protect some func. decls. added recently with __{BEGIN,END}_DECLS.


# 1.35 15-Jul-2000 drochner

fix obvious typo


# 1.34 08-Jul-2000 kleink

XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.


# 1.33 26-Jun-2000 kleink

Get rid of the inclusion of <sys/types.h> and define fpos_t using __off_t.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.32 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.31 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.30 20-Nov-1998 kleink

* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions.
* Don't define a macro version of fileno() in a _REENTRANT environment.


# 1.29 28-Sep-1998 kleink

Move 1003.1c-1995 declarations inside the appropriate name space protection
wrapper, and make sure we won't use these decl's as such with C++ linkage(!).
Also, make _XOPEN_SOURCE protection of popen()/pclose() decl's a bit more
restrictive.


# 1.28 28-Aug-1998 tv

Use __format__, __printf__ for consistency


# 1.27 28-Aug-1998 perry

add asprintf and vasprintf, originally written by Todd Miller for OpenBSD


# 1.26 30-Jul-1998 mycroft

__Namespace__ __protection__.


# 1.25 27-Jul-1998 mycroft

Nuke tmpnam() as well.


# 1.24 27-Jul-1998 mycroft

If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.


# 1.23 11-May-1998 drochner

add missing backslash


# 1.22 11-May-1998 kleink

Reorganize name space protection.


# 1.21 14-Feb-1998 kleink

If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_rename() instead of rename() in order to remove the requirement of
linking against libposix.


# 1.20 02-Feb-1998 perry

merge lite-2


# 1.19 19-Jan-1998 jtc

Added function declarations for flockfile(), ftrylockfile(), funlockfile(),
getc_unlocked(), getchar_unlocked(), putc_unlocked(), & putchar_unlocked().
Added macro definitions for the latter four functions.

Changed so that getc(), putc(), clearerr(), feof() and ferror() macros
are not defined if _REENTRANT is defined so that thread-safe function
versions will be used instead.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.18 25-Apr-1996 jtc

Fix typo, __STRICT_ANSI_ -> __STRICT_ANSI__


# 1.17 20-Jan-1996 jtc

Removed declarations for sys_nerr & sys_errlist (moved to errno.h)


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 25-Mar-1995 jtc

change second arg of fgets() from size_t to int


# 1.15 22-Mar-1995 jtc

Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.


# 1.14 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.13 22-May-1994 cgd

_VA_LIST_ -> _BSD_VA_LIST_


# 1.12 21-May-1994 cgd

add _BSD's to ansi types


# 1.11 03-Apr-1994 cgd

fpos_t is now a 64-bit quantity


# 1.10 04-Jan-1994 cgd

rename fgetline() and sharpen axe for bostic...


# 1.9 02-Dec-1993 mycroft

Add `const's to sys_errlist decl to match 4.4.


# 1.8 01-Dec-1993 jtc

Use GCC's format attribute (for bug detection with -Wformat).


# 1.7 11-Oct-1993 jtc

Restore define for L_cuserid and add cuserid prototype.
It was provided, but not documented.


# 1.6 06-Oct-1993 jtc

cuserid() was removed by 1990's revision of 1003.1, and we never provided it
so don't define the L_cuserid constant.


# 1.5 04-Oct-1993 jtc

fread and fwrite both return size_t, not int.


# 1.4 04-Oct-1993 cgd

sscanf takes a const char * as the first arg; the man page was (already)
correct.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 17-Apr-1993 sef

`inline' is not present in gcc when -ansi is given; use __inline instead.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.98 13-Dec-2019 mrg

move P_tmpdir from "/var/tmp/" to "/tmp/".

the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.

a survey of other platforms shows only OSX also uses /var/tmp,
everyone else has switched to /tmp long ago.


cons: some smaller systems may have a smaller /tmp than /var/tmp,
and this may cause builds to fail with out of space earlier.
point the build to /var/tmp using TMPDIR in this case.

one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.


Revision tags: netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.97 17-Mar-2016 christos

gcc 5, my patience is waning.


# 1.96 24-Mar-2015 wiz

Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin


# 1.95 05-Mar-2015 dholland

One vscanf_l is ample.


# 1.94 04-Mar-2015 christos

PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve.


# 1.93 20-Jan-2015 christos

add popenve().


# 1.92 13-Oct-2014 christos

add open_{,w}memstream


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.91 07-Aug-2014 christos

branches: 1.91.2;
cast to LHS type and minor KNF.


# 1.90 23-May-2014 joerg

Fix use of getline and friends in C++ code.


# 1.89 19-May-2014 kleink

Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008. From Jarmo Jaakkola in PR standards/48788.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.88 04-May-2013 christos

branches: 1.88.4;
add the signal safe prototypes


# 1.87 26-Apr-2013 joerg

Don't pollute the name space with the various stdio macros for C++.


# 1.86 19-Apr-2013 joerg

Add missing __BEGIN_DECLS/__END_DECLS.


# 1.85 19-Apr-2013 joerg

Add scanf_l and wscanf_l families.


# 1.84 19-Apr-2013 joerg

Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.


# 1.83 17-Apr-2013 joerg

White space


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.82 18-Apr-2012 christos

branches: 1.82.2;
specify size of the array to help -fmudflap


Revision tags: yamt-pagecache-base4
# 1.81 27-Mar-2012 christos

funopen2()


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base
# 1.80 22-Jan-2012 christos

branches: 1.80.2;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.79 17-Jul-2011 joerg

branches: 1.79.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.78 24-Sep-2010 tnozaki

add fmemopen(3) derrived from POSIX:2008.
libc minor bump.


# 1.77 06-Sep-2010 christos

Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1
# 1.76 25-Feb-2010 joerg

Consistently use __printflike and __scanflike.


Revision tags: uebayasi-xip-base
# 1.75 11-Jan-2010 joerg

branches: 1.75.2;
Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.


Revision tags: matt-premerge-20091211
# 1.74 13-Jul-2009 roy

Add implementations for getdelim(3) and getline(3).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2
# 1.73 21-Sep-2008 christos

branches: 1.73.6;
add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.72 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase
# 1.71 13-Mar-2008 christos

branches: 1.71.4;
Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.70 02-Aug-2007 kristerw

branches: 1.70.2; 1.70.6; 1.70.8;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.69 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


# 1.68 02-Feb-2007 christos

remove __SAFE


# 1.67 09-Dec-2006 bjh21

defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.


Revision tags: netbsd-4-base
# 1.66 22-Nov-2006 christos

branches: 1.66.2;
Don't expose _ss functions for 4.0. Requested by core.


# 1.65 27-Oct-2006 christos

- flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.


Revision tags: abandoned-netbsd-4-base
# 1.64 10-May-2006 mrg

add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes.


# 1.63 27-Dec-2005 perry

inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.


# 1.62 24-Dec-2005 perry

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.61 25-May-2005 kleink

Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072.


# 1.60 25-May-2005 kleink

Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section.


# 1.59 25-May-2005 kleink

Add restrict qualifiers to fopen()/freopen() arguments.


Revision tags: netbsd-3-base
# 1.58 09-Feb-2005 kleink

branches: 1.58.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.


# 1.57 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.56 01-Jul-2004 kleink

Tidy up the namespace: lint -> __lint__.


# 1.55 10-May-2004 drochner

remove fgetstr() from public sight


# 1.54 21-Apr-2004 christos

add fgetstr


Revision tags: netbsd-2-0-base
# 1.53 07-Aug-2003 agc

branches: 1.53.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.52 05-Jun-2003 bjh21

P_tmpdir isn't in POSIX, so only define it for _XOPEN_SOURCE and
_NETBSD_SOURCE.


# 1.51 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.50 27-Feb-2003 kleink

As with _REENTRANT, don't provide simple non-locking macro versions of
several functions when _PTHREADS is defined (usually via cc -pthread).


# 1.49 18-Jan-2003 christos

avoid TMP_MAX redefinition


# 1.48 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.47 20-Dec-2002 atatat

Spelling police. "__resitrct" was not spelled cirectly enough.


# 1.46 30-Nov-2002 lukem

- Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).


# 1.45 24-May-2002 thorpej

* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.


# 1.44 24-May-2002 thorpej

Parameterize the vfscanf macro's arguments. Without them, 3rd party
software can become greatly confused.

This fixes 4 GCC 3.2 testsuite failures.

This is a stop-gap measure which can be easily applied to the 1.6
release branch. A different fix for the trunk is forthcoming.


# 1.43 24-May-2002 thorpej

Add a scanf format attribute to __svfscanf().


Revision tags: netbsd-1-6-base
# 1.42 07-Dec-2001 yamt

branches: 1.42.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.


# 1.41 29-Dec-2000 kleink

branches: 1.41.2;
Sprinkle some __restrict into stdio.


# 1.40 18-Dec-2000 christos

protect against multiple declarations.


# 1.39 15-Nov-2000 briggs

Move fmtcheck() prototype to stdio.h. It makes more sense to declare it
with the formatting functions with which it is meant to be used. Thanks
to Klaus Klein for "encouraging" me to make this change.


# 1.38 28-Jul-2000 kleink

Avoid recursion with traditional cpp.


# 1.37 23-Jul-2000 mycroft

This is a HACK so that libc can compile with -ansi.


# 1.36 16-Jul-2000 enami

- Fix couple of typos.
- Protect some func. decls. added recently with __{BEGIN,END}_DECLS.


# 1.35 15-Jul-2000 drochner

fix obvious typo


# 1.34 08-Jul-2000 kleink

XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.


# 1.33 26-Jun-2000 kleink

Get rid of the inclusion of <sys/types.h> and define fpos_t using __off_t.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.32 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.31 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.30 20-Nov-1998 kleink

* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions.
* Don't define a macro version of fileno() in a _REENTRANT environment.


# 1.29 28-Sep-1998 kleink

Move 1003.1c-1995 declarations inside the appropriate name space protection
wrapper, and make sure we won't use these decl's as such with C++ linkage(!).
Also, make _XOPEN_SOURCE protection of popen()/pclose() decl's a bit more
restrictive.


# 1.28 28-Aug-1998 tv

Use __format__, __printf__ for consistency


# 1.27 28-Aug-1998 perry

add asprintf and vasprintf, originally written by Todd Miller for OpenBSD


# 1.26 30-Jul-1998 mycroft

__Namespace__ __protection__.


# 1.25 27-Jul-1998 mycroft

Nuke tmpnam() as well.


# 1.24 27-Jul-1998 mycroft

If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.


# 1.23 11-May-1998 drochner

add missing backslash


# 1.22 11-May-1998 kleink

Reorganize name space protection.


# 1.21 14-Feb-1998 kleink

If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_rename() instead of rename() in order to remove the requirement of
linking against libposix.


# 1.20 02-Feb-1998 perry

merge lite-2


# 1.19 19-Jan-1998 jtc

Added function declarations for flockfile(), ftrylockfile(), funlockfile(),
getc_unlocked(), getchar_unlocked(), putc_unlocked(), & putchar_unlocked().
Added macro definitions for the latter four functions.

Changed so that getc(), putc(), clearerr(), feof() and ferror() macros
are not defined if _REENTRANT is defined so that thread-safe function
versions will be used instead.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.18 25-Apr-1996 jtc

Fix typo, __STRICT_ANSI_ -> __STRICT_ANSI__


# 1.17 20-Jan-1996 jtc

Removed declarations for sys_nerr & sys_errlist (moved to errno.h)


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 25-Mar-1995 jtc

change second arg of fgets() from size_t to int


# 1.15 22-Mar-1995 jtc

Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.


# 1.14 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.13 22-May-1994 cgd

_VA_LIST_ -> _BSD_VA_LIST_


# 1.12 21-May-1994 cgd

add _BSD's to ansi types


# 1.11 03-Apr-1994 cgd

fpos_t is now a 64-bit quantity


# 1.10 04-Jan-1994 cgd

rename fgetline() and sharpen axe for bostic...


# 1.9 02-Dec-1993 mycroft

Add `const's to sys_errlist decl to match 4.4.


# 1.8 01-Dec-1993 jtc

Use GCC's format attribute (for bug detection with -Wformat).


# 1.7 11-Oct-1993 jtc

Restore define for L_cuserid and add cuserid prototype.
It was provided, but not documented.


# 1.6 06-Oct-1993 jtc

cuserid() was removed by 1990's revision of 1003.1, and we never provided it
so don't define the L_cuserid constant.


# 1.5 04-Oct-1993 jtc

fread and fwrite both return size_t, not int.


# 1.4 04-Oct-1993 cgd

sscanf takes a const char * as the first arg; the man page was (already)
correct.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 17-Apr-1993 sef

`inline' is not present in gcc when -ansi is given; use __inline instead.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.97 17-Mar-2016 christos

gcc 5, my patience is waning.


# 1.96 24-Mar-2015 wiz

Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin


# 1.95 05-Mar-2015 dholland

One vscanf_l is ample.


# 1.94 04-Mar-2015 christos

PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve.


# 1.93 20-Jan-2015 christos

add popenve().


# 1.92 13-Oct-2014 christos

add open_{,w}memstream


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.91 07-Aug-2014 christos

branches: 1.91.2;
cast to LHS type and minor KNF.


# 1.90 23-May-2014 joerg

Fix use of getline and friends in C++ code.


# 1.89 19-May-2014 kleink

Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008. From Jarmo Jaakkola in PR standards/48788.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.88 04-May-2013 christos

branches: 1.88.4;
add the signal safe prototypes


# 1.87 26-Apr-2013 joerg

Don't pollute the name space with the various stdio macros for C++.


# 1.86 19-Apr-2013 joerg

Add missing __BEGIN_DECLS/__END_DECLS.


# 1.85 19-Apr-2013 joerg

Add scanf_l and wscanf_l families.


# 1.84 19-Apr-2013 joerg

Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.


# 1.83 17-Apr-2013 joerg

White space


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.82 18-Apr-2012 christos

branches: 1.82.2;
specify size of the array to help -fmudflap


Revision tags: yamt-pagecache-base4
# 1.81 27-Mar-2012 christos

funopen2()


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base
# 1.80 22-Jan-2012 christos

branches: 1.80.2;
From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.79 17-Jul-2011 joerg

branches: 1.79.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3
# 1.78 24-Sep-2010 tnozaki

add fmemopen(3) derrived from POSIX:2008.
libc minor bump.


# 1.77 06-Sep-2010 christos

Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


Revision tags: uebayasi-xip-base2 uebayasi-xip-base1
# 1.76 25-Feb-2010 joerg

Consistently use __printflike and __scanflike.


Revision tags: uebayasi-xip-base
# 1.75 11-Jan-2010 joerg

branches: 1.75.2;
Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.


Revision tags: matt-premerge-20091211
# 1.74 13-Jul-2009 roy

Add implementations for getdelim(3) and getline(3).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2
# 1.73 21-Sep-2008 christos

branches: 1.73.6;
add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.72 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase
# 1.71 13-Mar-2008 christos

branches: 1.71.4;
Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.70 02-Aug-2007 kristerw

branches: 1.70.2; 1.70.6; 1.70.8;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.69 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


# 1.68 02-Feb-2007 christos

remove __SAFE


# 1.67 09-Dec-2006 bjh21

defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.


Revision tags: netbsd-4-base
# 1.66 22-Nov-2006 christos

branches: 1.66.2;
Don't expose _ss functions for 4.0. Requested by core.


# 1.65 27-Oct-2006 christos

- flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.


Revision tags: abandoned-netbsd-4-base
# 1.64 10-May-2006 mrg

add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes.


# 1.63 27-Dec-2005 perry

inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.


# 1.62 24-Dec-2005 perry

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.


# 1.61 25-May-2005 kleink

Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072.


# 1.60 25-May-2005 kleink

Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section.


# 1.59 25-May-2005 kleink

Add restrict qualifiers to fopen()/freopen() arguments.


Revision tags: netbsd-3-base
# 1.58 09-Feb-2005 kleink

branches: 1.58.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.


# 1.57 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.56 01-Jul-2004 kleink

Tidy up the namespace: lint -> __lint__.


# 1.55 10-May-2004 drochner

remove fgetstr() from public sight


# 1.54 21-Apr-2004 christos

add fgetstr


Revision tags: netbsd-2-0-base
# 1.53 07-Aug-2003 agc

branches: 1.53.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.52 05-Jun-2003 bjh21

P_tmpdir isn't in POSIX, so only define it for _XOPEN_SOURCE and
_NETBSD_SOURCE.


# 1.51 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.50 27-Feb-2003 kleink

As with _REENTRANT, don't provide simple non-locking macro versions of
several functions when _PTHREADS is defined (usually via cc -pthread).


# 1.49 18-Jan-2003 christos

avoid TMP_MAX redefinition


# 1.48 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.47 20-Dec-2002 atatat

Spelling police. "__resitrct" was not spelled cirectly enough.


# 1.46 30-Nov-2002 lukem

- Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).


# 1.45 24-May-2002 thorpej

* Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.


# 1.44 24-May-2002 thorpej

Parameterize the vfscanf macro's arguments. Without them, 3rd party
software can become greatly confused.

This fixes 4 GCC 3.2 testsuite failures.

This is a stop-gap measure which can be easily applied to the 1.6
release branch. A different fix for the trunk is forthcoming.


# 1.43 24-May-2002 thorpej

Add a scanf format attribute to __svfscanf().


Revision tags: netbsd-1-6-base
# 1.42 07-Dec-2001 yamt

branches: 1.42.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.


# 1.41 29-Dec-2000 kleink

branches: 1.41.2;
Sprinkle some __restrict into stdio.


# 1.40 18-Dec-2000 christos

protect against multiple declarations.


# 1.39 15-Nov-2000 briggs

Move fmtcheck() prototype to stdio.h. It makes more sense to declare it
with the formatting functions with which it is meant to be used. Thanks
to Klaus Klein for "encouraging" me to make this change.


# 1.38 28-Jul-2000 kleink

Avoid recursion with traditional cpp.


# 1.37 23-Jul-2000 mycroft

This is a HACK so that libc can compile with -ansi.


# 1.36 16-Jul-2000 enami

- Fix couple of typos.
- Protect some func. decls. added recently with __{BEGIN,END}_DECLS.


# 1.35 15-Jul-2000 drochner

fix obvious typo


# 1.34 08-Jul-2000 kleink

XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.


# 1.33 26-Jun-2000 kleink

Get rid of the inclusion of <sys/types.h> and define fpos_t using __off_t.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.32 10-Jan-2000 kleink

Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.31 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.30 20-Nov-1998 kleink

* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions.
* Don't define a macro version of fileno() in a _REENTRANT environment.


# 1.29 28-Sep-1998 kleink

Move 1003.1c-1995 declarations inside the appropriate name space protection
wrapper, and make sure we won't use these decl's as such with C++ linkage(!).
Also, make _XOPEN_SOURCE protection of popen()/pclose() decl's a bit more
restrictive.


# 1.28 28-Aug-1998 tv

Use __format__, __printf__ for consistency


# 1.27 28-Aug-1998 perry

add asprintf and vasprintf, originally written by Todd Miller for OpenBSD


# 1.26 30-Jul-1998 mycroft

__Namespace__ __protection__.


# 1.25 27-Jul-1998 mycroft

Nuke tmpnam() as well.


# 1.24 27-Jul-1998 mycroft

If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.


# 1.23 11-May-1998 drochner

add missing backslash


# 1.22 11-May-1998 kleink

Reorganize name space protection.


# 1.21 14-Feb-1998 kleink

If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_rename() instead of rename() in order to remove the requirement of
linking against libposix.


# 1.20 02-Feb-1998 perry

merge lite-2


# 1.19 19-Jan-1998 jtc

Added function declarations for flockfile(), ftrylockfile(), funlockfile(),
getc_unlocked(), getchar_unlocked(), putc_unlocked(), & putchar_unlocked().
Added macro definitions for the latter four functions.

Changed so that getc(), putc(), clearerr(), feof() and ferror() macros
are not defined if _REENTRANT is defined so that thread-safe function
versions will be used instead.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.18 25-Apr-1996 jtc

Fix typo, __STRICT_ANSI_ -> __STRICT_ANSI__


# 1.17 20-Jan-1996 jtc

Removed declarations for sys_nerr & sys_errlist (moved to errno.h)


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.16 25-Mar-1995 jtc

change second arg of fgets() from size_t to int


# 1.15 22-Mar-1995 jtc

Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.


# 1.14 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.13 22-May-1994 cgd

_VA_LIST_ -> _BSD_VA_LIST_


# 1.12 21-May-1994 cgd

add _BSD's to ansi types


# 1.11 03-Apr-1994 cgd

fpos_t is now a 64-bit quantity


# 1.10 04-Jan-1994 cgd

rename fgetline() and sharpen axe for bostic...


# 1.9 02-Dec-1993 mycroft

Add `const's to sys_errlist decl to match 4.4.


# 1.8 01-Dec-1993 jtc

Use GCC's format attribute (for bug detection with -Wformat).


# 1.7 11-Oct-1993 jtc

Restore define for L_cuserid and add cuserid prototype.
It was provided, but not documented.


# 1.6 06-Oct-1993 jtc

cuserid() was removed by 1990's revision of 1003.1, and we never provided it
so don't define the L_cuserid constant.


# 1.5 04-Oct-1993 jtc

fread and fwrite both return size_t, not int.


# 1.4 04-Oct-1993 cgd

sscanf takes a const char * as the first arg; the man page was (already)
correct.


# 1.3 01-Aug-1993 mycroft

Add RCS identifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.2 17-Apr-1993 sef

`inline' is not present in gcc when -ansi is given; use __inline instead.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision