History log of /openbsd-current/include/stdio.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.55 05-Jan-2022 millert

funopen(): change seekfn argument to use off_t, not fpos_t
On BSD, fpos_t is typedef'd to off_t but some systems use a struct.
This means fpos_t is not a portable function argument or return value.
Both FreeBSD and the Linux libbsd funopen() have switched to off_t
for this--we should too. From Joe Nelson. OK deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.54 11-Sep-2020 naddy

add format string checking annotations for dprintf(3) and vdprintf(3)
ok millert@ deraadt@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.53 09-Sep-2016 millert

Move the 10 (!) defintions of NULL to their own mini header file and
update the NULL definition for C++11. OK deraadt@ guenther@ kettenis@


Revision tags: OPENBSD_6_0_BASE
# 1.52 16-Mar-2016 deraadt

remove cpp version of __sputc, since the inline version is all we have
ever used.
ok jsg


# 1.51 14-Mar-2016 millert

Expose snprintf() and vsnprintf() for XPG 5. It predates C99 but
still specified snprintf() and vsnprintf() based on earlier drafts.
Allows snprintf() and vsnprintf() to be used when _XOPEN_SOURCE is
defined as 500. OK guenther@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.50 20-Jan-2015 tedu

increase TMP_MAX to the equivalent of INT_MAX. it's actually more,
but safer not to wraparound by accident.
ok deraadt millert miod


Revision tags: OPENBSD_5_6_BASE
# 1.49 27-Mar-2014 tedu

safe to remove gets, now that's gone from cstdio too


# 1.48 25-Mar-2014 tedu

try to put the pin back in.
removing gets means removing it from libstdc++ and guenther tells me
that will require changing version numbers.


# 1.47 25-Mar-2014 tedu

no gets


# 1.46 16-Mar-2014 guenther

lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@


Revision tags: OPENBSD_5_5_BASE
# 1.45 04-Dec-2013 deraadt

express final disapproval of the interfaces in libcompat, such as
them ftime(), gtty(), stty(), re_comp(), cuserid() and others.
Discussion and ongoing work to fix the ports tree from many, especially
naddy.
ok naddy
[There is a bit more cleanup possible after that, but this is considered
the current safe step]


Revision tags: OPENBSD_5_4_BASE
# 1.44 28-Mar-2013 eric

Enable fmemopen(3) and open_{w,}memstream(3)

commiting on behalf of mpi@


Revision tags: OPENBSD_5_3_BASE
# 1.43 30-Jan-2013 brad

Add support for POSIX.1-2008 functions dprintf(3) and vdprintf(3).

Feedback from millert@ guenther@
OK guenther@ man page bits OK jmc@


Revision tags: OPENBSD_5_2_BASE
# 1.42 21-Mar-2012 fgsch

Implement getdelim(3) and getline(3).
Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de)
but this is based on NetBSD's implementation instead with some tweaks by me.
Further improvements would happen in tree.

ok millert@; discussed with many others
ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.41 18-Jul-2011 matthew

Expose a bunch of new functionality from POSIX 2008: openat(2),
fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2),
faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2),
symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and
fdopendir(3).

"Minor" libc bump.

Tested in a bulk build by naddy@
Much help from guenther@, thib@, tedu@, oga@, and others.
ok deraadt@, naddy@


# 1.40 03-Jul-2011 jsg

As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@


# 1.39 06-Apr-2011 miod

Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.38 09-Nov-2009 kurt

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

committing on behalf of and okay guenther@ now that we have install
media space available.


# 1.37 22-Oct-2009 guenther

Back out previous commit, as it caused too much growth for the install
media to fit


# 1.36 21-Oct-2009 guenther

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

ok kurt@, earlier version tested by sthen@ and jj@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.35 13-Jan-2006 miod

Remove neither documented nor found in any spec ctermid_r() function - ctermid()
is reentrant in its current implementation anyway.
Surfing on the recent major version bump, ok millert@ deraadt@


# 1.34 06-Jan-2006 millert

Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable


# 1.33 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_8_BASE
# 1.32 11-May-2005 espie

