History log of /freebsd-current/lib/libc/stdio/Makefile.inc
Revision Date Author Comments
# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# dc41de36 18-Oct-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

libc: Fix missing or misspelled MLINKS.

Differential Revision: https://reviews.freebsd.org/D42192


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 12fe218f 29-Jan-2020 Kyle Evans <kevans@FreeBSD.org>

stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite

fflush_unlocked is currently desired in ports by sysutils/metalog, and
redefined as the locked fflush.

fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are
currently desired in ports by devel/elfutils, and redefined as the locked
fputs, fread, and fwrite respectively.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23336


# 07657474 29-Jul-2019 Mark Johnston <markj@FreeBSD.org>

Add mkostempsat(3).

This is a variant of mkostemps() which takes a directory descriptor and
returns a descriptor for a tempfile relative to that directory. Unlike
the other mktemp functions, mkostempsat() can be used in capability
mode.

Reviewed by: cem
Discussed with: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21031


# a77546fb 03-Apr-2018 Cy Schubert <cy@FreeBSD.org>

Add new gets_s(3) stdio function.

This implements the gets_s(3) function as documented at
http://en.cppreference.com/w/c/io/gets. It facilitates the
optional removal of gets(3).

Reviewed by: ed
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12785


# 877a840c 11-May-2016 Conrad Meyer <cem@FreeBSD.org>

libc: Add fopencookie(3) wrapper around funopen(3)

Reviewed by: jhb, oshogbo
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6282


# 45d1fa18 25-Nov-2015 Enji Cooper <ngie@FreeBSD.org>

Link fclose(3) to fdclose(3)

X-MFC with: r285140
MFC after: 3 weeks (need to evaluate whether or not r285140 can be MFCed)
Sponsored by: EMC / Isilon Storage Division


# 8876613d 03-Mar-2014 Marcel Moolenaar <marcel@FreeBSD.org>

Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}
if not already defined. This allows building libc from outside of
lib/libc using a reach-over makefile.

A typical use-case is to build a standard ILP32 version and a COMPAT32
version in a single iteration by building the COMPAT32 version using a
reach-over makefile.

Obtained from: Juniper Networks, Inc.


# 65ba8dff 09-Aug-2013 Jilles Tjoelker <jilles@FreeBSD.org>

Add mkostemp() and mkostemps().

These are like mkstemp() and mkstemps() but allow passing open(2) flags like
O_CLOEXEC.


# 9240031a 27-Feb-2013 John Baldwin <jhb@FreeBSD.org>

Add an implementation of open_memstream() and open_wmemstream(). These
routines provide write-only stdio FILE objects that store their data in a
dynamically allocated buffer. They are a string builder interface somewhat
akin to a completely dynamic sbuf.

Reviewed by: bde, jilles (earlier versions)
MFC after: 1 month


# 96c95412 30-Jan-2013 Pietro Cerutti <gahr@FreeBSD.org>

Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along
with the respective regression test.
See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html

Reviewed by: cognet
Approved by: cognet


# af27459a 23-May-2012 Isabell Long <issyl0@FreeBSD.org>

Add two new locale-specific man pages:
- libc/stdio/scanf_l.3
- libc/stdio/printf_l.3

Reviewed by: theraven
Approved by: gabor (mentor)
MFC after: 5 days


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# ad760e6f 03-Mar-2009 David Schultz <das@FreeBSD.org>

Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),
dprintf() is a simple wrapper around another function, so we may as
well implement it. But also like getline(), we can't prototype it by
default right now because it would break too many ports.


# 69099ba2 27-Feb-2009 David Schultz <das@FreeBSD.org>

- Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
wcscasecmp(), and wcsncasecmp().
- Make some previously non-standard extensions visible
if POSIX_VISIBLE >= 200809.
- Use restrict qualifiers in stpcpy().
- Declare off_t and size_t in stdio.h.
- Bump __FreeBSD_version in case the new symbols (particularly
getline()) cause issues with ports.

Reviewed by: standards@


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 2591efcc 29-Jun-2008 David Schultz <das@FreeBSD.org>

Reduce the level of duplication between vfprintf() and vfwprintf()
by moving the positional argument handling code to a new file,
printf-pos.c, and moving common definitions to printflocal.h.
No functional change intended.


# c17bf9a9 02-May-2008 John Baldwin <jhb@FreeBSD.org>

Next round of stdio changes: Remove all inlining of stdio operations and
move the definition of the type backing FILE (struct __sFILE) into an
internal header.
- Remove macros to inline certain operations from stdio.h. Applications
will now always call the functions instead.
- Move the various foo_unlocked() functions from unlocked.c into foo.c.
This lets some of the inlining macros (e.g. __sfeof()) move into
foo.c.
- Update a few comments.
- struct __sFILE can now go back to using mbstate_t, pthread_t, and
pthread_mutex_t instead of knowing about their private, backing types.

MFC after: 1 month
Reviewed by: kan


