summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Renumber clauses to reduce diffs to other versionsemaste2013-05-28100-100/+100
| | | | | NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier.
* Remove the advertising clause from the Regents of the University ofemaste2013-05-2810-50/+10
| | | | California's license, per the letter dated July 22, 1999.
* The getcontext() from the __fillcontextx() call in thekib2013-05-289-6/+69
| | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week
* cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).jilles2013-05-271-1/+3
|
* Make the malloc(3) family of functions weak and make their non-weakmarcel2013-05-251-0/+11
| | | | | | | | | | | | | | implementations visible for use by applications. The functions $F that are now weak symbols are: allocm, calloc, dallocm, free, malloc, malloc_usable_size, nallocm, posix_memalign, rallocm, realloc, sallocm The non-weak implementations of $F are exported as __$F. Submitted by: stevek@juniper.net Reviewed by: jasone@, kib@ Approved by: jasone@ (jemalloc) Obtained from: juniper Networks, Inc
* sigreturn(2): Remove ancient compatibility warning about 4.2BSD.jilles2013-05-251-4/+0
| | | | The HISTORY subsection still says that sigreturn() was added in 4.3BSD.
* Make some tiny improvements to iconv_open().ed2013-05-251-21/+15
| | | | | | | | | - Remove an unneeded variable. - Fix whitespace bugs. - Fix typoes in comment. - Improve string handling a bit. Don't handroll strstr() and don't terminate a strdup()'ed string. Instead, simply strndup() the part we need.
* Only call free() on something we allocated.ed2013-05-251-2/+2
| | | | | | | If we were already provided a struct _citrus_iconv (e.g. through iconv_open_into()), we should not call free() in case io_init_context() fails. Instead, call it on the pointer of the allocated object, which will be NULL in case of iconv_open_into().
* Let iconv build on -HEAD properly.ed2013-05-233-0/+3
| | | | | | - Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex. - Add variable declarations where possible. - Add missing static keyword.
* Update manpages for r250887.ed2013-05-213-9/+3
| | | | | | Remove the lists of unneeded header files. Requested by: eadler
* Add <uchar.h>.ed2013-05-219-52/+410
| | | | | | | | | | | | The <uchar.h> header, part of C11, adds a small number of utility functions for 16/32-bit "universal" characters, which may or may not be UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight wrappers around wcrtomb() and mbrtowc(). While there, also add (non-yet-standard) _l functions, similar to the ones we already have for the other locale-dependent functions. Reviewed by: theraven
* Update the setfib man page to reflect recent changes.julian2013-05-201-3/+6
|
* popen(): Add 'e' mode character to set close-on-exec on the new fd.jilles2013-05-202-10/+27
| | | | | | | | | | | | | | If 'e' is used, the kernel must support the recently added pipe2() system call. The use of pipe2() with O_CLOEXEC also fixes race conditions between concurrent popen() calls from different threads, even if the close-on-exec flag on the fd of the returned FILE is later cleared (because popen() closes all file descriptors from earlier popen() calls in the child process). Therefore, this approach should be used in all cases when pipe2() can be assumed present. The old version of popen() rejects "re" and "we" but treats "r+e" like "r+".
* Fix a typo: It should be "strtoll" and not "stroll".hiren2013-05-141-3/+3
| | | | | | | PR: 178642 Reported by: Michael Galassi (michaelgalassi@gmail.com) Approved by: sbruno (mentor) MFC after: 1 week
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* Typo.pluknet2013-05-121-1/+1
|
* posix_spawn_file_actions_adddup2(3): Document difference with dup2().jilles2013-05-091-2/+23
| | | | | | | | The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. MFC after: 1 week
* posix_spawn_file_actions_addopen(3): Correct error for bad file descriptor.jilles2013-05-091-2/+2
| | | | | | | | As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file descriptor is negative, not [EINVAL]. The bug was only in the manual page; the code is correct. MFC after: 1 week
* wordexp(): Simplify code by deferring work to sh.jilles2013-05-091-13/+3
|
* POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos.pluknet2013-05-043-1/+11
|
* Document that the return type is different from 1003.1-2008.pluknet2013-05-041-2/+9
| | | | MFC after: 1 week
* mdoc: missing comma in .Dd macro.pluknet2013-05-045-5/+5
|
* Add entry for errno ECAPMODE.pluknet2013-05-041-0/+2
| | | | MFC after: 3 days
* Improve compatibility with recent flex from flex.sourceforge.net.jkim2013-05-031-3/+2
|
* Also, add a missing period.pluknet2013-05-033-3/+3
|
* Remove an extra comma.pluknet2013-05-033-3/+3
|
* Remove the STANDARDS section.pluknet2013-05-031-4/+1
| | | | | | querylocale is not part of IEEE Std 1003.1-2008. MFC after: 3 days
* accept(2), pipe(2): Fix .Dd.jilles2013-05-012-2/+2
|
* Add pipe2() system call.jilles2013-05-013-2/+46
| | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib
* Add accept4() system call.jilles2013-05-013-3/+46
| | | | | | | | | | | | | | | The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode.
* intro(2): Fix some errors in ENFILE and EMFILE descriptions.jilles2013-04-271-5/+6
| | | | MFC after: 1 week
* sysconf(3): Correct the description of _SC_OPEN_MAX.jilles2013-04-261-2/+2
| | | | | Reported by: bde MFC after: 1 week
* getdtablesize(2): Describe what this function actually does.jilles2013-04-241-9/+11
| | | | | | | getdtablesize() returns the limit on new file descriptors; this says nothing about existing descriptors. MFC after: 1 week
* Convert libc/stdio from K&R to ANSI Cemaste2013-04-2334-151/+53
| | | | And add '__restrict' where it appeared in the header prototypes
* Renumber clauses to reduce diffs to other versionsemaste2013-04-2370-70/+70
| | | | | | | NetBSD, OpenBSD, and Android's Bionic all number the clauses 1 through 3, so follow suit to make comparison easier. Acked-by: imp@
* - sl_find does not modify 'name'eadler2013-04-232-2/+2
| | | | | | | | - make the prototype of sl_find match NetBSD Reviewed by: jilles Approved by: cperciva (mentor) MFC After: 3 days
* Switch from K&R prototypes to modern Ceadler2013-04-231-10/+4
| | | | | | Reviewed by: jilles Approved by: cperciva (mentor) MFC After: 3 days
* Keep up with negative addrlen check removal in r249649.pluknet2013-04-221-5/+1
|
* dup(2): Remove incorrect sentence about getdtablesize().jilles2013-04-211-4/+1
| | | | | | | | | There are no getdtablesize() bounds on the file descriptor to be duplicated; it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after opening the file descriptor, it may be greater than or equal to getdtablesize() but still valid. MFC after: 1 week
* Add example.joel2013-04-211-1/+42
| | | | | | PR: 177025 Submitted by: Fernando <fernando.apesteguia@gmail.com> Reviewed by: theraven
* Remove cross-references to nonexistent CPU_SET(3) manpage.joel2013-04-212-4/+2
| | | | | | | Also fix cpu_getaffinity(2) document title. PR: 176317 Submitted by: brucec
* pututxline: Don't set errno=0 in subfunctions.jilles2013-04-171-4/+8
| | | | | | | | | | The functions utx_active_add(), utx_active_remove(), utx_lastlogin_add() and utx_log_add() set errno to 0 if they are successful. This not only violates POSIX if pututxline() is successful, but may also overwrite a valid error with 0 if, for example, utx_lastlogin_add() fails while utx_log_add() succeeds. Reviewed by: ed
* - Correct mispellings of the word occurrencegabor2013-04-174-6/+6
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* mdoc: remove superfluous paragraph macro.joel2013-04-161-1/+0
|
* - Document that sem_wait() can fail with EINTR if it is interrupted by ajhb2013-04-161-1/+9
| | | | | | | | signal. - Fix the old ksem implementation for POSIX semaphores to not restart sem_wait() or sem_timedwait() if interrupted by a signal. MFC after: 1 week
* libc: Fix typo in French translation.jilles2013-04-141-1/+1
| | | | | | PR: kern/177704 Submitted by: martymac MFC after: 1 week
* Spelling correctionemaste2013-04-112-2/+2
|
* Remove unused atomic headeremaste2013-04-111-1/+0
|
* Remove the number of addresses restriction from sctp_connectx().tuexen2013-04-101-202/+94
| | | | | | | Remove unused code. While there, do some cleanup of the code. MFC after: 1 week
* Correct the returned message lengths for timeval and bintime controlgnn2013-04-051-3/+3
| | | | | | messages (SO_BINTIME, SO_TIMEVAL). Obtained from: phk
OpenPOWER on IntegriCloud