let vfscanf be a real function. Use a weak_alias on systems where this
is feasible.

Okay millert@

There's a major libc bump coming that is going to cover this as well...


# 1.31 30-Apr-2005 espie

Change internals of FILE: reuse the unget buffer field to access an
extended attribute data structure (pimpl idiom). Idea taken from citrus.
Much discussion with deraadt@, otto@, millert@...

This is the least disruptive way to extend FILE, since its size can't really
change without this being a flag day. So the size doesn't change.

Actual additions to the structure will come in separate steps, since this
change is nasty enough on its own.

Tests by otto@ and others, careful reading of code by otto@ and millert@.

This is definitely a major bump, and has been checked to not impact a
full ports build.


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.30 07-Jun-2004 marc

major bump to libc and libpthread to break the dependency of a
particular implementation of libpthread for libc. libc no longer
needs pthread.h to compile.
OK millert@, brad@, tedu@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.29 01-Aug-2003 avsm

add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@


# 1.28 26-Jun-2003 avsm

backout the __bounded__ attributes for a while; requested by deraadt@


# 1.27 26-Jun-2003 avsm

Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this!
deraadt@ ok


# 1.26 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.25 30-Dec-2002 millert

Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.


# 1.24 29-Dec-2002 millert

Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.


# 1.23 25-Oct-2002 millert

NULL is now 0L so it is the same size as a pointer.
OK mickey@ and discussed with deraadt@


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.22 19-Feb-2002 millert

We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.


# 1.21 17-Feb-2002 millert

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)


# 1.20 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


# 1.19 02-Nov-2001 espie

attribute(format) no longer implies nonnull...
ok millert@ miod@


Revision tags: OPENBSD_3_0_BASE
# 1.18 04-Sep-2001 fgsch

put changes back, this time ALL the files.


# 1.17 30-Aug-2001 todd

Back out fgsch@'s tree breaking commits.
Test next time, ok?


# 1.16 30-Aug-2001 fgsch

fix some const warnings


Revision tags: OPENBSD_2_9_BASE
# 1.15 06-Dec-2000 deraadt

use __x__ formats for __attribute__ arguments; guenther@gac.edu


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 04-Mar-2000 millert

Make P_tmpdir point to /tmp/ not /var/tmp
Really, there should be a way to make configurable by the admin
at runtime (say, a gettmpdir() function).


# 1.13 22-Feb-2000 millert

Use an _BSD_FOO_T_ type declaration for off_t in machine/ansi.h to allow
off_t to be visible in stdio.h even in strict ansi mode. This is needed
for ftello()/fseeko() and it allows us to remove the horrible fpos_t hack.


# 1.12 21-Feb-2000 millert

Add fseeko() and ftello() -- versions of fseek() and ftell() that use off_t.
Also make fsetpos() and fgetpos() use fseeko() and ftello() respectively
since fpos_t is actually a 64bit type.


Revision tags: OPENBSD_2_6_BASE
# 1.11 17-Sep-1999 espie

Be thorough about NULL as __null for C++.


