/[base]/head/include/stdio.h
ViewVC logotype

Log of /head/include/stdio.h

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:


Revision 357419 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 2 19:45:12 2020 UTC (3 years, 1 month ago) by kevans
File length: 17326 byte(s)
Diff to previous 357284
libc: provide fputc_unlocked

Among the same justification as the other stdio _unlocked; in addition to an
inline version in <stdio.h>, we must provide a function in libc as well for
the functionality. This fixes the lang/gcc* builds, which want to use the
symbol from libc.

PR:		243810
Reported by:	antoine, swills, Michael <michael.adm gmail com>
X-MFC-With:	r357284


Revision 357284 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 30 03:31:16 2020 UTC (3 years, 1 month ago) by kevans
File length: 17292 byte(s)
Diff to previous 352056
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


Revision 352056 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 9 11:15:14 2019 UTC (3 years, 5 months ago) by kib
File length: 16987 byte(s)
Diff to previous 351659
Make snprintf(3) and vscanf(3) definitions available under appropriate
POSIX visibility.

Reported by:	jbeich
Reviewed by:	jilles
PR:	207287
MFC after:	1 week


Revision 351659 - (view) (download) (annotate) - [select for diffs]
Modified Sun Sep 1 16:12:05 2019 UTC (3 years, 6 months ago) by emaste
File length: 16923 byte(s)
Diff to previous 331948
libc: remove gets

gets is unsafe and shouldn't be used (for many years now).  Leave it in
the existing symbol version so anything that previously linked aginst it
still runs, but do not allow new software to link against it.

(The compatability/legacy implementation must not be static so that
the symbol and in particular the compat sym gets@FBSD_1.0 make it
into libc.)

PR:		222796 (exp-run)
Reported by:	Paul Vixie
Reviewed by:	allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier)
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12298


Revision 331948 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 3 20:59:46 2018 UTC (4 years, 11 months ago) by cy
File length: 16943 byte(s)
Diff to previous 331943
Remove redundant check.

Reported by:	kib@
MFC after:	2 weeks
X-MFC with:	r331936
Differential Revision:	https://reviews.freebsd.org/D12785


Revision 331943 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 3 20:14:37 2018 UTC (4 years, 11 months ago) by cy
File length: 16975 byte(s)
Diff to previous 326024
Include update to stdio.h missed in r331936.

In my attempt to limit the commit in r331936 to only the gets_s()
commit and not include unrelated patches in my tree, this patch
was missed.

Reported by:	pfg
MFC after:	2 weeks
X-MFC with:	r331936
Differential Revision:	https://reviews.freebsd.org/D12785


Revision 326024 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 20 19:45:28 2017 UTC (5 years, 3 months ago) by pfg
File length: 16804 byte(s)
Diff to previous 318749
include: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


Revision 318749 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 23 16:12:50 2017 UTC (5 years, 9 months ago) by vangyzen
File length: 16760 byte(s)
Diff to previous 317595
libthr: fix warnings from GCC when WARNS=6

Fix warnings about:
- redundant declarations
- a local variable shadowing a global function (dlinfo)
- an old-style function definition (with an empty parameter list)
- a variable that is possibly used uninitialized

"make tinderbox" passes this time, except for a few unrelated
kernel failures.

Reviewed by:	kib
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D10870


Revision 317595 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 29 18:48:05 2017 UTC (5 years, 10 months ago) by pfg
File length: 16683 byte(s)
Diff to previous 312934
<stdio.h>: ftello() and fseeko() were in SUSv2, so extend visibility.

See:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/fseek.html
http://pubs.opengroup.org/onlinepubs/007908799/xsh/ftell.html

Hinted from:	DragonFlyBSD (git 58696e28)


Revision 312934 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 28 20:54:43 2017 UTC (6 years, 1 month ago) by pfg
File length: 16659 byte(s)
Diff to previous 306569
Make use of clang nullability attributes.

Replace uses of the GCC __nonnull__ attribute with the clang nullability
qualifiers. The replacement should be transparent for clang developers as
the new qualifiers will produce the same warnings and will be useful for
static checkers but will not cause aggressive optimizations.

GCC will not produce such warnings and developers will have to use
upgraded GCC ports built with the system headers from r312538.

Hinted by:	Apple's Libc-1158.20.4, Bionic libc
MFC after:	11.1 Release

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


