summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* mdoc: add missing El.joel2013-02-271-0/+1
|
* Add an implementation of open_memstream() and open_wmemstream(). Thesejhb2013-02-275-1/+639
| | | | | | | | | 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
* libc/opendir: Improve behaviour of union uniquifier:jilles2013-02-241-25/+26
| | | | | | | | | * Reopen the directory using openat(fd, ".", ...) instead of opening the pathname again. This fixes a race condition where the meaning of the pathname changes and allows a reopen with fdopendir(). * Always reopen the directory for union stacks, not only when DTF_REWIND is passed. Applications should be able to fchdir(dirfd(dir)) and *at(dirfd(dir), ...). DTF_REWIND now does nothing.
* Now that qsort(3) has a sample comparison function, point to thatkeramida2013-02-231-1/+7
| | | | | | | | | | example from bsearch(3) too, so that we don't have to duplicate the example code in both places. PR: docs/176197 Reviewed by: stefanf Approved by: remko (mentor), gjb (mentor) MFC after: 1 week
* Sort sections.joel2013-02-201-6/+6
|
* Various improvements to the qsort(3) usage example:keramida2013-02-201-14/+8
| | | | | | | | | | | | | | | - Remove unused #include. - Do not cast away const. - Use the canonical idiom to compare two numbers. - Use proper type for sizes, i.e. size_t instead of int. - Correct indentation. - Simplify printf("\n") to puts(""). - Use return instead of exit() in main(). Submitted by: Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor) Reviewed by: stefanf MFC after: 1 week
* Add a sample program that shows how a custom comparison function andkeramida2013-02-191-1/+47
| | | | | | | | | qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Approved by: gjb (mentor) MFC after: 1 week
* setbuf(3): Restore a BUGS section about setbuf().jilles2013-02-181-1/+4
| | | | | | | The brokenness of setbuf() is not specific to 4.2BSD and 4.3BSD but inherent in the API definition. Reported by: bde
* Make more code be protected by internal mutex, and now it is fork-safe, indavidxu2013-02-171-2/+2
| | | | | error case, the file exclusive lock is now released as soon as possible, in previous code, child process can still hold the exclusive lock.
* Put one file per line so it is easier to read diffs against those files.pjd2013-02-162-184/+653
|
* Simplify code by using flag O_EXLOCK.davidxu2013-02-161-9/+3
| | | | PR: kern/175674
* setbuf(3): Remove bugs section about ancient versions of BSD.jilles2013-02-151-17/+1
|
* Change examples to be consistent with what style(9) says.zeising2013-02-142-8/+8
| | | | | Approved by: joel (mentor) MFC After: 2 weeks
* Add strchrnul(), a GNU function similar to strchr(), except that it returnszeising2013-02-134-5/+81
| | | | | | | a pointer to the end of the string, rather than NULL, if the character was not found. Approved by: theraven
* Make the F_READAHEAD option to fcntl(2) work as documented: a value of zeroian2013-02-131-2/+2
| | | | | | | | now disables read-ahead. It used to effectively restore the system default readahead hueristic if it had been changed; a negative value now restores the default. Reviewed by: kib
* When clang builds libc it may insert calls to __aeabi_* functions. Normallyandrew2013-02-121-0/+19
| | | | | | | | | | this is not a problem as they are resolved by libgcc. The exception is for the __aeabi_mem* functions. These call back into libc to the appropriate function. This causes issues for static binaries as we only link against libc once so there is no way for it to call into libgcc and back. The fix for this is to include these symbols in libc but keep them hidden so binaries use the libgcc version.
* fts: Use O_DIRECTORY when opening name that might be changed by attacker.jilles2013-02-101-1/+2
| | | | | | | | There are uncommon cases where fts_safe_changedir() may be called with a non-NULL name that is not "..". Do not block or worse if an attacker put (a (symlink to) a fifo or device where a directory used to be. MFC after: 1 week
* Improve code style. No functional change.tuexen2013-02-101-7/+7
| | | | MFC after: 3 days
* sigqueue(2): Fix typo (EEPERM -> EPERM).jilles2013-02-101-1/+1
| | | | MFC after: 3 days
* Fix logic inversion.eadler2013-02-091-1/+1
| | | | | | PR: docs/174966 Submitted by: Christian Ullrich <chris+freebsd@chrullrich.net> Approved by: bcr (mentor)
* mdoc: Remove EOL whitespace.joel2013-02-091-1/+1
|
* Document the detail of interaction between vfork and PT_TRACEME.kib2013-02-071-1/+11
| | | | MFC after: 2 weeks
* Document the ERESTART translation to EINTR for devfs nodes.kib2013-02-071-1/+12
| | | | | Based on the submission by: jilles MFC after: 2 weeks
* - Fix more style(9)-related issues (copyright header, spaces after functiongahr2013-02-011-56/+55
| | | | | | | | | names, unnecessary casts) - Change type of boolean variable from char to bool Suggested by: jhb, zont, jmallett Reviewed by: cognet Approved by: cognet
* - Remove underscores from the internal structure name, as it doesn't collidegahr2013-01-312-32/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the user's namespace. - Correct size and position variables type from long to size_t. - Do not set errno to ENOMEM on malloc failure, as malloc already does so. - Implement the concept of "buffer data length", which mandates what SEEK_END refers to and the allowed extent for a read. - Use NULL as read-callback if the buffer is opened in write-only mode. Conversely, use NULL as write-callback when opened in read-only mode. - Implement the handling of the ``b'' character in the mode argument. A binary buffer differs from a text buffer (default mode if ``b'' is omitted) in that NULL bytes are never appended to writes and that the "buffer data length" equals to the size of the buffer. - Remove shall from the man page. Use indicative instead. Also, specify that the ``b'' flag does not conform with POSIX but is supported by glibc. - Update the regression test so that the ``b'' functionality and the "buffer data length" concepts are tested. - Minor style(9) corrections. Suggested by: jilles Reviewed by: cognet Approved by: cognet
* Add fmemopen(3), an interface to get a FILE * from a buffer in memory, alonggahr2013-01-304-7/+224
| | | | | | | | with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet
* Rework the __vdso_* symbols attributes to only make the symbols weak,kib2013-01-3016-5/+325
| | | | | | | | | | but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks
* 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
|
OpenPOWER on IntegriCloud