Revision tags: OPENBSD_2_5_BASE
# 1.10 20-Nov-1998 d

Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
(more md stuff is needed for other libc/arch/*)
(setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.9 29-Nov-1997 millert

Add __attribute__ for asprintf.


# 1.8 29-Nov-1997 millert

Implement asprintf(3) and vasprintf(3) functions similar to the
ones in the glibc. Some man pages changes from FreeBSD
(asprintf.c/vasprintf.c are not based on GNU or FreeBSD code).


Revision tags: OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.7 28-Oct-1996 tholo

Do not enable putc() macro implementation if _POSIX_SOURCE is defined;
it is not fully compliant


Revision tags: OPENBSD_2_0_BASE
# 1.6 26-Jul-1996 deraadt

export non-constipated sys_errlist[] to userland


# 1.5 25-Jul-1996 downsj

Partially revert back to the old behaviour of declaring sys_errlist here.

sys/errno.h can declare it as well.


# 1.4 01-May-1996 deraadt

typo in __STRICT_ANSI__


# 1.3 24-Mar-1996 tholo

Prefix "long long" with "/* LONGLONG */" to shut up lint(1)


# 1.2 29-Jan-1996 deraadt

from netbsd; move sys_nerr/sys_errlist decls to errno.h


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.54 11-Sep-2020 naddy

add format string checking annotations for dprintf(3) and vdprintf(3)
ok millert@ deraadt@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.53 09-Sep-2016 millert

Move the 10 (!) defintions of NULL to their own mini header file and
update the NULL definition for C++11. OK deraadt@ guenther@ kettenis@


Revision tags: OPENBSD_6_0_BASE
# 1.52 16-Mar-2016 deraadt

remove cpp version of __sputc, since the inline version is all we have
ever used.
ok jsg


# 1.51 14-Mar-2016 millert

Expose snprintf() and vsnprintf() for XPG 5. It predates C99 but
still specified snprintf() and vsnprintf() based on earlier drafts.
Allows snprintf() and vsnprintf() to be used when _XOPEN_SOURCE is
defined as 500. OK guenther@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.50 20-Jan-2015 tedu

increase TMP_MAX to the equivalent of INT_MAX. it's actually more,
but safer not to wraparound by accident.
ok deraadt millert miod


Revision tags: OPENBSD_5_6_BASE
# 1.49 27-Mar-2014 tedu

safe to remove gets, now that's gone from cstdio too


# 1.48 25-Mar-2014 tedu

try to put the pin back in.
removing gets means removing it from libstdc++ and guenther tells me
that will require changing version numbers.


# 1.47 25-Mar-2014 tedu

no gets


# 1.46 16-Mar-2014 guenther

lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@


Revision tags: OPENBSD_5_5_BASE
# 1.45 04-Dec-2013 deraadt

express final disapproval of the interfaces in libcompat, such as
them ftime(), gtty(), stty(), re_comp(), cuserid() and others.
Discussion and ongoing work to fix the ports tree from many, especially
naddy.
ok naddy
[There is a bit more cleanup possible after that, but this is considered
the current safe step]


Revision tags: OPENBSD_5_4_BASE
# 1.44 28-Mar-2013 eric

Enable fmemopen(3) and open_{w,}memstream(3)

commiting on behalf of mpi@


Revision tags: OPENBSD_5_3_BASE
# 1.43 30-Jan-2013 brad

Add support for POSIX.1-2008 functions dprintf(3) and vdprintf(3).

Feedback from millert@ guenther@
OK guenther@ man page bits OK jmc@


Revision tags: OPENBSD_5_2_BASE
# 1.42 21-Mar-2012 fgsch

Implement getdelim(3) and getline(3).
Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de)
but this is based on NetBSD's implementation instead with some tweaks by me.
Further improvements would happen in tree.

ok millert@; discussed with many others
ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.41 18-Jul-2011 matthew

Expose a bunch of new functionality from POSIX 2008: openat(2),
fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2),
faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2),
symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and
fdopendir(3).

"Minor" libc bump.

Tested in a bulk build by naddy@
Much help from guenther@, thib@, tedu@, oga@, and others.
ok deraadt@, naddy@


# 1.40 03-Jul-2011 jsg

As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@


# 1.39 06-Apr-2011 miod

Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.38 09-Nov-2009 kurt

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

committing on behalf of and okay guenther@ now that we have install
media space available.


# 1.37 22-Oct-2009 guenther

Back out previous commit, as it caused too much growth for the install
media to fit


# 1.36 21-Oct-2009 guenther

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

ok kurt@, earlier version tested by sthen@ and jj@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.35 13-Jan-2006 miod

Remove neither documented nor found in any spec ctermid_r() function - ctermid()
is reentrant in its current implementation anyway.
Surfing on the recent major version bump, ok millert@ deraadt@


# 1.34 06-Jan-2006 millert

Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable


# 1.33 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_8_BASE
# 1.32 11-May-2005 espie

let vfscanf be a real function. Use a weak_alias on systems where this
is feasible.