Revision 306569 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 1 23:08:26 2016 UTC (6 years, 5 months ago) by vangyzen
File length: 16522 byte(s)
Diff to previous 306568
Add the __printflike attribute to the declaration of vdprintf(3)

I intended to add this in r306568.

MFC after:	3 days
Sponsored by:	Dell EMC


Revision 306568 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 1 22:34:38 2016 UTC (6 years, 5 months ago) by vangyzen
File length: 16503 byte(s)
Diff to previous 303683
Add the __printflike attribute to the declaration of dprintf(3)

MFC after:	3 days
Sponsored by:	Dell EMC


Revision 303683 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 2 21:55:23 2016 UTC (6 years, 7 months ago) by imp
File length: 16484 byte(s)
Diff to previous 303524
tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
we need to include it in -legacy or not. Since the ifdef was removed,
this broke building 10.x and older source trees on -current. Restore
just enough of _WITH_GETLINE to allow these older source trees to
still build and properly omit getline() from their -legacy library.


Revision 303524 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 30 01:00:16 2016 UTC (6 years, 7 months ago) by bapt
File length: 16416 byte(s)
Diff to previous 299574
Remove _WITH_GETLINE and _WITH_DPRINTF guards

When adding getline(3) and dprintf(3) into libc, those guards were added
to prevent breaking too many ports.

7 years later the ports tree have been fixed, it is time to remove this
FreeBSDism

While here remove the extra parenthesis surrounding dprintf(3)


Revision 299574 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 12 22:13:12 2016 UTC (6 years, 9 months ago) by cem
File length: 17361 byte(s)
Diff to previous 299571
stdio.h: Fix function-type typedef style and use _types.h __ssize_t

I'm still not sure why only Pypy runs into the error with the function
typedefs.  Fix it anyway.

Use __ssize_t instead of ssize_t for the types; it's possible for the size_t
type to not be visible if at the wrong POSIX_VISIBLE level.

A final (crossing my fingers) follow-up to r299456.

Sponsored by:	EMC / Isilon Storage Division


Revision 299571 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 12 21:18:17 2016 UTC (6 years, 9 months ago) by cem
File length: 17365 byte(s)
Diff to previous 299456
Pollute more places with off64_t and add __off64_t

Despite the private namespace, several broken ports depend on the __off64_t
name for the type.  Export it exactly the same way off_t and __off_t are
exported.

A follow-up to r299456.

Suggested by:	php56
Sponsored by:	EMC / Isilon Storage Division


Revision 299456 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 11 14:38:27 2016 UTC (6 years, 9 months ago) by cem
File length: 17364 byte(s)
Diff to previous 290110
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


Revision 290110 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 28 14:40:02 2015 UTC (7 years, 4 months ago) by ache
File length: 16795 byte(s)
Diff to previous 285140
Add _flags2 per jhb@ suggestion since no room left in _flags.
Rewrite O_APPEND flag checking using new __S2OAP flag.

MFC after:      3 weeks


Revision 285140 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 4 16:42:14 2015 UTC (7 years, 8 months ago) by oshogbo
File length: 16706 byte(s)
Diff to previous 278600
Add fdclose(3) function.

This function is equivalent to fclose(3) function except that it
does not close the underlying file descriptor.
fdclose(3) is step forward to make FILE structure private.

Reviewed by:	wblock, jilles, jhb, pjd
Approved by:	pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D2697


Revision 278600 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 11 22:39:13 2015 UTC (8 years ago) by bdrewery
File length: 16677 byte(s)
Diff to previous 265881
Correct and clarify comment for __SMBF.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division


Revision 265881 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 11 16:34:17 2014 UTC (8 years, 9 months ago) by jilles
File length: 16672 byte(s)
Diff to previous 265878
include: Don't expose L_cuserid in strict C standard compliance mode.

L_cuserid is supposed to be exposed only for old POSIX, or in the default
(expose everything) environment.


Revision 265878 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 11 13:48:21 2014 UTC (8 years, 9 months ago) by jilles
File length: 16651 byte(s)
Diff to previous 247411
include: Remove checks for __BSD_VISIBLE where redundant with __XSI_VISIBLE
or __POSIX_VISIBLE.

Whenever <sys/cdefs.h> sets __BSD_VISIBLE to non-zero, it also sets
__POSIX_VISIBLE and __XSI_VISIBLE to the newest version supported.

No functional change is intended.


Revision 247411 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 27 19:50:46 2013 UTC (10 years ago) by jhb
File length: 16719 byte(s)
Diff to previous 246120
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