# b62c955c 22-Apr-2006 Daniel Eischen <deischen@FreeBSD.org>

Add fcloseall() to libc. This removes the need to export _cleanup().
Linux also provides an fcloseall() implementation.

Discussed on: arch


# 6fad3aaf 12-Mar-2006 Daniel Eischen <deischen@FreeBSD.org>

Add each directory's symbol map file to SYM_MAPS.


# 6dbacee2 24-Jan-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Make the %V{is} extension handle a NULL pointer like %s does: output "(null)"

Add %M{essage} extension which prints an errno value as the
corresponding string if possible or numerically otherwise.

It is not currently possible to do the syslog(3) like %m extension
because errno would need to get capatured on entry to the first
function in the printf family, so %M requires you to supply errno
as an argument.

Add %Q{uote} extension which will print a string in double quotes with
appropriate back-slash escapes (only) if necessary.


# 75067f4f 16-Dec-2005 Poul-Henning Kamp <phk@FreeBSD.org>

Add an extensible version of our *printf(3) implementation to libc
on probationary terms: it may go away again if it transpires it is
a bad idea.

This extensible printf version will only be used if either
environment variable USE_XPRINTF is defined
or
one of the extension functions are called.
or
the global variable __use_xprintf is set greater than zero.

In all other cases our traditional printf implementation will
be used.

The extensible version is slower than the default printf, mostly
because less opportunity for combining I/O operation exists when
faced with extensions. The default printf on the other hand
is a bad case of spaghetti code.

The extension API has a GLIBC compatible part and a FreeBSD version
of same. The FreeBSD version exists because the GLIBC version may
run afoul of our FILE * locking in multithreaded programs and it
even further eliminate the opportunities for combining I/O operations.

Include three demo extensions which can be enabled if desired: time
(%T), hexdump (%H) and strvis (%V).

%T can format time_t (%T), struct timeval (%lT) and struct timespec (%llT)
in one of two human readable duration formats:
"%.3llT" -> "20349.245"
"%#.3llT" -> "5h39m9.245"

%H will hexdump a sequence of bytes and takes a pointer and a length
argument. The width specifies number of bytes per line.
"%4H" -> "65 72 20 65"
"%+4H" -> "0000 65 72 20 65"
"%#4H" -> "65 72 20 65 |er e|"
"%+#4H" -> "0000 65 72 20 65 |er e|"

%V will dump a string in strvis format.
"%V" -> "Hello\tWor\377ld" (C-style)
"%0V" -> "Hello\011Wor\377ld" (octal)
"%+V" -> "Hello%09Wor%FFld" (http-style)

Tests, comments, bugreports etc are most welcome.


# 9531ef0f 16-Jul-2004 Tim J. Robbins <tjr@FreeBSD.org>

Add fgetwln(), a wide character version of fgetln().


# 4549f620 09-Jan-2003 Tim J. Robbins <tjr@FreeBSD.org>

Document clearerr_unlocked(), feof_unlocked(), ferror_unlocked()
and fileno_unlocked().


# 4d844c09 09-Jan-2003 Tim J. Robbins <tjr@FreeBSD.org>

Add a manual page for flockfile(), ftrylockfile(), and funlockfile().


# cbee408d 09-Jan-2003 Tim J. Robbins <tjr@FreeBSD.org>

Document getc_unlocked(), getchar_unlocked(), putc_unlocked(),
and putchar_unlocked().


# a5b0089e 09-Jan-2003 Tim J. Robbins <tjr@FreeBSD.org>

Add function versions of getchar_unlocked(), getc_unlocked(),
putchar_unlocked(), putc_unlocked(), feof_unlocked(), ferror_unlocked(),
clearerr_unlocked(), and fileno_unlocked(). The first four are required
by POSIX. The rest are provided for consistency.


# c51d717f 18-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

libc_r wasn't so tied to libc for 22 months.


# ac1cc6ee 03-Nov-2002 Alfred Perlstein <alfred@FreeBSD.org>

Backout "compatibility hack" for __sF.

Requested by: Steve Kargl <sgk@troutmask.apl.washington.edu> (submitter)


# 0fc25b92 02-Nov-2002 Alfred Perlstein <alfred@FreeBSD.org>

Provide a hook to make __sF visible outside of libc for commercial apps
if WANT_COMPAT4_STDIO is defined when compiling libc.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>


# 1f4ff850 22-Sep-2002 Tim J. Robbins <tjr@FreeBSD.org>

Add implementations of wscanf() and related functions: fwscanf(), swscanf(),
vfwscanf(), vswscanf(), vwscanf(). As the name suggests, these are wide-
character versions of the scanf() family of functions.


# c5604d0a 21-Sep-2002 Tim J. Robbins <tjr@FreeBSD.org>

Add implementations of the wprintf() family of functions, which perform
formatted wide-character output.


# 209c34ba 13-Aug-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Unbreak one of the most confusing breaks of the tree I've seen.

The last commit cannot possibly have been tested.


