Commit Graph

542 Commits

Author SHA1 Message Date
christos
eb9ea33272 don't cast malloc 2013-05-19 21:45:00 +00:00
christos
d3a4e77c47 from kre: Don't fail if we are seeking on a pipe, clear the append bit
since we always append.
2013-05-19 17:07:04 +00:00
joerg
e0ac190e1e Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
2013-05-17 12:55:56 +00:00
wiz
70daec796f Grammar. 2013-05-04 19:17:38 +00:00
christos
b5fd8f5747 _ss improvements 2013-05-04 18:35:53 +00:00
christos
a803d40076 PR/47757: Eric Radman: mktemp(3) mangles the pathname if not given an absolute
path
1. on error, gettemp() did not restore the path string
2. when emulating mktemp() it is not an error for the pattern not to represent
   a real directory structure
XXX[1]: pullup-5, pullup-6
XXX[2]: the default pattern is the simplistic <pid><X> for mktemp.
2013-04-22 20:57:36 +00:00
joerg
6353e1f897 Add new line at the end. 2013-04-22 19:33:53 +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
uwe
3d030c8904 Mark up occurence of printf() in text with .Fn 2013-01-20 11:01:17 +00:00
uwe
dd48d6e3aa In newfmt() example one level of indentation is enough. 2013-01-20 10:57:19 +00:00
uwe
ad85e477e1 Fix typo. 2013-01-19 15:25:58 +00:00
christos
42837a5b3c Add 'x' to the mode bits to specify O_EXCL, like glibc. 2012-11-15 03:50:36 +00:00
njoly
17568cd1bf Kill some extra spaces in function arguments. 2012-10-08 18:15:09 +00:00
wiz
76576e4292 Sort description of flags. 2012-07-02 20:02:43 +00:00
njoly
5b87e47d83 Consistently use major/minor for NetBSD version. 2012-06-09 22:49:18 +00:00
njoly
3956fa9ae1 Small typo. 2012-05-11 17:14:12 +00:00
christos
b66595809f The flush function makes the tests fail. So undo it for now until we decide
if the tests are wrong or the flushing is wrong.
2012-03-29 14:27:33 +00:00
christos
61a429c0b1 only provide compatibility i/o functions to the ones provided by the caller. 2012-03-28 15:21:11 +00:00
christos
de001ba2a5 - widen the internal read and write calls to match the syscalls
- add funopen2() which provides access to flush() and the wider calls.
- make use of the new flush call in fmemopen()
2012-03-27 15:05:42 +00:00
christos
d9285aa434 unsigned char portability casts 2012-03-21 14:19:15 +00:00
christos
bc3dd708b6 ansi prototype 2012-03-20 01:42:59 +00:00
christos
526d942790 - ansify, knf.
- no functional changes
2012-03-15 18:22:30 +00:00
christos
16b0f218f0 fix signature. 2012-03-15 13:23:10 +00:00
christos
504754efd0 ansi prototypes. 2012-03-15 11:46:08 +00:00
christos
c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
christos
be2404a773 remove unused variable 2012-02-17 23:58:36 +00:00
christos
f325545b10 Fix: CVE-2012-0864 fprintf() positional argument abuse.
Described in: http://www.phrack.org/issues.html?issue=67&id=9#article
Reported by Stefan Cornelius / Red Hat Security Response Team

- convert internal positional arguments bookkeeping from int to size_t
- provide overflow protection in positional argument spec
- convert loops to memset
- fix memory leaks
- limit positional argument stack offset to the number of arguments required
  by the printf to avoid coredump from va_arg() exhaustion.
2012-02-17 19:57:53 +00:00
wiz
63c79ad1c2 Bump date for previous. 2012-01-22 19:13:48 +00:00
wiz
785aa9aa57 Remove trailing whitespace. 2012-01-22 19:13:42 +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
wiz
d3d055e20b Sort SECTIONS. 2011-10-15 21:43:19 +00:00
rmind
50902a3b80 Mention POSIX conformance of some functions, when they appeared, sprinkle .Xr. 2011-10-15 21:35:49 +00:00
rmind
f62f91b1f9 - Mention that fmemopen(3) conforms POSIX-2008.
- Drop advertising clause in TNF license.
2011-10-15 21:31:27 +00:00
jruoho
b55748a5cc It is not just funopen(3) that is a BSDism. 2011-09-11 07:37:06 +00:00
jruoho
74204a5f00 .Xr for fsetpos(3), not .Fn. 2011-09-11 04:55:48 +00:00
christos
01fb81a616 fix the rest of libc mi gcc-4.5 hacks. portmasters should fix the md ones. 2011-08-17 09:53:53 +00:00
joerg
9c6b248add Set error indicator on invalid arguments. From Carsten Hey. 2011-07-22 23:12:30 +00:00
jruoho
4c0e40e4b4 Use a list for clarity, update standards, etc. 2011-07-18 05:17:16 +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
wiz
846092f009 Various minor improvements. 2011-06-27 08:21:07 +00:00
christos
e2bebf7172 * Arrange for interfaces that create new file descriptors to be able to
set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).

    - Add F_DUPFD_CLOEXEC to fcntl(2).
    - Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
    - Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
      for socket(2) and socketpair(2).
    - Add new paccept(2) syscall that takes an additional sigset_t to alter
      the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
      SOCK_NONBLOCK.
    - Add new mode character 'e' to fopen(3) and popen(3) to open pipes
      and file descriptors for close on exec.
    - Add new kqueue1(2) syscall with a new flags argument to open the
      kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.

* Fix the system calls that take socklen_t arguments to actually do so.

* Don't include userland header files (signal.h) from system header files
  (rump_syscallargs.h).

* Bump libc version for the new syscalls.
2011-06-26 16:42:39 +00:00
enami
9aed075519 - Put empty line after the local variable definition in the sample code
to improve readability.
- Remove indirection operator to clarify error condition.
2011-04-20 23:37:51 +00:00
dholland
8ba9dddb47 Eliminate dead store. From Henning Petersen in PR 42776. Doesn't change
the output .o file.
2011-03-24 02:29:33 +00:00
jnemeth
fd52cff654 vsnprintf_ss does NOT handle floating point formats 2010-12-26 12:39:54 +00:00
wiz
207ab8d006 Add punctuation. 2010-12-22 17:06:03 +00:00
christos
92a95e7ba4 document vsnprintf_ss 2010-12-22 16:59:10 +00:00
wiz
3d3c5d42cb Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
2010-12-16 17:42:25 +00:00
joerg
3b7d8067b3 Don't redeclare __isthreaded. 2010-12-08 02:07:03 +00:00
christos
b0f3f04a67 PR/44113: Nicolas Joly: printf(3) should ignore zero padding for nan/inf 2010-11-19 00:44:18 +00:00