Revision 246120 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 30 14:59:26 2013 UTC (10 years, 1 month ago) by gahr
File length: 16678 byte(s)
Diff to previous 233600
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


Revision 233600 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 28 12:11:54 2012 UTC (10 years, 11 months ago) by theraven
File length: 16610 byte(s)
Diff to previous 228924
Correctly expose xlocale functions if people include the headers in the wrong
order (as some ports apparently do).

Approved by:	dim (mentor)


Revision 228924 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 28 05:35:33 2011 UTC (11 years, 2 months ago) by delphij
File length: 16556 byte(s)
Diff to previous 228875
In POSIX.1-2008:

P_tmpdir [OB XSI]  Default directory prefix for tempnam().

This macro is used in a lot of places in legacy applications,
and is why we see a lot of programs written for e.g. Linux
store volatile temporary files in /var/tmp and not /tmp.

MFC after:	2 months


Revision 228875 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 25 16:03:54 2011 UTC (11 years, 2 months ago) by theraven
File length: 16560 byte(s)
Diff to previous 228468
Restore __is_threaded in C++ mode.  Some Google stuff needs it apparently.

Reported by:	swills
Approved by:	dim (mentor)


Revision 228468 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 13 13:32:56 2011 UTC (11 years, 2 months ago) by ed
File length: 16558 byte(s)
Diff to previous 227487
Replace __const by const in all non-contributed source code.

As C1X is close to being released, there is no need to wrap around a
feature that is already part of C90. Most of these files already use
`const' in different placed as well.


Revision 227487 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 13 16:18:48 2011 UTC (11 years, 3 months ago) by theraven
File length: 16563 byte(s)
Diff to previous 210957
The spec says that FILE must be defined in wchar.h, but it wasn't.  It
is now.  Also hide some macros in C++ mode that will break C++
namespaced calls.

Approved by:	dim (mentor)


Revision 210957 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 6 19:35:40 2010 UTC (12 years, 7 months ago) by ed
File length: 16444 byte(s)
Diff to previous 203964
Remove stale reference to UT_NAMESIZE from <stdio.h>.

Spotted by:	bde@


Revision 203964 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 16 19:39:50 2010 UTC (13 years ago) by imp
File length: 16468 byte(s)
Diff to previous 194801
Remove the Berkeley clause 3's.
Add a few $FreeBSD$


Revision 194801 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 23 23:53:35 2009 UTC (13 years, 8 months ago) by delphij
File length: 16705 byte(s)
Diff to previous 190409
Merge fmtcheck() prototype change.

Obtained from:	NetBSD


Revision 190409 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 25 08:07:52 2009 UTC (13 years, 11 months ago) by das
File length: 16707 byte(s)
Diff to previous 189818
Make programs that define a macro called `dprintf' more likely to work.


Revision 189818 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 14 19:12:11 2009 UTC (13 years, 11 months ago) by das
File length: 16705 byte(s)
Diff to previous 189356
Namespace: dprintf() and getline() are in P1003.1-2008.


Revision 189356 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 4 03:38:51 2009 UTC (14 years ago) by das
File length: 16703 byte(s)
Diff to previous 189355
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.


Revision 189355 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 4 03:35:03 2009 UTC (14 years ago) by das
File length: 16321 byte(s)
Diff to previous 189136
Add renameat to the POSIX.1-2008 namespace.


Revision 189136 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 28 06:00:58 2009 UTC (14 years ago) by das
File length: 16321 byte(s)
Diff to previous 178829
- 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@


Revision 178829 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 7 15:12:45 2008 UTC (14 years, 10 months ago) by jhb
File length: 15166 byte(s)
Diff to previous 178782
Tag FILE's _bf as being part of the public ABI as well due to the in-tree
sort(1) referencing it.


Revision 178782 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 5 16:14:02 2008 UTC (14 years, 10 months ago) by jhb
File length: 15162 byte(s)
Diff to previous 178779
Retire the __fgetcookie(), __fgetpendout(), and __fsetfileno() accessors
as we aren't hiding FILE's internals anymore.


Revision 178779 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 5 16:04:58 2008 UTC (14 years, 10 months ago) by jhb
File length: 15303 byte(s)
Diff to previous 178778
Note that FILE's __cookie is also part of the public ABI.


