Commit Graph

104 Commits

Author SHA1 Message Date
rillig f64856e518 stdio.h: remove outdated comment for vscanf
When these functions where added to stdio.h 1.72 on 2008-08-04, the
conditional included _NETBSD_SOURCE.

The additional condition was removed in stdio.h 1.99 from 2020-03-20,
but the comment was not updated.
2021-09-11 20:05:33 +00:00
rillig 0a201ba3c7 stdio.h: sync comment for struct __sFILE with reality
In stdio.h 1.1 from 1993-03-21, the struct had a member named _ub for
the ungetc buffer.  That member was repurposed in stdio.h 1.42 from
2001-12-07 in order to support wide characters.

Remove the reference to the 'WARNING above' since there is no such
warning and even when this comment was added in stdio.h 1.20 from
1998-02-02, there was none.
2021-09-11 19:05:06 +00:00
rillig fb6d4a2598 stdio.h: remove outdated comment about fpos_t
The 'fairly grotesque' from 1994-04-03 referred to the conditional
definition of the type fpos_t, using two different integer types that
both happened to be 64-bit.

When stdio was changed on 2012-01-22 to keep track of the mbstate, the
conditional type definition was removed and the comment no longer made
sense.
2021-09-11 18:38:25 +00:00
rillig 16f5958b18 stdio.h: fix typo in comment 2021-09-11 16:58:38 +00:00
rillig d27ba004df stdio.h: fix typo in comment 2021-09-11 08:34:24 +00:00
joerg af730bf1c8 Fix visibility of various C99 features, esp. for C++11. 2020-03-20 01:08:42 +00:00
mrg cefdfaf445 move P_tmpdir from "/var/tmp/" to "/tmp/".
the main effect of this is to make GCC and other libiberty using
tools use /tmp instead of /var/tmp for compiler temp files,
which can be a bottleneck on larger systems.

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


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

one can argue that setting TMPDIR would work around this, but we
want to have the effect for all users without having special setup.
2019-12-13 20:25:16 +00:00
christos ede51e408c gcc 5, my patience is waning. 2016-03-17 00:42:49 +00:00
wiz fc5db8c0e8 Put fseeko, ftello, pread, and pwrite in the POSIX 2001 namespace.
Ok christos, apb, martin
2015-03-24 07:44:52 +00:00
dholland faa5a4f036 One vscanf_l is ample. 2015-03-05 03:29:02 +00:00
christos 72566f3f96 PR/49715: Henning Petersen: Missing _*_DECLS in stdio.h around popenve. 2015-03-04 13:33:19 +00:00
christos 829f81ac73 add popenve(). 2015-01-20 17:29:00 +00:00
christos faef322439 add open_{,w}memstream 2014-10-13 00:47:03 +00:00
christos 8e2b2a8fd3 cast to LHS type and minor KNF. 2014-08-07 17:24:03 +00:00
joerg a8b7899cfa Fix use of getline and friends in C++ code. 2014-05-23 16:48:52 +00:00
kleink eead6b988e Move declarations of getdelim() and getline() from the (incorrect) ANSI C
section to POSIX-2008.  From Jarmo Jaakkola in PR standards/48788.
2014-05-19 16:04:10 +00:00
christos df2bc3e4f8 add the signal safe prototypes 2013-05-04 18:30:14 +00:00
joerg cd8f66ed62 Don't pollute the name space with the various stdio macros for C++. 2013-04-26 17:37:06 +00:00
joerg 6c5ca8f80c Add missing __BEGIN_DECLS/__END_DECLS. 2013-04-19 23:42:26 +00:00
joerg 9790c07a61 Add scanf_l and wscanf_l families. 2013-04-19 23:32:16 +00:00
joerg 2561b63430 Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.
2013-04-19 15:22:24 +00:00
joerg 58520523b5 White space 2013-04-17 09:07:32 +00:00
christos ca5a32edc2 specify size of the array to help -fmudflap 2012-04-18 19:30:15 +00:00
christos 0ed4e38b3f funopen2() 2012-03-27 15:06:01 +00:00
christos 1897181a72 From tnozaki@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@
2012-01-22 18:36:14 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
tnozaki 93b7363c93 add fmemopen(3) derrived from POSIX:2008.
libc minor bump.
2010-09-24 09:21:53 +00:00
christos 748dbd74c6 Add dprintf and vdprintf. XXX: Might ifdef it if too many things break. 2010-09-06 14:52:26 +00:00
joerg 8a601553bc Consistently use __printflike and __scanflike. 2010-02-25 18:37:12 +00:00
joerg 00711901b6 Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.
2010-01-11 20:39:29 +00:00
roy d4a3cf6a5a Add implementations for getdelim(3) and getline(3). 2009-07-13 22:19:24 +00:00
christos 9fa41d7348 add missing attributes to the remaining calls, even the ones that gcc has
builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?
2008-09-21 16:59:46 +00:00
matt e90b08472f Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.
2008-08-04 17:08:49 +00:00
christos 749de7f2a4 Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.
2008-03-13 15:40:00 +00:00
kristerw 1ef79ebc7d Do not include SSP files unless _FORTIFY_SOURCE > 0. 2007-08-02 21:49:09 +00:00
tls dc99372be9 Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3).  But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.
2007-05-30 21:14:35 +00:00
christos a12ac1f620 remove __SAFE 2007-02-02 23:00:53 +00:00
bjh21 2f3712dfa1 defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
2006-12-09 19:33:42 +00:00
christos 4ca73ce810 Don't expose _ss functions for 4.0. Requested by core. 2006-11-22 17:23:24 +00:00
christos 1e468fbf99 - flags should be unsigned short instead of short.
- add __SAFE flag, to indicate that we want async-signal-safe functionality
  only.
- add snprintf_ss, and vsnprintf_ss; these are undocumented on purpose.
2006-10-27 20:03:21 +00:00
mrg 9f88f12295 add __BEGIN_DECLS/__END_DECLS around snprintf() & vsnprintf() prototypes. 2006-05-10 21:09:45 +00:00
perry e67ad767f5 inline -> __inline for selected things (specifically, the header
file is POSIX visible and the usage isn't #ifdef _KERNEL)

Discussed with core. I may need to go farther than this but for now
compilations done with gcc -ansi (i.e. firefox) will be okay.
2005-12-27 17:21:28 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
kleink 926eae7f66 Include <sys/ansi.h> after <sys/cdefs.h>; from Neil Booth in PR lib/30072. 2005-05-25 20:45:38 +00:00
kleink 691c56aa2e Belatedly move snprintf() and vnsnprintf() into the XPG4.2/C99 section. 2005-05-25 19:35:07 +00:00
kleink 13034da908 Add restrict qualifiers to fopen()/freopen() arguments. 2005-05-25 16:01:24 +00:00
kleink fd5cb0acea A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
  fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
  uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
2005-02-09 21:35:46 +00:00
perry 19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
kleink 11f7fb5f29 Tidy up the namespace: lint -> __lint__. 2004-07-01 22:31:28 +00:00
drochner 4bf1529244 remove fgetstr() from public sight 2004-05-10 16:53:56 +00:00