summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* posix_fadvise(2) first appeared in FreeBSD 9.1glebius2013-01-231-1/+1
|
* Note that SIGCHLD is special and if ignored, won't be recorded by the filter.pjd2013-01-211-2/+4
|
* Add the required __aeabi_* functions to libc.andrew2013-01-197-0/+361
| | | | | The floating point functions are here rather than compiler-rt because the libc softfloat code allows us to set the rounding mode.
* Use the compiler-rt version __{u,}divsi3 and __{u,}modsi3 on ARM EABIandrew2013-01-194-5/+27
|
* Update the syscall calling convention for ARM EABI. We store the syscallandrew2013-01-191-0/+8
| | | | | | in r7 and use ip to store the old version of r7 as it is not guaranteed to be kept when calling a subroutine. The kernel will preserve the register across system calls.
* For ARM EABI we only need a subset of the quad functions, the rest areandrew2013-01-191-0/+4
| | | | provided by libgcc.
* - Use standard RETURN VALUES section.zont2013-01-151-6/+2
| | | | | Approved by: kib (mentor) MFC after: 1 week
* Add contrib/libc-vis to the include path so we reliably pick up the rightbrooks2013-01-111-0/+1
| | | | | | version of vis.h. Reported by: dim
* In r244401 I accidently moved strunvis and strunvisx from version 1.0 tobrooks2013-01-111-2/+2
| | | | | 1.3 breaking the libc ABI. Revert that change (breaking the ABI again for users who updated after December 18th).
* Re-enable ip6addrctl support but only for IPv6 address.ume2013-01-101-7/+5
| | | | | Requested by: Ben Morrow <ben__at__morrow.me.uk> MFC after: 1 week
* Disable destination address selection support ofume2013-01-091-0/+8
| | | | | | | | getipnodebyname(1). RFC 2553 mentions IPv6 addresses are returned 1st. Spotted by: uqs MFC after: 1 week
* Silence a clang warning by telling it we are only interested in leftandrew2013-01-061-1/+1
| | | | shifting the lower 32bits of the floating point value when we demangle it.
* Add derived versions for common Simplified Chinese encodings.delphij2012-12-283-0/+596
| | | | MFC after: 2 weeks
* Add zh_CN.UTF-8 catalog.delphij2012-12-282-0/+296
| | | | | Reviewed by: alphachi <alphachi mediaspirit.org> MFC after: 2 weeks
* - Update manual pages accordingly to r244384 and r244385.zont2012-12-252-9/+25
| | | | | Approved by: kib (mentor) MFC after: 1 week
* - Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to storedelphij2012-12-211-8/+4
| | | | | | | | | | path longer than this. - Fix an unreached case of check against sizeof buf, which in turn leads to an off-by-one nul byte write on the stack. The original condition can never be satisfied because the passed boundary is the maximum value that can be returned, so code was harmless. MFC after: 1 month
* Replace our implementation of the vis(3) and unvis(3) APIs withbrooks2012-12-187-1007/+65
| | | | | | | | | NetBSD's. This output size limited versions of vis and unvis functions as well as a set of vis variants that allow arbitrary characters to be specified for encoding. Finally, MIME Quoted-Printable encoding as described in RFC 2045 is supported.
* Fix warning from valgrind when a failed entry is tested.eadler2012-12-171-0/+1
| | | | | | | | PR: kern/173008 Submitted by: Zhihao Yuan <lichray@gmail.com> Reviewed by: gabor Approved by: cperciva (implicit) MFC after: 1 week
* libc/iconv: Fix race condition with setting FD_CLOEXEC.jilles2012-12-171-5/+1
| | | | | | | | | A fork/exec could happen between open and fcntl, leaking a file descriptor. Using O_CLOEXEC fixes this and as a side effect simplifies the code. NetBSD already had this (I checked this after making the change myself). Reviewed by: gabor
* Eliminate redundant variable.pjd2012-12-121-6/+3
|
* libc: Make various internal file descriptors close-on-exec.jilles2012-12-112-2/+2
| | | | These are obtained via fopen().
* libc: Make various internal file descriptors close-on-exec.jilles2012-12-107-12/+12
| | | | These are obtained via fopen().
* Improve style(9) compliance of function declarations.brooks2012-12-101-4/+12
|
* Document that socket(2) may fail with EAFNOSUPPORT if the family cannotkevlo2012-12-071-7/+12
| | | | | | | be found. Reviewed by: glebius Obtained from: NetBSD
* libc: Use the new 'e' fopen() mode option to simplify fstab.c.jilles2012-12-041-11/+1
| | | | No functional change is intended.
* Document that bind(2) can fail with EAFNOSUPPORT.kevlo2012-12-041-0/+2
| | | | Reviewed by: glebius
* Protect against DoS attacks, such as being described in CVE-2010-2632.marcel2012-12-011-22/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc
* In globextend(), take advantage of the fact that realloc(NULL, size) ismarcel2012-12-011-3/+2
| | | | | | equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time.
* In globextend() when the pathv vector cannot be (re-)allocated, don'tmarcel2012-12-011-6/+1
| | | | | | | | | | | | | | free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not.
* The getline function returns the number of characters read, noteadler2012-12-011-2/+2
| | | | | | | | | written. Use clearer text for this. PR: docs/174023 Submitted by: Paul Procacci <pprocacci@gmail.com> Approved by: bcr (mentor) MFC after: 1 week
* libc: Allow setting close-on-exec in fopen/freopen/fdopen.jilles2012-11-304-2/+33
| | | | | | | | | | | | | | | | | | | This commit adds a new mode option 'e' that must follow any 'b', '+' and/or 'x' options. C11 is clear about the 'x' needing to follow 'b' and/or '+' and that is what we implement; therefore, require a strict position for 'e' as well. For freopen() with a non-NULL path argument and fopen(), the close-on-exec flag is set iff the 'e' mode option is specified. For freopen() with a NULL path argument and fdopen(), the close-on-exec flag is turned on if the 'e' mode option is specified and remains unchanged otherwise. Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC) and fdopen(), this needlessly complicates the calling code. Apart from the ordering requirement, the new option matches glibc. PR: kern/169320
* Document that getpeername(2) and getsockname(2) can fail with EINVAL.kevlo2012-11-232-0/+8
| | | | Reviewed by: glebius
* Cleanup the code a bit, which improves the portability.tuexen2012-11-191-43/+42
| | | | MFC after: 1 week
* Fix the handling of mapped IPv6 addresses in sctp_connectx().tuexen2012-11-191-1/+0
| | | | MFC after: 3 days
* - the preferred way to write a NULL pointer constant is with NULLkevlo2012-11-163-9/+6
| | | | | | - whitespace nit Reviewed by: glebius
* mdoc: Use the Ev macro for environmental variables.joel2012-11-161-3/+3
|
* Document that rtprio(2) and rtprio_thread(2) can fail with EFAULTkevlo2012-11-161-2/+10
| | | | | | due to the invoked copyout(9). Reviewed by: davidxu
* Complete man page.grog2012-11-161-11/+27
| | | | MFC after: 2 weeks
* Document that sendfile(2) can fail with ENOBUFS.kevlo2012-11-141-0/+2
| | | | Reviewed by: glebius
* Document wait6() and waitid().kib2012-11-132-32/+282
| | | | | | PR: standards/170346 Submitted by: "Jukka A. Ukkonen" <jau@iki.fi> MFC after: 1 month
* Implement the waitid() SUSv4 function using wait6() system call.kib2012-11-136-1/+72
| | | | | | PR: standards/170346 Submitted by: "Jukka A. Ukkonen" <jau@iki.fi> MFC after: 1 month
* Add an explanatory comment to lib/libc/gen/isnan.c about the fix to makedim2012-11-111-0/+5
| | | | | | | | static linking with libc and libm work. Requested by: jilles MFC after: 1 week X-MFC-With: 242879
* Only define isnan, isnanf, __isnan and __isnanf in libc.so, not indim2012-11-101-0/+2
| | | | | | | | | | | libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC after: 1 week
* Clarify that the ' flag is an apostrophe.grog2012-11-081-1/+1
| | | | MFC after: 2 weeks
* Fix errno in a couple of error cases.tuexen2012-11-031-1/+3
| | | | MFC after: 3 days
* fopen(3): Mention that the "x" mode option is from C11.jilles2012-11-011-1/+5
| | | | MFC after: 1 week
* fcntl(2): Fix typos in name of constant "F_DUP2FD_CLOEXEC".jilles2012-11-011-2/+2
| | | | MFC after: 1 week
* Update the kill(2) and killpg(2) man pages to the modern permissioneadler2012-10-222-16/+20
| | | | | | | | | checks. Also indicate killpg(2) is POSIX compliant. Reviewed by: jilles Reviewed by: wblock Approved by: cperciva MFC after: 3 days
* remove duplicate semicolons where possible.eadler2012-10-221-1/+1
| | | | | Approved by: cperciva MFC after: 1 week
* Grammar fixes to r241781.andre2012-10-201-1/+1
| | | | Submitted by: alc
OpenPOWER on IntegriCloud