summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* libc: Remove some unused strings from getaddrinfo().jilles2012-07-151-13/+12
|
* Jump to the failed label instead of doing cleanup ourselves.brueffer2012-07-151-2/+1
| | | | | Obtained from: DragonFly BSD MFC after: 2 weeks
* Move the ffclock symbols from FBSD_1.2 to FBSD_1.3 where they should have beenlstewart2012-07-101-3/+3
| | | | | | | | put initially. They were added to head during development of 10-CURRENT, not 9-CURRENT. Submitted by: glebius Reviewed by: kib
* Executing CPUID with EAX set to 1 to actually get feature flags.davidxu2012-07-101-1/+1
| | | | PR: 169730
* Restore the __collate_load_error global that was accidentally removed in thetheraven2012-07-062-5/+6
| | | | | | xlocale refactoring. MFC after: 1 week
* Document the behavior (from 4.4-lite) that tokens returned by telldir() arebrooks2012-07-051-2/+15
| | | | | | | single use. Sponsored by: DARPA, AFRL MFC after: 3 days
* Prefer sysctl to open/read/close for obtaining random data.pjd2012-07-041-5/+35
| | | | | | | | | This method is more sandbox-friendly and also should be faster as only one syscall is needed instead of three. In case of an error fall back to the old method. Reviewed by: simon, gleb MFC after: 2 weeks
* The register_printf_render_std() function expects regular string.pjd2012-07-041-1/+1
| | | | | | Change argument type from 'const unsigned char *' to 'const char *'. MFC after: 2 weeks
* ctype_l(3): Note that not all these functions are specified by POSIX.1-2008.jilles2012-07-011-1/+14
| | | | | | | The function isascii_l() is not in POSIX even though isascii() is, probably because isascii() is marked as obsolete. The other functions, like digittoint_l() and ishexnumber_l(), are FreeBSD-specific just like their non-_l versions.
* Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPUkib2012-06-271-0/+4
| | | | | | value if present. MFC after: 1 week
* Remove end of line whitespace.joel2012-06-261-1/+1
|
* Add more locale-specific functions to the relevant man pages andissyl02012-06-255-3/+46
| | | | | | | | | | Makefiles: - libc/stdtime/strftime.3 - libc/stdtime/strptime.3 - libc/stdlib/strfmon.3 Reviewed by: theraven Approved by: gabor (mentor)
* Remove the assert added in r237286eadler2012-06-241-2/+0
| | | | | | | | | The use of assertions in libraries is not widely accepted. Requested by: bde, scottl Approved by: cperciva MFC after: 3 days X-MFC-With: r237286
* Use struct vdso_timehands data to implement fast gettimeofday(2) andkib2012-06-2210-2/+374
| | | | | | | | | | | | | | | clock_gettime(2) functions if supported. The speedup seen in microbenchmarks is in range 4x-7x depending on the hardware. Only amd64 and i386 architectures are supported. Libc uses rdtsc and kernel data to calculate current time, if enabled by kernel. Hopefully, this code is going to migrate into vdso in some future. Discussed with: bde Reviewed by: jhb Tested by: flo MFC after: 1 month
* Add the functions documented in the man pages in commit 237393 to theissyl02012-06-211-2/+7
| | | | | | | | relevant Makefile. Reminded by: gavin Approved by: gabor (mentor) MFC after: 5 days
* Be explicit about the dependency on nsparser.h.obrien2012-06-211-1/+1
|
* Add more locale-specific functions to the relevant man pages:issyl02012-06-214-7/+54
| | | | | | | | | | | - libc/string/strcoll.3 - libc/string/strstr.3 - libc/string/strxfrm.3 - libc/string/strcasecmp.3 Reviewed by: theraven, gabor Approved by: gabor (mentor) MFC after: 5 days
* Don't close an uninitialized descriptor. [1]eadler2012-06-201-2/+6
| | | | | | | | | | Add a sanity check for the validity of the passed fd. PR: kern/139080 [1] Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> [1] Reviewed by: pjd (briefly) Approved by: cperciva MFC after: 1 week
* Further refine the implementation of POSIX_FADV_NOREUSE.jhb2012-06-191-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | First, extend the changes in r230782 to better handle the common case of using NOREUSE with sequential reads. A NOREUSE file descriptor will now track the last implicit DONTNEED request it made as a result of a NOREUSE read. If a subsequent NOREUSE read is adjacent to the previous range, it will apply the DONTNEED request to the entire range of both the previous read and the current read. The effect is that each read of a file accessed sequentially will apply the DONTNEED request to the entire range that has been read. This allows NOREUSE to properly handle misaligned reads by flushing each buffer to cache once it has been completely read. Second, apply the same changes made to read(2) by r230782 and this change to writes. This provides much better performance in the sequential write case as it allows writes to still be clustered. It also provides much better performance for misaligned writes. It does mean that NOREUSE will be generally ineffective for non-sequential writes as the current implementation relies on a future NOREUSE write's implicit DONTNEED request to flush the dirty buffer from the current write. MFC after: 2 weeks
* libc: Reduce relative relocations in strftime().jilles2012-06-171-1/+1
|
* More style.kib2012-06-161-19/+14
| | | | MFC after: 3 days
* Revert part of the r235740 which changed separate allocation of thekib2012-06-161-2/+7
| | | | | | | | | | | | | | string buffer for each linelist l_line into one large string. Since linelists parsed out during the previous passes store the pointers to previously allocated l_lines, the reallocation caused undefined behaviour on accessing the buffers, and quite deterministic fault on freeing them (in mountd(8) startup). This fixes reading of netgroup(5) file which contains more then one netgroup. Discussed with: ghelmer MFC after: 3 days
* mandoc fixes.joel2012-06-161-14/+5
| | | | Obtained from: OpenBSD
* Per kib, since __flt_rounds is being added to FreeBSD 10, itkientzle2012-06-151-0/+3
| | | | | | belongs in FBSD_1.3. MFC after: 1 week
* Make sure that fstab fd is not leaked on exec.kib2012-06-141-1/+11
| | | | | | PR: kern/169023 Submitted by: Jukka Ukkonen <jau iki fi> MFC after: 1 week
* __flt_rounds is a public symbol (expands from the FLT_ROUNDS macro),kientzle2012-06-141-1/+1
| | | | | | | | | | so include it in the public namespace on arm just as with other architectures. This corrects r236816. Submitted by: Jan Sieka MFC after: 1 week
* Switch from 4-clause to 2-clause BSD license. (OpenBSD r1.22)delphij2012-06-111-8/+1
| | | | | | No functional change. Obtained from: NetBSD via OpenBSD
* Fix a leak when setting the global character locale to "C" from something else.theraven2012-06-111-7/+13
| | | | Reported by: mm
* __flt_rounds was omitted from the exported symbols here.kientzle2012-06-091-0/+1
| | | | | | Submitted by: Jan Sieka Reviewed by: arm@ MFC after: 1 week
* Fix two warnings about self-assignment in libc. These normally onlydim2012-06-062-2/+2
| | | | | | | trigger with clang, when you either use -save-temps, or ccache. Reported by: Sevan / Venture37 <venture37@gmail.com> MFC after: 3 days
* 1) Although unpublished version of standardache2012-06-051-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://austingroupbugs.net/view.php?id=385#c713 (Resolved state) recommend this way for the current standard (called "earlier" in the text) "However, earlier versions of this standard did not require this, and the same example had to be written as: // buf was obtained by malloc(buflen) ret = write(fd, buf, buflen); if (ret < 0) { int save = errno; free(buf); errno = save; return ret; } " from feedback I have for previous commit it seems that many people prefer to avoid mass code change needed for current standard compliance and prefer to track unpublished standard instead, which requires now that free() itself must save errno, not its usage code. So, I back out "save errno across free()" part of previous commit, and will fill PR for changing free() isntead. 2) Remove now unused serrno. MFC after: 1 week
* 1) IEEE Std 1003.1-2008, "errno" section, is explicit thatache2012-06-041-6/+16
| | | | | | | | | | | | | | | | | "The setting of errno after a successful call to a function is unspecified unless the description of that function specifies that errno shall not be modified." However, free() in IEEE Std 1003.1-2008 does not mention its interaction with errno, so MAY modify it after successful call (it depends on particular free() implementation, OS-specific, etc.). So, save errno across free() calls to make code portable and POSIX-conformant. 2) Remove unused serrno assignment. MFC after: 1 week
* Remove invalid remark about pipes.ed2012-06-021-2/+2
| | | | | | | | | The stat structures returned on pipes seems to contain all the information required by POSIX. Especially the wording "and thus to a pipe" makes little sense, because it seems to imply a certain relationship between sockets and pipes that simply isn't there. MFC after: 2 weeks
* mdoc: minor Bl improvements.joel2012-06-021-1/+1
|
* Style(9) improvements: remove unnecessary parenthesis, improve orderghelmer2012-06-011-50/+52
| | | | | | | of local variable declarations, remove bogus casts, and resolve long lines. Reviewed by: bde
* 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
|
OpenPOWER on IntegriCloud