Revision 178778 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 5 16:03:52 2008 UTC (14 years, 10 months ago) by jhb
File length: 15299 byte(s)
Diff to previous 178755
Expose FILE's internals to the world again in all their glory.  Restore
all the previous inline optimizations as well.  FILE is back to using
__mbstate_t, struct pthread *, and struct pthread_mutex *.


Revision 178755 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 3 23:36:00 2008 UTC (14 years, 10 months ago) by marcel
File length: 9326 byte(s)
Diff to previous 178747
Unbreak build: gnu sort has been configured to grope inside struct
__sFILE. It's opaque now, so add a function that returns the pending
output bytes.

Pointy hat: jhb


Revision 178747 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 3 20:09:44 2008 UTC (14 years, 10 months ago) by marcel
File length: 9246 byte(s)
Diff to previous 178723
Unbreak build: libftpio gropes inside struct __sFILE. Implement
accessor functions for its benefit now thaat FILE is opaque.
I'm sure there's a better way. I leave that for people to work
on in a src tree that isn't broken.

Pointy hat: jhb


Revision 178723 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 2 15:59:22 2008 UTC (14 years, 10 months ago) by jhb
File length: 9185 byte(s)
Diff to previous 178722
Axe now-empty __BSD_VISIBLE block that held renameat().

Reported by:	kib
Pointy hat:	jhb


Revision 178722 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 2 15:28:23 2008 UTC (14 years, 10 months ago) by jhb
File length: 9210 byte(s)
Diff to previous 178721
- Move declaration of renameat() to the existing section of BSD_VISIBLE
  function prototypes.
- Fix a few whitespace inconsistencies in prototypes.

MFC after:	1 month


Revision 178721 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 2 15:25:07 2008 UTC (14 years, 10 months ago) by jhb
File length: 9205 byte(s)
Diff to previous 178287
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


Revision 178287 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 17 22:17:54 2008 UTC (14 years, 10 months ago) by jhb
File length: 15178 byte(s)
Diff to previous 178282
Next stage of stdio cleanup: Retire __sFILEX and merge the fields back into
__sFILE.  This was supposed to be done in 6.0.  Some notes:
- Where possible I restored the various lines to their pre-__sFILEX state.
- Retire INITEXTRA() and just initialize the wchar bits (orientation and
  mbstate) explicitly instead.  The various places that used INITEXTRA
  didn't need the locking fields or _up initialized.  (Some places needed
  _up to exist and not be off the end of a NULL or garbage pointer, but
  they didn't require it to be initialized to a specific value.)
- For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to
  avoid namespace pollution of including all the pthread types in stdio.h.
  Once we remove all the inlines and make __sFILE private it can go back
  to using pthread_t, etc.
- This does not remove any of the inlines currently and does not change
  any of the public ABI of 'FILE'.

MFC after:	1 month
Reviewed by:	peter


Revision 178282 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 17 19:06:00 2008 UTC (14 years, 10 months ago) by jhb
File length: 14991 byte(s)
Diff to previous 177791
Specifically mark the members of 'FILE' that are accessed via inline
functions or macros since they are part of the public ABI as a result.

MFC after:	1 month


Revision 177791 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 31 12:14:04 2008 UTC (14 years, 11 months ago) by kib
File length: 14770 byte(s)
Diff to previous 177653
Add the libc glue and headers definitions for the *at() syscalls.

Based on the submission by rdivacky,
	sponsored by Google Summer of Code 2007
Reviewed by:	rwatson, rdivacky
Tested by:	pho


Revision 177653 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 26 23:43:11 2008 UTC (14 years, 11 months ago) by jb
File length: 14692 byte(s)
Diff to previous 168469
Allow an application to define FOPEN_MAX (like we allow for OPEN_MAX
in sys/syslimits.h).


Revision 168469 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 7 16:02:30 2007 UTC (15 years, 11 months ago) by pjd
File length: 14667 byte(s)
Diff to previous 168397
- Remove SEEK_DATA and SEEK_HOLE from stdio.h, they don't belong here.
- Only define SEEK_DATA and SEEK_HOLE in sys/unistd.h when neither
  _POSIX_SOURCE nor _XOPEN_SOURCE is defined.

Pointed out by:	bde, ache


Revision 168397 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 5 21:10:53 2007 UTC (15 years, 11 months ago) by pjd
File length: 14851 byte(s)
Diff to previous 157960
Implement SEEK_DATA and SEEK_HOLE extensions to lseek(2) as found in
OpenSolaris. For more information please refer to:

	http://blogs.sun.com/bonwick/entry/seek_hole_and_seek_data