Okay millert@

There's a major libc bump coming that is going to cover this as well...


# 1.31 30-Apr-2005 espie

Change internals of FILE: reuse the unget buffer field to access an
extended attribute data structure (pimpl idiom). Idea taken from citrus.
Much discussion with deraadt@, otto@, millert@...

This is the least disruptive way to extend FILE, since its size can't really
change without this being a flag day. So the size doesn't change.

Actual additions to the structure will come in separate steps, since this
change is nasty enough on its own.

Tests by otto@ and others, careful reading of code by otto@ and millert@.

This is definitely a major bump, and has been checked to not impact a
full ports build.


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.30 07-Jun-2004 marc

major bump to libc and libpthread to break the dependency of a
particular implementation of libpthread for libc. libc no longer
needs pthread.h to compile.
OK millert@, brad@, tedu@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.29 01-Aug-2003 avsm

add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@


# 1.28 26-Jun-2003 avsm

backout the __bounded__ attributes for a while; requested by deraadt@


# 1.27 26-Jun-2003 avsm

Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this!
deraadt@ ok


# 1.26 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.25 30-Dec-2002 millert

Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.


# 1.24 29-Dec-2002 millert

Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.


# 1.23 25-Oct-2002 millert

NULL is now 0L so it is the same size as a pointer.
OK mickey@ and discussed with deraadt@


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.22 19-Feb-2002 millert

We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.


# 1.21 17-Feb-2002 millert

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)


# 1.20 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


# 1.19 02-Nov-2001 espie

attribute(format) no longer implies nonnull...
ok millert@ miod@


Revision tags: OPENBSD_3_0_BASE
# 1.18 04-Sep-2001 fgsch

put changes back, this time ALL the files.


# 1.17 30-Aug-2001 todd

Back out fgsch@'s tree breaking commits.
Test next time, ok?


# 1.16 30-Aug-2001 fgsch

fix some const warnings


Revision tags: OPENBSD_2_9_BASE
# 1.15 06-Dec-2000 deraadt

use __x__ formats for __attribute__ arguments; guenther@gac.edu


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 04-Mar-2000 millert

Make P_tmpdir point to /tmp/ not /var/tmp
Really, there should be a way to make configurable by the admin
at runtime (say, a gettmpdir() function).


# 1.13 22-Feb-2000 millert

Use an _BSD_FOO_T_ type declaration for off_t in machine/ansi.h to allow
off_t to be visible in stdio.h even in strict ansi mode. This is needed
for ftello()/fseeko() and it allows us to remove the horrible fpos_t hack.


# 1.12 21-Feb-2000 millert

Add fseeko() and ftello() -- versions of fseek() and ftell() that use off_t.
Also make fsetpos() and fgetpos() use fseeko() and ftello() respectively
since fpos_t is actually a 64bit type.


Revision tags: OPENBSD_2_6_BASE
# 1.11 17-Sep-1999 espie

Be thorough about NULL as __null for C++.


