summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Only set _w to 0 when the file stream is not currently reading. Withouteadler2012-05-301-1/+1
| | | | | | | | | | this fflush may fail to write data in the buffer. PR: kern/137819 Submitted by: Eric Blake <ebb9@byu.net> Reviewed by: theraven Approved by: cperciva MFC after: 2 weeks
* Clarify the SEEK_HOLE description, it repositions the file pointer.kib2012-05-261-4/+4
| | | | MFC after: 3 days
* Doh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to themarcel2012-05-251-1/+4
| | | | | | current one (= FBSD_1.3). Pointed out by: kib
* Allow building for the PowerPC EABI by providing a dummy __eabi()marcel2012-05-243-1/+35
| | | | | | | function. The purpose of the __eabi() function is to set up the runtime and is called first thing by main(). The runtime is already set up for us prior to caling main, so there's nothing to do for us in the EABI case.
* Add two new locale-specific man pages:issyl02012-05-233-1/+157
| | | | | | | | | - libc/stdio/scanf_l.3 - libc/stdio/printf_l.3 Reviewed by: theraven Approved by: gabor (mentor) MFC after: 5 days
* Update copyright date.tuexen2012-05-231-2/+3
| | | | MFC after: 3 days
* Add missing header needed by free()kevlo2012-05-221-0/+1
| | | | Reported by: tinderbox
* Add checks for memory allocation failures in appropriate places, andghelmer2012-05-211-12/+27
| | | | | | | | avoid creating bad entries in the grp list as a result of memory allocation failures while building new entries. PR: bin/83340 Reviewed by: delphij (prior version of patch)
* Apply style(9) to return and switch/case statements.ghelmer2012-05-211-19/+22
| | | | Reviewed by: delphij (prior version of the patch)
* Disable NLS catalog use in libc if built with WITHOUT_NLS option.gleb2012-05-211-0/+2
| | | | Functions affected: strerror, strsignal, gai_strerror.
* Don't link against libssp if MK_SSP is set to no.marcel2012-05-191-1/+5
| | | | Note that this still misses a proper dependency at this time.
* Put my name as copyright owner of lib/libc/gen/dirfd.c added in r235647.gleb2012-05-191-7/+4
| | | | Requested by: kib@
* Hide DIR definition by making it an opaque struct typedef.gleb2012-05-1913-7/+127
| | | | | | | | | | Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011
* Use the LLINDEX macro to access the link-level I/F index. This makesmarcel2012-05-194-4/+4
| | | | | | | it possible to work with a different type for the sdl_index field -- it only requires a recompile. Obtained from: Juniper Networks, Inc.
* mdoc: avoid unterminated quoted strings.joel2012-05-131-5/+5
|
* Minor mdoc nits.joel2012-05-131-1/+1
|
* Minor mdoc nits.joel2012-05-122-4/+4
|
* Remove tab from kernel configuration option. This is consistent with the restjoel2012-05-121-1/+1
| | | | of our manual pages.
* mdoc: end list context with El.joel2012-05-121-0/+1
|
* General mdoc(7) and typo fixes.gjb2012-05-1114-20/+21
| | | | | | PR: 167734 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days
* According to SUSv4, realpath(3) must fail ifkib2012-05-112-12/+29
| | | | | | | | | | | | | | | | | [ENOENT] A component of file_name does not name an existing file or file_name points to an empty string. [ENOTDIR] A component of the path prefix is not a directory, or the file_name argument contains at least one non- <slash> character and ends with one or more trailing <slash> characters and the last pathname component names an existing file that is neither a directory nor a symbolic link to a directory. Add checks for the listed conditions, and set errno accordingly. Update the realpath(3) manpage to mention SUS behaviour. Remove the requirement to include sys/param.h before stdlib.h. PR: 128933 MFC after: 3 weeks
* Fix copy/paste error in lib/libc/locale/toupper.c.dim2012-05-101-1/+1
| | | | Submitted by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
* Remove reference to non-existent FreeBSD Security Architectureeadler2012-05-091-3/+1
| | | | | Approved by: cperciva MFC after: 3 days
* Plug a leak.kib2012-05-081-2/+5
| | | | | Submitted by: Greg Bednarek <gbednarek averesystems com> MFC after: 1 week
* General mdoc(7) and typo fixes.gjb2012-05-0813-17/+20
| | | | | PR: 167713 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org)
* Remove debug output.tuexen2012-05-041-1/+0
| | | | MFC after: 3 days
* Remove incorrect __restrict qualifier on several pointersdumbbell2012-04-302-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The typical case was: static __inline int convert_ccl(FILE *fp, char * __restrict p, [...]) { [...] if (p == SUPPRESS_PTR) { [...] } else { [...] } [...] } This qualifier says that the pointer is the only one at that time pointing to the resource. Here, clang considers that "p" will never match "SUPPRESS_PTR" and optimize the if{} block out. This leads to segfaults in programs calling vfscanf(3) and vfwscanf(3) with just the format string (no arguments following it). The following softwares were reported to abort with segmentation fault and this patch fixes it: o cmake o smartd o devel/ORBit2 dim@ opened an LLVM PR to discuss this clang optimization: http://llvm.org/bugs/show_bug.cgi?id=12656 Tested by: bsam@
* fix a further typo in the pdfork(2) man page.rwatson2012-04-301-1/+1
| | | | | Submitted by: Norman Hardy MFC after: 3 days
* The returned file descriptor from pdfork(2) is via fdp, not pidp.rwatson2012-04-301-2/+2
| | | | | Submitted by: Norman Hardy MFC after: 3 days
* Fix a bug in *wscanf's handling of non-wide %s, %c, and %[das2012-04-301-44/+9
| | | | | | | | | | | | | conversions. Both the specification and the documentation say the width is interpreted as the max number of wide characters to read, but the implementation was interpreting it as the number of bytes to convert. (See also r105317.) This change has security implications for any applications that depend on the buggy behavior, but the impact in practice is probably nil. Any such application would already be buggy on other platforms that get the semantics right. Also, these conversions are rarely used; %ls, %lc, and %l[ are more appropriate.
* pread(2) might fail with EBUSY, so document iteadler2012-04-291-0/+2
| | | | | | | PR: docs/167201 Submitted by: Kurt Jaeger <fbsd-ports@opsec.eu> Approved by: cperciva MFC after: 3 days
* Allow users of gprof to get per run output files (using the pid)eadler2012-04-292-1/+12
| | | | | | | | | PR: bin/99800 Submitted by: Peter Jeremy <peterjeremy@optushome.com.au> Reviewed by: jilles (code) Reviewed by: dwhite (doc) Approved by: cperciva MFC after: 1 week
* Previously, vfscanf()'s wide character processing functions weredas2012-04-293-150/+83
| | | | | | | | | | | | | | | reading wide characters manually. With this change, they now use fgetwc(). To make this work, we use an internal version of fgetwc() with a few extensions: it takes an mbstate * because non-wide streams don't have a built-in mbstate, and it indicates the number of bytes read. vfscanf() now resembles vfwscanf() more closely. Minor functional improvements include working xlocale support in vfscanf(), setting the stream error indicator on encoding errors, and proper handling of shift-based encodings. (Actually, making shift-based encodings work with non-wide streams is hopeless, but the implementation now matches the broken specification.)
* Fix small documentation mistakes.jlh2012-04-281-1/+1
| | | | | Submitted by: brueffer Approved by: kib (mentor)
* Import stdbuf(1) and the shared library it relies on.jlh2012-04-281-0/+4
| | | | | | | | | | | | | | This tool changes the default buffering behaviour of standard stdio streams. It only works on dynamic binaries. To make it work for static ones it would require cluttering stdio because there no single entry point. PR: 166660 Reviewed by: current@, jhb Approved by: kib (mentor) MFC after: 1 week
* Fix several memory and lock leaks on the out of memory condition.kib2012-04-282-2/+22
| | | | | Reported by: Matt Miller <matt matthewjmiller net> MFC after: 1 week
* Move sctp_sendv and sctp_recvv to FBSD_1.3 as suggested bytuexen2012-04-261-2/+5
| | | | | | | Konstantin Belousov. MFC after: 1 week. X-MFC with: r234715
* Export symbols for sctp_sendv() and sctp_recvv().tuexen2012-04-261-0/+2
| | | | MFC after: 1 week
* Use the .Bx macro instead of BSDeadler2012-04-261-1/+3
| | | | | | | Submitted by: ru Approved by: ru MFC after: 3 days X-MFC-With: r234700
* A new jail(8) with a configuration file, ultimately to replace the workjamie2012-04-261-39/+1
|\ | | | | | | | | | | currently done by /etc/rc.d/jail. MFC after: 3 months
| * Remove a section that went to jail(8), and fix a small grammar error.jamie2010-10-201-39/+1
| |
| * Import section 2 man files so I can update jail(2).jamie2010-10-20192-0/+34710
| |\
| * | A new jail(8) with a configuration file, to replace the work currently donejamie2010-10-191949-350043/+0
| | | | | | | | | | | | by /etc/rc.d/jail.
* | | Document the standardization status of err* and warn*eadler2012-04-261-1/+11
| | | | | | | | | | | | | | | | | | | | | PR: docs/164939 Submitted by: Niclas Zeising <zeising@daemonic.se> Approved by: bcr MFC after: 3 days
* | | Take the spinlock around clearing of the fp->_flags in fclose(3), whichkib2012-04-243-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | indicates the avaliability of FILE, to prevent possible reordering of the writes as seen by other CPUs. Reported by: Fengwei yin <yfw.bsd gmail com> Reviewed by: jhb MFC after: 1 week
* | | Bugfix: Include whitespace characters in the count of the number ofdas2012-04-221-1/+1
| | | | | | | | | | | | characters read.
* | | Bugfix: Correctly count the number of characters read for %l[ conversions.das2012-04-221-7/+4
| | |
* | | Bugfix: %n doesn't count as a conversion, sodas2012-04-222-2/+0
| | | | | | | | | | | | sscanf("abc", "ab%ncd", &i) returns EOF, not 0.
* | | Refactor scanf to improve modularity. Conversions are now performeddas2012-04-222-668/+843
| | | | | | | | | | | | | | | | | | by separate conversion functions. This will hopefully make bugs more noticeable (I noticed several already) and provide opportunities to reduce code duplication.
* | | Fix some incorrect symbol versions.theraven2012-04-221-4/+4
| | | | | | | | | | | | Reported by: das
OpenPOWER on IntegriCloud