Revision 157960 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 22 15:10:11 2006 UTC (16 years, 10 months ago) by deischen
File length: 14667 byte(s)
Diff to previous 154867
Add a prototype for fcloseall().


Revision 154867 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 26 20:53:40 2006 UTC (17 years, 1 month ago) by stefanf
File length: 14645 byte(s)
Diff to previous 130773
Analogous to __printflike and __scanflike, add the macro __format_arg which
expands to the GCC format_arg attribute if supported.

This fixes a syntax error in <nl_types.h> for compilers/tools not
implementing the GCC __attribute__ extensions.


Revision 130773 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 20 10:01:30 2004 UTC (18 years, 8 months ago) by tjr
File length: 14805 byte(s)
Diff to previous 129774
Remove outdated comments.


Revision 129774 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 27 10:08:44 2004 UTC (18 years, 9 months ago) by tjr
File length: 14893 byte(s)
Diff to previous 127230
Bring back the macro versions of getwc(), getwchar(), putwc() and
putwchar(), but this time avoid redundantly declaring __stdinp and
__stdoutp when source files include both <stdio.h> and <wchar.h>.


Revision 127230 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 20 11:45:52 2004 UTC (18 years, 11 months ago) by tjr
File length: 14830 byte(s)
Diff to previous 127100
Parenthesize function names in masking macros for getc() etc. for the
benefit of obsolete C preprocessors.


Revision 127100 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 17 01:43:08 2004 UTC (18 years, 11 months ago) by tjr
File length: 14818 byte(s)
Diff to previous 123257
Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.


Revision 123257 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 7 21:10:06 2003 UTC (19 years, 3 months ago) by marcel
File length: 14326 byte(s)
Diff to previous 109168
Change the definition of NULL on ia64 (for LP64 compilations) from
an int constant to a long constant. This change improves consistency
in the following two ways:
1. The first 8 arguments are always passed in registers on ia64, which
   by virtue of the generated code implicitly widens ints to longs and
   allows the use of an 32-bit integral type for 64-bit arguments.
   Subsequent arguments are passed onto the memory stack, which does
   not exhibit the same behaviour and consequently do not allow this.
   In practice this means that variadic functions taking pointers
   and given NULL (without cast) work as long as the NULL is passed
   in one of the first 8 arguments. A SIGSEGV is more likely the
   result if such would be done for stack-based arguments. This is
   due to the fact that the upper 4 bytes remain undefined.
2. All 64-bit platforms that FreeBSD supports, with the obvious
   exception of ia64, allow 32-bit integral types (specifically NULL)
   when 64-bit pointers are expected in variadic functions by way of
   how the compiler generates code. As such, code that works correctly
   (whether rightfully so or not) on any platform other than ia64, may
   fail on ia64.

To more easily allow tweaking of the definition of NULL, this commit
removes the 12 definitions in the various headers and puts it in a
new header that can be included whenever NULL is to be made visible.

This commit fixes GNOME, emacs, xemacs and a whole bunch of ports
that I don't particularly care about at this time...


Revision 109168 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 13 08:41:47 2003 UTC (20 years, 1 month ago) by tjr
File length: 14339 byte(s)
Diff to previous 105098
Add prototypes for the non-standard _unlocked functions.


Revision 105098 - (view) (download) (annotate) - [select for diffs]
Modified Mon Oct 14 11:18:21 2002 UTC (20 years, 4 months ago) by tjr
File length: 14197 byte(s)
Diff to previous 104989
Use a weak reference instead of a macro to make vfscanf an alias
for __vfscanf.


Revision 104989 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 12 16:13:41 2002 UTC (20 years, 5 months ago) by mike
File length: 14502 byte(s)
Diff to previous 104941
Add restrict type-qualifier.


Revision 104941 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 11 22:38:17 2002 UTC (20 years, 5 months ago) by peter
File length: 14427 byte(s)
Diff to previous 104585
Zap the early-adopter transition aid before we get into serious
5.0-R territory, as threatened.  This only affects antique 5.0
systems that have not had a 'make world' done for well over a year.


Revision 104585 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 6 22:16:12 2002 UTC (20 years, 5 months ago) by mike
File length: 14641 byte(s)
Diff to previous 103012
o Move location of the fpos_t typedef to be closer to other typedefs.
o Add typedef for va_list.
o Add comment about missing restrict type-qualifiers.
o Move vscanf(), vsscanf() and vfscanf() to the C99-visible block.
o Add note about missing backing function for vfscanf().
o Restrict L_cuserid to only older versions of POSIX, and BSD
  namespaces.
