summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Rework all non-contributed files that use `struct timezone'.ed2012-09-012-2/+2
| | | | | | | | | | | | | | This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
* Bring some changes from Bull's NFSv4 libtirpc implementation.pfg2012-09-019-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We especifically ignored the glibc compatibility changes but this should help interaction with Solaris and Linux. ____ Fixed infinite loop in svc_run() author Steve Dickson Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400) Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. author Steve Dickson Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400) ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. author Steve Dickson Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500) ____ Converted all uid and gid variables of the type uid_t and gid_t. author Steve Dickson Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500) ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. author Jeff Layton Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400) ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. author Jeff Layton Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400) Obtained from: Bull GNU/Linux NFSv4 Project MFC after: 3 weeks
* Add missing .Pp macro.zeising2012-08-211-0/+1
| | | | | | PR: docs/170380 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: joel (mentor)
* Remove trailing whitespace.joel2012-08-211-1/+1
|
* Add manual pages for clock_getcpuclockid and pthread_getcpuclockid.davidxu2012-08-212-1/+96
|
* Fix prototype. Also the function should return error code instead ofdavidxu2012-08-211-2/+4
| | | | -1 on error.
* Implement syscall clock_getcpuclockid2, so we can get a clock iddavidxu2012-08-175-5/+44
| | | | | | | | for process, thread or others we want to support. Use the syscall to implement POSIX API clock_getcpuclock and pthread_getcpuclockid. PR: 168417
* Make 'junk' volatile so that compilers won't be tempted to optimizekevlo2012-08-171-1/+1
| | | | | Reviewed by: ache MFC after: 3 days
* Merging of projects/armv6, part 2gonzo2012-08-152-0/+10
| | | | Handle TLS for ARMv6 and ARMv7
* Rename aux.c to auxv.c.ed2012-08-112-1/+1
| | | | | | | | | | | On Windows, AUX is the auxiliary device, usually pointing to COM1. Therefore it is forbidden to create a file named aux.c. To make it a bit easier for Windows users to check out our source code, rename this file to auxv.c. MFC after: 1 month Discussed with: kib Suggested by: Eric van Gyzen <eric vangyzen net>
* nftw(): POSIX says directories causing loops should be silently skipped.jilles2012-08-091-3/+2
| | | | Formerly, loops caused nftw() to abort the traversal with ELOOP.
* Refresh with OpenBSD RCS ID changes to reflect that we now have essentionallydelphij2012-08-091-7/+1
| | | | the same file.
* ftw(): Do not check the maxfds argument against OPEN_MAX.jilles2012-08-091-2/+1
| | | | | | | | | | Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX does not require us to check this. POSIX does have a requirement on the application that maxfds not exceed {OPEN_MAX}, but does not require the implementation to check it ("may fail"). PR: 95239
* nftw(): Do not check the maxfds argument against OPEN_MAX.jilles2012-08-091-2/+1
| | | | | | | | | Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX does not require us to check this. PR: 95239 Submitted by: Todd Miller
* Use calloc().delphij2012-08-011-2/+1
|
* Remove trailing whitespace.joel2012-07-301-1/+1
|
* Add more locale-specific functions to the relevant man pages and Makefile:issyl02012-07-306-14/+86
| | | | | | | | | | | | - lib/libc/locale/islower.3 - lib/libc/locale/ispunct.3 - lib/libc/locale/nl_langinfo.3 - lib/libc/locale/isgraph.3 - lib/libc/locale/isspace.3 Reviewed by: bz Approved by: theraven MFC after: 5 days
* Correct BUGS description of static buffer useemaste2012-07-271-3/+3
| | | | | | | Since r142667 strerror has unconditionally returned a pointer to a static buffer. MFC after: 1 week
* Document F_DUP2FD_CLOEXEC.kib2012-07-271-4/+14
| | | | MFC after: 1 week
* Start manpage with Dd macro and also remove a trailing whitespacejoel2012-07-261-2/+2
| | | | while here.
* Update the 'C1x draft' reference to '.St -isoC-2011' mdoc macro.pluknet2012-07-262-2/+4
| | | | | Reviewed by: theraven MFC after: 1 week
* Add a new man page containing details of new locale-specific functions forissyl02012-07-252-1/+182
| | | | | | | | wctype.h, iswalnum_l(3). Add it and its functions to the Makefile. Reviewed by: gavin, jilles Approved by: theraven MFC after: 5 days
* (Incomplete) fixes for symbols visibility issues and style in fcntl.h.kib2012-07-211-1/+1
| | | | | | | | | | | | | | | | | Append '__' prefix to the tag of struct oflock, and put it under BSD namespace. Structure is needed both by libc and kernel, thus cannot be hidden under #ifdef _KERNEL. Move a set of non-standard F_* and O_* constants into BSD namespace. SUSv4 explicitely allows implemenation to pollute F_* and O_* names after fcntl.h is included, but it costs us nothing to adhere to the specification if exact POSIX compliance level is requested by user code. Change some spaces after #define to tabs. Noted by and discussed with: bde MFC after: 1 week
* Document F_DUPFD_CLOEXEC. Also provide some wording changes forkib2012-07-191-4/+15
| | | | | | F_DUPFD to make it less confusing, at least for me. MFC after: 1 week
* Return zero from get_addrselectpolicy() when no source-address-selectionemax2012-07-181-0/+2
| | | | | | policy is installed. MFC after: 1 week
* 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
OpenPOWER on IntegriCloud