Revision tags: OPENBSD_2_5_BASE
# 1.10 20-Nov-1998 d

Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
(more md stuff is needed for other libc/arch/*)
(setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.9 29-Nov-1997 millert

Add __attribute__ for asprintf.


# 1.8 29-Nov-1997 millert

Implement asprintf(3) and vasprintf(3) functions similar to the
ones in the glibc. Some man pages changes from FreeBSD
(asprintf.c/vasprintf.c are not based on GNU or FreeBSD code).


Revision tags: OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.7 28-Oct-1996 tholo

Do not enable putc() macro implementation if _POSIX_SOURCE is defined;
it is not fully compliant


Revision tags: OPENBSD_2_0_BASE
# 1.6 26-Jul-1996 deraadt

export non-constipated sys_errlist[] to userland


# 1.5 25-Jul-1996 downsj

Partially revert back to the old behaviour of declaring sys_errlist here.

sys/errno.h can declare it as well.


# 1.4 01-May-1996 deraadt

typo in __STRICT_ANSI__


# 1.3 24-Mar-1996 tholo

Prefix "long long" with "/* LONGLONG */" to shut up lint(1)


# 1.2 29-Jan-1996 deraadt

from netbsd; move sys_nerr/sys_errlist decls to errno.h


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.53 09-Sep-2016 millert

Move the 10 (!) defintions of NULL to their own mini header file and
update the NULL definition for C++11. OK deraadt@ guenther@ kettenis@


Revision tags: OPENBSD_6_0_BASE
# 1.52 16-Mar-2016 deraadt

remove cpp version of __sputc, since the inline version is all we have
ever used.
ok jsg


# 1.51 14-Mar-2016 millert

Expose snprintf() and vsnprintf() for XPG 5. It predates C99 but
still specified snprintf() and vsnprintf() based on earlier drafts.
Allows snprintf() and vsnprintf() to be used when _XOPEN_SOURCE is
defined as 500. OK guenther@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.50 20-Jan-2015 tedu

increase TMP_MAX to the equivalent of INT_MAX. it's actually more,
but safer not to wraparound by accident.
ok deraadt millert miod


Revision tags: OPENBSD_5_6_BASE
# 1.49 27-Mar-2014 tedu

safe to remove gets, now that's gone from cstdio too


# 1.48 25-Mar-2014 tedu

try to put the pin back in.
removing gets means removing it from libstdc++ and guenther tells me
that will require changing version numbers.


# 1.47 25-Mar-2014 tedu

no gets


# 1.46 16-Mar-2014 guenther

lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@


Revision tags: OPENBSD_5_5_BASE
# 1.45 04-Dec-2013 deraadt

express final disapproval of the interfaces in libcompat, such as
them ftime(), gtty(), stty(), re_comp(), cuserid() and others.
Discussion and ongoing work to fix the ports tree from many, especially
naddy.
ok naddy
[There is a bit more cleanup possible after that, but this is considered
the current safe step]


Revision tags: OPENBSD_5_4_BASE
# 1.44 28-Mar-2013 eric

Enable fmemopen(3) and open_{w,}memstream(3)

commiting on behalf of mpi@


Revision tags: OPENBSD_5_3_BASE
# 1.43 30-Jan-2013 brad

Add support for POSIX.1-2008 functions dprintf(3) and vdprintf(3).

Feedback from millert@ guenther@
OK guenther@ man page bits OK jmc@


Revision tags: OPENBSD_5_2_BASE
# 1.42 21-Mar-2012 fgsch

Implement getdelim(3) and getline(3).
Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de)
but this is based on NetBSD's implementation instead with some tweaks by me.
Further improvements would happen in tree.

ok millert@; discussed with many others
ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.41 18-Jul-2011 matthew

Expose a bunch of new functionality from POSIX 2008: openat(2),
fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2),
faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2),
symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and
fdopendir(3).

"Minor" libc bump.

Tested in a bulk build by naddy@
Much help from guenther@, thib@, tedu@, oga@, and others.
ok deraadt@, naddy@


# 1.40 03-Jul-2011 jsg

As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@


# 1.39 06-Apr-2011 miod

Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.38 09-Nov-2009 kurt

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

committing on behalf of and okay guenther@ now that we have install
media space available.


# 1.37 22-Oct-2009 guenther

Back out previous commit, as it caused too much growth for the install
media to fit


# 1.36 21-Oct-2009 guenther

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

ok kurt@, earlier version tested by sthen@ and jj@


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.35 13-Jan-2006 miod

Remove neither documented nor found in any spec ctermid_r() function - ctermid()
is reentrant in its current implementation anyway.
Surfing on the recent major version bump, ok millert@ deraadt@


# 1.34 06-Jan-2006 millert

Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable


# 1.33 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_8_BASE
# 1.32 11-May-2005 espie

let vfscanf be a real function. Use a weak_alias on systems where this
is feasible.

Okay millert@

There's a major libc bump coming that is going to cover this as well...


# 1.31 30-Apr-2005 espie

Change internals of FILE: reuse the unget buffer field to access an
extended attribute data structure (pimpl idiom). Idea taken from citrus.
Much discussion with deraadt@, otto@, millert@...