# 439cb19e 13-Aug-2002 Tim J. Robbins <tjr@FreeBSD.org>

Tidy up SRCS and MAN assignments.


# e74101e4 13-Aug-2002 Tim J. Robbins <tjr@FreeBSD.org>

Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),
putwc(), fputwc(), putwchar(), ungetwc(), fwide().


# 4a558355 27-Mar-2001 Ruslan Ermilov <ru@FreeBSD.org>

MAN[1-9] -> MAN.


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 2ee87840 04-Apr-1999 Warner Losh <imp@FreeBSD.org>

Add mkstemps to the man page, and create a link for it.

Obtained from: OpenBSD
Poked in the eye about committing new functions without a manpage: obrien


# dcf01d60 05-Mar-1999 Bruce Evans <bde@FreeBSD.org>

Fixed disordering and incoinsistent style in previous commit.


# 7307d07d 08-Feb-1999 Dmitrij Tejblum <dt@FreeBSD.org>

Added functions fseeko() and ftello() (from susv2).
Fixed fgetpos() and fsetpos() for offsets > 2GB.

PR: 8637
Submitted by: Dan Nelson <dnelson@emsphone.com> (adjusted by me a little)


# f9a8e5fa 07-May-1998 John Birrell <jb@FreeBSD.org>

Remote the NetBSD kludge for vfprintf.c


# ec216c26 11-Apr-1998 John Birrell <jb@FreeBSD.org>

Add FILE locking stubs for libc.

Change the FILE locking to support kernel threads when linked with
libpthread (which you haven't see yet). This requires that libc become
thread-safe and thread-aware, testing __isthreaded before attempting
to do lock/unlock calls. The impact on non-threaded programs is minor.
This change works with libc_r, so it's the best compromise.


# 034abff9 11-Mar-1998 Bruce Evans <bde@FreeBSD.org>

Fixed disordering and inconsistent style in previous commit.


# 2f253e75 12-Feb-1998 Warner Losh <imp@FreeBSD.org>

Many security improvements from OpenBSD:
implement mkdtemp
improve man page for mk*temp
use arc4random to seed extra XXX's randomly
Optionally warn of unsafe mktemp uses
From various commits by theo de raadt and Todd Miller.
Obtained from: OpenBSD

This should go into 2.2 after a testing period.


# b966cc23 21-Oct-1997 Bruce Evans <bde@FreeBSD.org>

Sorted lists.


# 2bc3b4d7 15-Oct-1997 Bruce Evans <bde@FreeBSD.org>

Removed the subdirectory paths from the definitions of MAN[1-9]. They
were a workaround for limitations in bsd.man.mk that were fixed about
2 years ago.


# 87003932 02-May-1997 John Birrell <jb@FreeBSD.org>

Changed all paths to be relative to src/lib instead of src/lib/libc
so that all these makefiles can be used to build libc_r too.

Added .if ${LIB} == "c" tests to restrict man page builds to libc
to avoid needlessly building them with libc_r too.

Split libc Makefile into Makefile and Makefile.inc to allow the
libc_r Makefile to include Makefile.inc too.


# 7e546392 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 941fbd30 28-May-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

Fix bogus MLINKS line from vasprintf change.


# 01fc74a0 28-May-1996 Wolfram Schneider <wosch@FreeBSD.org>

add manpage links

asprintf.3 -> printf.3
vasprintf -> printf.3


# 15aa00d5 27-May-1996 Peter Wemm <peter@FreeBSD.org>

Add an implementation of the gnu-ish asprintf() and vasprintf(). They are
not based on gpl'ed code, just prototype and usage. I'm not 100% certain
they behave the same while the system is in trouble (eg: malloc() failing)
but in those circumstances all bets would be off anyway.

These routines work like sprintf() and vsprintf(), except that instead of
using a fixed buffer, they allocate memory and return it to the user
and it's the user's responsibility to free() it. They have allocate as
much memory as they need (and can get), so the size of strings it can deal
with is limited only by the amount of memory it can malloc() on your
behalf.

There are a few gpl'ed programs starting to use this interface, and it's
becoming more common with the scares about security risks with sprintf().
I dont like the look of the code that the various programs (including
cvs, gdb, libg++, etc) provide if configure can't find it on the system.

It should be possible to modify the stdio core code to provide this
interface more efficiently, I was more worried about having something
that worked and was secure. :-) (I noticed that there was once intended
to be a smprintf() routine when our stdio was written for 4.4BSD, but it
looks pretty stillborn, and it's intended interface is not clear). Since
Linux and gnu libc have this interface, it seemed silly to bring yet
another one onto the scene.


# 6c06b4e2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 2ceb2ce9 04-Aug-1994 Garrett Wollman <wollman@FreeBSD.org>

First crack at making libc work with the new make macros. It compiles on
my machine, and a simple static (genassym) and shared (sysctl) executable
both work. Still to be done: RPCand YP merge.


# 58f0484f 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Lib Sources