o Conditionalize some BSD-specific foo_unlock() macros.


Revision 103012 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 6 11:24:06 2002 UTC (20 years, 6 months ago) by tjr
File length: 14115 byte(s)
Diff to previous 102227
Style: One space between "restrict" qualifier and "*".


Revision 102227 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 21 16:20:02 2002 UTC (20 years, 6 months ago) by mike
File length: 14097 byte(s)
Diff to previous 101914
o Merge <machine/ansi.h> and <machine/types.h> into a new header
  called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien


Revision 101914 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 15 10:28:52 2002 UTC (20 years, 6 months ago) by robert
File length: 14158 byte(s)
Diff to previous 101913
 - For compliance with IEEE Std 1003.1-2001, add the 'restrict'
   qualifier to function prototypes and definitions where
   appropriate using the '__restrict' macro.
 - Update the manual page.


Revision 101913 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 15 09:47:10 2002 UTC (20 years, 6 months ago) by robert
File length: 14073 byte(s)
Diff to previous 101889
 - Introduce the 'restrict' qualifier to function prototypes and
   definitions to comply with IEEE Std 1003.1-2001.
 - Update the manual pages.


Revision 101889 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 14 23:45:42 2002 UTC (20 years, 6 months ago) by robert
File length: 14003 byte(s)
Diff to previous 100133
 - Add the 'restrict' qualifier to the function definitions and
   public prototypes of setbuf(3) and setvbuf(3) using the
   '__restrict' macro from <sys/cdefs.h> to be compliant with
   IEEE Std 1003.1-2001.
 - Replace the K&R with ANSI-C function definitions.
 - Bring the manual page up-to-date.


Revision 100133 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 15 19:38:45 2002 UTC (20 years, 7 months ago) by wollman
File length: 13963 byte(s)
Diff to previous 93032
Clean up some of the rather strange structure and ordering of this
file.  Correct visibility conditions and order blocks of declarations
in order of increasing inclusiveness.  Note that [v]snprintf() is now
in ISO C and f{seek,tell}o() are now in POSIX.  Deprecated getw() and
putw() are no longer visible in XSH6 namespace (and should probably
be removed from BSD namespace as well).


Revision 93032 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 23 17:24:55 2002 UTC (20 years, 11 months ago) by imp
File length: 13687 byte(s)
Diff to previous 87379
Breath deep and take __P out of the system include files.

# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.


Revision 87379 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 5 04:16:33 2001 UTC (21 years, 3 months ago) by obrien
File length: 14164 byte(s)
Diff to previous 87369
An extra #ifdef crept in with rev 1.38.


Revision 87369 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 4 21:30:23 2001 UTC (21 years, 3 months ago) by obrien
File length: 14180 byte(s)
Diff to previous 87319
Turn back on fmtcheck's attribute checks, guarded for non-GCC compilers.

Submitted by:	bde


Revision 87319 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 4 01:24:10 2001 UTC (21 years, 3 months ago) by obrien
File length: 13988 byte(s)
Diff to previous 83712
Remove the GCC'ism "__attribute__" from the 'fmtcheck' prototype.
I leave it up to someone else to fix this breakage properly.


Revision 83712 - (view) (download) (annotate) - [select for diffs]
Modified Thu Sep 20 08:47:41 2001 UTC (21 years, 5 months ago) by peter
File length: 14024 byte(s)
Diff to previous 81600
Now that the compat4x libc.so.4 binary has been updated, we can finally
switch over to using a future-proof stdin/out/err.

Note that if you run 4.x binaries on your system, you will certainly
want to update /usr/lib/compat/libc.so.4.  The easiest way is to
add "COMPAT4X= yes" in your /etc/make.conf.


Revision 81600 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 13 21:48:44 2001 UTC (21 years, 6 months ago) by peter
File length: 14027 byte(s)
Diff to previous 75818
Rip out the old __stdin/out/err stuff. It was completely 100% useless. :-(
It was foiled because of dynamic copy relocations that caused compile-time
space to be reserved in .bss and at run time a blob of data was copied to
that space and everything used the .bss version..  The problem is that
the space is reserved at compile time, not runtime... So we *still* could
not change the size of FILE.  Sigh.  :-(

Replace it with something that does actually work and really does let us
make 'FILE' extendable.  It also happens to be the same as Linux does in
glibc, but has the slight cost of a pointer.  Note that this is the
same cost that 'fp = fopen(), fprintf(fp, ...); fclose(fp);' has.
Fortunately, actual references to stdin/out/err are not all that common
since we have implicit stdin/out/err-using versions of functions
(printf() vs. fprintf()).


Revision 75818 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 22 01:56:09 2001 UTC (21 years, 10 months ago) by obrien
File length: 13763 byte(s)
Diff to previous 75621
Style(9) fixes:
* get rid of space (0x20) before tab (^I)
* indent with ^I, not 0x20
* continuation line for prototypes is for 0x20's past function's name col.
* etc.


Revision 75621 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 17 18:16:46 2001 UTC (21 years, 10 months ago) by kris
File length: 13751 byte(s)
Diff to previous 75578
I think this was supposed to be __const like in NetBSD: I have no idea
why I changed it to const.

Noticed by:	David Wolfskill <david@catwhisker.org>


Revision 75578 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 17 07:59:52 2001 UTC (21 years, 10 months ago) by kris
File length: 13749 byte(s)
Diff to previous 73254
Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format.  If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from:  NetBSD
Reviewed by:    -arch


Revision 73254 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 1 05:22:14 2001 UTC (22 years ago) by deischen
File length: 13657 byte(s)
Diff to previous 72529
Hide the definition of struct __sFILEX and add the needed
lock definitions to it.  flockfile state is now allocated
along with the rest of FILE.  This eliminates the need for a
separate allocation of flockfile state as well as eliminating
the mutex/lock used to serialize its allocation.


Revision 72529 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 16 06:11:22 2001 UTC (22 years ago) by imp
File length: 13802 byte(s)
Diff to previous 72472
Fix the current libc breakage in current:
o Back out the __std* stuff.  Can't figure out how to do this right now,
  so we'll save it for late.
o use _up as a pointer for extra fields that we need to access.
o back out the libc major version bump.

Submitted by: green
reviewed by: peter, imp, green, obrien (to varying degrees).

We'll fix the "how do we stop encoding sizeof(FILE) in binaries" part
later.


Revision 72472 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 14 05:00:20 2001 UTC (22 years ago) by peter
File length: 13709 byte(s)
Diff to previous 72394
Commit a libc fix going by the current state of the version numbering
bikeshed in -arch.  It isn't quite over, but it has been well established
that this can be adjusted or refined.  But we do seem to have consensis
on a major bump of some sort.  After this, it should reasonably safe
to build world again.

This change is to get rid of __sF[] and use seperate __stdin/out/err
handles.  This means we can pad on extra bits onto the end of FILE
at will without going through this all over again.  __sF[] was evil
because it compiled the sizeof(FILE) into every stdio using program.

Asbestos suit on: check!
Peril sensitive sunglasses on: check!
*gulp!*


Revision 72394 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 12 03:31:23 2001 UTC (22 years ago) by peter
File length: 13662 byte(s)
Diff to previous 72391
It sounded like a good idea at the time.  The previous change breaks
FILE *buffer = stdout;
so back it out for now.


Revision 72391 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 12 02:50:30 2001 UTC (22 years ago) by peter
File length: 13729 byte(s)
Diff to previous 72372
Take advantage of the current libc sizeof(FILE) breakage (__sF[]) and
try a hopefully more robust stdin/stdout/stderr.  This costs an indirect
pointer fetch, but saves us from changes in 'FILE'.  The __stdin stuff
is there to not pollute application name space if the application does
not use <stdio.h> and also in case something depended on the current
behavior where stdin etc was a #define.

Reviewed by:	eischen, dillon


Revision 72372 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 11 22:04:18 2001 UTC (22 years ago) by deischen
File length: 13662 byte(s)
Diff to previous 71580
libc MT-safety, part 2.

Add a lock to FILE and define an additional flag.


Revision 71580 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 24 13:01:47 2001 UTC (22 years, 1 month ago) by deischen
File length: 13532 byte(s)
Diff to previous 55036
Add a lock to DIR to make telldir and friends MT-safe.

Clean up stdio.h a bit and remove _THREAD_SAFE.  Some of the
usual macros getc, putc, getchar, putchar are no longer macros.

Approved by:	-arch


Revision 55036 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 23 16:33:12 1999 UTC (23 years, 2 months ago) by bde
File length: 14642 byte(s)
Diff to previous 50473
Fixed missing declaration of ctermid_r(3).


Revision 50473 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 27 23:45:13 1999 UTC (23 years, 6 months ago) by peter
File length: 14611 byte(s)
Diff to previous 43782
$Id$ -> $FreeBSD$


Revision 43782 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 8 21:32:38 1999 UTC (24 years, 1 month ago) by dt
File length: 14650 byte(s)
Diff to previous 41798
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)


Revision 41798 - (view) (download) (annotate) - [select for diffs]
Modified Mon Dec 14 19:23:16 1998 UTC (24 years, 2 months ago) by dt
File length: 14572 byte(s)
Diff to previous 37614
Make this protototype of mmap return void *, like two other copies.


Revision 37614 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 13 06:45:23 1998 UTC (24 years, 8 months ago) by bde
File length: 14574 byte(s)
Diff to previous 37489
Added macros __printflike() and __scanflike() to <sys/cdefs.h>.
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family.  err() isn't quite printf-like since its format arg can
legitimately be NULL.  syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.


Revision 37489 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 8 00:52:40 1998 UTC (24 years, 8 months ago) by peter
File length: 14445 byte(s)
Diff to previous 36981
New flag for internal stdio use to enable dynamic string allocation for
asprintf() implementation.

Obtained from: Todd Miller <Todd.Miller@courtesan.com> via OpenBSD


Revision 36981 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 14 16:04:20 1998 UTC (24 years, 8 months ago) by bde
File length: 14381 byte(s)
Diff to previous 35758
Complete the switch to using gcc-2.4 features to declare fpos_t ,
as threatened in the 4-5 year old comment.  Most of the change is
in <machine/ansi.h>; this commit just removes cruft for the strict
ANSI case.  64-bit types couldn't actually be defined using
__attribute__(()) in gcc-2.4, since attribute names in the
implementation namespace only became available in gcc-2.7.  I've
probably just broken gcc-2.6 support by using the gcc-2.7 names
unconditionally.


Revision 35758 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 5 21:59:19 1998 UTC (24 years, 10 months ago) by jb
File length: 15048 byte(s)
Diff to previous 35163
I have a long list of issues to address here, mostly related to
namespace and revision levels of ANSI and POSIX. This change only
removes the leading underscrore from the FILE locking functions
that POSIX defines.


Revision 35163 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 12 20:29:24 1998 UTC (24 years, 11 months ago) by jb
File length: 15115 byte(s)
Diff to previous 35127
Format changes in an attempt to address some of Bruce's comments
about spaces and tabs.

The externs in the static inline functions remain 'cause (a) they're
required; and (b) I can't find any gcc -W* cases where they generate
warnings.


Revision 35127 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 11 07:33:46 1998 UTC (24 years, 11 months ago) by jb
File length: 15075 byte(s)
Diff to previous 32166
Add *_unlocked() macros according to POSIX. In the _THREAD_SAFE case,
test for __isthreaded before calling the lock/unlock functions to
try to save some performance. The _THREAD_SAFE case should become the
default, but since it tests for a global variable in libc, people won't
be able to build -current on pre-3.0 systems unless the default leaves
it out. Such is life.


Revision 32166 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 1 17:07:46 1998 UTC (25 years, 2 months ago) by alex
File length: 13591 byte(s)
Diff to previous 24897
Added missing caddr_t --> void * conversions for sys/mman.h functions.

Submitted by:	bde


Revision 24897 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 13 15:50:07 1997 UTC (25 years, 11 months ago) by bde
File length: 13593 byte(s)
Diff to previous 23655
Removed nonstandard #include of <sys/types.h>.

Use _BSD_OFF_T_ instead of off_t so that we're still self-sufficent.

Copied the ftruncate/lseek()/mmap()/truncate() redeclaration hacks
from <sys/types.h> so that things depending on them don't break.


Revision 23655 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 11 11:16:27 1997 UTC (26 years ago) by peter
File length: 13065 byte(s)
Diff to previous 23260
Merge Lite2 changes
 (Just version number)


Revision 23260 - (view) (download) (annotate) - [select for diffs]
Added Sun Mar 2 13:41:23 1997 UTC (26 years ago) by ache
File length: 13065 byte(s)
Diff to previous 23037
increase L_cuserid because UT_NAMESIZE increased



This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27