This is the least disruptive way to extend FILE, since its size can't really
change without this being a flag day. So the size doesn't change.

Actual additions to the structure will come in separate steps, since this
change is nasty enough on its own.

Tests by otto@ and others, careful reading of code by otto@ and millert@.

This is definitely a major bump, and has been checked to not impact a
full ports build.


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.30 07-Jun-2004 marc

major bump to libc and libpthread to break the dependency of a
particular implementation of libpthread for libc. libc no longer
needs pthread.h to compile.
OK millert@, brad@, tedu@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.29 01-Aug-2003 avsm

add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@


# 1.28 26-Jun-2003 avsm

backout the __bounded__ attributes for a while; requested by deraadt@


# 1.27 26-Jun-2003 avsm

Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this!
deraadt@ ok


# 1.26 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.25 30-Dec-2002 millert

Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.


# 1.24 29-Dec-2002 millert

Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.


# 1.23 25-Oct-2002 millert

NULL is now 0L so it is the same size as a pointer.
OK mickey@ and discussed with deraadt@


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.22 19-Feb-2002 millert

We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.


# 1.21 17-Feb-2002 millert

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)


# 1.20 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


# 1.19 02-Nov-2001 espie

attribute(format) no longer implies nonnull...
ok millert@ miod@


Revision tags: OPENBSD_3_0_BASE
# 1.18 04-Sep-2001 fgsch

put changes back, this time ALL the files.


# 1.17 30-Aug-2001 todd

Back out fgsch@'s tree breaking commits.
Test next time, ok?


# 1.16 30-Aug-2001 fgsch

fix some const warnings


Revision tags: OPENBSD_2_9_BASE
# 1.15 06-Dec-2000 deraadt

use __x__ formats for __attribute__ arguments; guenther@gac.edu


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 04-Mar-2000 millert

Make P_tmpdir point to /tmp/ not /var/tmp
Really, there should be a way to make configurable by the admin
at runtime (say, a gettmpdir() function).


# 1.13 22-Feb-2000 millert

Use an _BSD_FOO_T_ type declaration for off_t in machine/ansi.h to allow
off_t to be visible in stdio.h even in strict ansi mode. This is needed
for ftello()/fseeko() and it allows us to remove the horrible fpos_t hack.


# 1.12 21-Feb-2000 millert

Add fseeko() and ftello() -- versions of fseek() and ftell() that use off_t.
Also make fsetpos() and fgetpos() use fseeko() and ftello() respectively
since fpos_t is actually a 64bit type.


Revision tags: OPENBSD_2_6_BASE
# 1.11 17-Sep-1999 espie

Be thorough about NULL as __null for C++.


Revision tags: OPENBSD_2_5_BASE
# 1.10 20-Nov-1998 d

Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
(more md stuff is needed for other libc/arch/*)
(setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.9 29-Nov-1997 millert

Add __attribute__ for asprintf.


# 1.8 29-Nov-1997 millert

Implement asprintf(3) and vasprintf(3) functions similar to the
ones in the glibc. Some man pages changes from FreeBSD
(asprintf.c/vasprintf.c are not based on GNU or FreeBSD code).


Revision tags: OPENBSD_2_1_BASE OPENBSD_2_2_BASE
# 1.7 28-Oct-1996 tholo

Do not enable putc() macro implementation if _POSIX_SOURCE is defined;
it is not fully compliant


Revision tags: OPENBSD_2_0_BASE
# 1.6 26-Jul-1996 deraadt

export non-constipated sys_errlist[] to userland


# 1.5 25-Jul-1996 downsj

Partially revert back to the old behaviour of declaring sys_errlist here.

sys/errno.h can declare it as well.


# 1.4 01-May-1996 deraadt

typo in __STRICT_ANSI__


# 1.3 24-Mar-1996 tholo

Prefix "long long" with "/* LONGLONG */" to shut up lint(1)


# 1.2 29-Jan-1996 deraadt

from netbsd; move sys_nerr/sys_errlist decls to errno.h


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision