summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* libc: Eliminate duplicate copies of __vdso_gettc.cemaste2015-04-0210-197/+5
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2152
* Update open(2) to make it more obvious that O_NOCTTY and O_TTY_INITtrasz2015-04-021-3/+3
| | | | | | | are ignored. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Correctly handle __fcntl_compat symbol for the !SYSCALL_COMPAT case.kib2015-04-012-3/+9
| | | | | | | | | Both .weak and .alias assembler directives only work when assembling the file which defines the symbol. Reported and tested by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week
* wordexp: Explicitly pass along IFS.jilles2015-03-311-1/+4
| | | | | | | | | | | Per Austin group issue #884, sh should not import IFS from the environment but always set it to $' \t\n'. For wordexp(), however, it is documented and useful for it to use IFS from the environment. Since sh currently imports IFS from the environment, this change has no functional effect. MFC after: 1 week
* Make kevent(2) a cancellation point.kib2015-03-295-2/+82
| | | | | | | | | | | | | | | | | | | | | Note that to cancel blocked kevent(2) call, changelist must be empty, since we cannot cancel a call which already made changes to the process state. And in reverse, call which only makes changes to the kqueue state, without waiting for an event, is not cancellable. This makes a natural usage model to migrate kqueue loop to support cancellation, where existing single kevent(2) call must be split into two: first uncancellable update of kqueue, then cancellable wait for events. Note that this is ABI-incompatible change, but it is believed that there is no cancel-safe code that relies on kevent(2) not being a cancellation point. Option to preserve the ABI would be to keep kevent(2) as is, but add new call with flags to specify cancellation behaviour, which only value seems to add complications. Suggested and reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Add an SCTP symbol which was missed intuexen2015-03-281-0/+1
| | | | | | | | | https://svnweb.freebsd.org/base?view=revision&revision=169622 This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783 Thanks to Jukka Ukkonen for reporting the bug and providing a fix. MFC after: 3 days
* setmode(): Use sysctl kern.proc.umask instead of umask() if possible.jilles2015-03-261-9/+33
| | | | | The kern.proc.umask.<pid> sysctl allows querying the umask without temporarily modifying it.
* Start to import support for the AArch64 architecture from ARM. This changeandrew2015-03-191-0/+5
| | | | | | | | | | | | | | | | | only adds support for kernel-toolchain, however it is expected further changes to add kernel and userland support will be committed as they are reviewed. As our copy of binutils is too old the devel/aarch64-binutils port needs to be installed to pull in a linker. To build either TARGET needs to be set to arm64, or TARGET_ARCH set to aarch64. The latter is set so uname -p will return aarch64 as existing third party software expects this. Differential Revision: https://reviews.freebsd.org/D2005 Relnotes: Yes Sponsored by: The FreeBSD Foundation
* We won't support a.out on arm64/aarch64. As such there will be no need toandrew2015-03-181-0/+3
| | | | | | | support it in nlist(3). Reviewed by: emaste Sponsored by: The FreeBSD Foundation
* libc: plug memory leaks in edge cases for the posix1e code.pfg2015-03-132-4/+11
| | | | | | | | CID: 1016705 CID: 1016706 CID: 1016707 Differential Revision: https://reviews.freebsd.org/D2023
* Add a SCTP socket option to limit the cwnd for each path.tuexen2015-03-101-0/+3
| | | | MFC after: 1 month
* Save and restore non-volatile floating-point registers during longjmp().nwhitehorn2015-03-086-0/+236
| | | | | | | | | | | This should also save and restore non-volatile Altivec registers, but that needs to wait on solving two problems: 1. Adding the nonvolatile vector registers means we need 5 more than _JBLEN entries in jmp_buf on 32-bit targets (64-bit is OK). 2. Need to figure out how to determine if saving/restoring vector regs is supported on the current CPU from userland. MFC after: 1 month
* forgot to bump date, and replace contraction (igor)...jmg2015-03-071-2/+2
|
* make things a bit more clear.. we worked together on language..jmg2015-03-061-0/+2
| | | | Submitted by: Justin Cormack
* compat_passwd(): yet another uninitialized access to stayopen.pfg2015-03-061-1/+1
| | | | CID: 1018731
* qsort(3): small style(9) cleanups.pfg2015-03-051-10/+10
| | | | | Basically spaces vs. tabs. No functional change.
* qsort(3): enhance to handle 32-bit aligned data on 64-bit systemspfg2015-03-051-12/+21
| | | | | | | | | | | | | | Implement a small enhancement to the original qsort implementation: If the data is 32 bit aligned we can side-step the long type version and use int instead. The change brings a modest but significant improvement in 32 bit workloads. Relnotes: yes PR: 135718 Taken from: ache
* Avoid lookup of CODESET aliases using uninitialized pathkan2015-02-281-0/+8
| | | | | | | | | We do not use iconv.alias file, so avoid using the vestiges of the code that do. Differential Revision: https://reviews.freebsd.org/D1729 Reviewed by: emaste MFC after: 2 weeks
* nice(): Put back old return value, keeping [EPERM] error.jilles2015-02-282-12/+19
| | | | | | | | | | | Commit r279154 changed the API and ABI significantly, and {NZERO} is still wrong. Also, preserve errno on success instead of setting it to 0. PR: 189821 Reported by: bde Relnotes: yes
* Fix typo. Note that this is mostly innocent, since libthr no longerkib2015-02-271-1/+1
| | | | | | | interposes the symbol. Noted by: rpaulo MFC after: 3 days
* eui64_line(): plug memory leak.pfg2015-02-271-0/+1
| | | | | | CID: 978412 Reviewed by: brooks, delphij CodeReview: https://reviews.freebsd.org/D1976
* Hint out check for unsigned negative values.pfg2015-02-271-1/+1
| | | | | | | | | | | | | | | On FreeBSD socklen_t is unsigned so the check negative len in inet6_opt_append() is redundant and likely to be optimized away by the compiler. On other operating systems this is not necessarily so, and in the future we may want to sign it so leave the check in but place it in a secondary position as a subtle indication that the bogus check is intentional. Discussed with: rpaulo CID: 1017783
* Adjust wording slightly to emphasize that random(3) should not be used forcperciva2015-02-251-3/+2
| | | | | | | | any applications which need unpredictable random numbers, not merely those which are cryptographic in nature. If you work for a lottery and you're using random(3) to select the winning numbers, please let me know.
* setmode(3): Make sure that setmode sets errno on failure.pfg2015-02-222-20/+47
| | | | | | | | | | Our man page already documented this partially but now we have some consistent behavior. PR: 136669 Obtained from: NetBSD (CVS rev. 1.31, 1.33) Relnotes: yes MFC after: 3 weeks
* nice(): Correct return value and [EPERM] error.jilles2015-02-222-5/+32
| | | | | | PR: 189821 Obtained from: NetBSD Relnotes: yes
* Prevent NULL pointer de-reference.pfg2015-02-211-1/+1
| | | | | As a follow up to r279090, if dp hasn't been defined, we shouldn't attempt to do an optimization here.
* regex(3): Fix uninitialized pointer values.pfg2015-02-202-3/+3
| | | | | CID: 405582 (also clang static checker) CID: 1018724
* tab vs spaces.pfg2015-02-201-2/+2
|
* dbm_delete(3) correct man page to match current behaviour.pfg2015-02-201-4/+2
| | | | | | | | | | | | "The dbm_store() and dbm_delete() functions shall return 0 when they succeed and a negative value when they fail." Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html PR: 42422 Suggested by: delphij MFC after: 3 days
* Fix small memleaks in nis_passwd() and nis_group().pfg2015-02-202-2/+6
| | | | | | | | | | These only occur upon error. Code Review: https://reviews.freebsd.org/D1849 Reviewed by: delphij CID: 1016715 CID: 1016717
* fix spelling, add comma and remove BUGS section.. it provided no usefuljmg2015-02-191-17/+3
| | | | information, and is not really bugs, but limitations for other reasons...
* libc: clean some set-but-not-used errors.pfg2015-02-183-7/+1
| | | | | | | These were found by gcc 5.0 on Dragonfly BSD, however I made no attempt to silence the false positives. Obtained from: DragonFly (cf515c3a6f3a8964ad592e524442bc628f8ed63b)
* ulimit(3): simplify.pfg2015-02-171-10/+8
| | | | | | | | | | | rlim_t is at least as large as long, so we don't need the extra variable to keep the intermediate step. We don't need the volatile either. The code was tested on i386 and amd64. Suggested by: bde X-MFC with: r278803
* Restore the extern qualifier on __cleanup.kib2015-02-171-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Unbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signalmarius2015-02-163-4/+11
| | | | | | | trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions) MFC after: 3 days
* Replace strcpy() with strlcpy()pfg2015-02-151-1/+1
| | | | | | | The risk of an overrun here is very low but check the length, JIC. CID: 1019039
* Reverse one of the initializations from r278804.pfg2015-02-151-1/+1
| | | | | | It does no harm but this is not needed after the correction in r278805 and I prefer to keep this code very similar to it's original state.
* Mismatch in r278804.pfg2015-02-151-1/+1
|
* More tidy-ups on uninitialized scalar variablepfg2015-02-152-3/+3
| | | | | | | | | | As a followup to r278363, there is one more case where stayopen can be accessed uninitialized, but even after swapping arguments, access is possible in some other cases so prevent it completely by initializing stayopen. CID: 1018729 CID: 1018732
* ulimit(3): Fix broken check.pfg2015-02-151-5/+9
| | | | | | | | | | | | | | | The existing implementation had a broken comparison that could overflow and return confusing values. Replace this with a check that avoids the overflow before it happens. Consistently return a maximum value also on the case of negative arguments since negative is considered an overflow and means infinity for our current setrlimit(). New revamped version is credited to Bruce Evans. CID: 1199295 MFC after: 1 week
* The ld(1) flag is -Bsymbolic not -Wsymbolic.tijl2015-02-141-2/+2
|
* Properly interpose libc spinlocks, was missed in r276630. Inkib2015-02-143-22/+26
| | | | | | | | particular, stdio locking was affected. Reported and tested by: "Matthew D. Fuller" <fullermd@over-yonder.net> Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Disallow pattern spaces which would cause intermediate calculations todelphij2015-02-141-0/+17
| | | | | | | | overflow size_t. Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon) Security: CERT VU#695940 MFC after: 3 days
* Revert 278634: This broke the build due to the compiler being too clever.pfg2015-02-131-2/+2
| | | | Will be back, with proper compiler workarounds.
* ulimit(3): Fix broken check.pfg2015-02-121-2/+2
| | | | | | | | | | | | | | The existing implementation had a broken comparison that could overflow. Replace this with a check that avoids the overflow before it happens. Consistently return a maximum value also on the case of negative arguments since negative is considered an overflow and means infinity for our current setrlimit(). Discussed with: bde (rather extensively) CID: 1199295 MFC after: 1 week
* When catopen(3) returns an error, it caches the result of that errorbdrewery2015-02-101-0/+1
| | | | | | | | | | | | from r202992. The refcount on the cache entry is not initialized, so any attempt to clean the cache will skip over this item since it likely has a >0 value. This change is currently a NOP. There is work in progress to support freeing the cache which requires this change to avoid a memory leak. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Protect uninitialized scalar variable from being accessedpfg2015-02-072-2/+2
| | | | | | | | | | In a couple of cases a variable "stayopen" can be checked unitialized. This is of no danger as the complementary condition is false but prevent the access by switching the checks. CID: 1018729 CID: 1018732
* Remove useless comment.trasz2015-02-071-6/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Update comment and NetBSD ID tag.pfg2015-02-061-3/+3
| | | | | The NetBSD revisions correspond to changes we have already done like __P() removal and ANSI-fication of definitions.
* Drop cgetclose() from getdiskbyname().pfg2015-02-061-1/+0
| | | | | | | | | This was a local addition to the original change from NetBSD. Being this libc there is some chance for it to interfere with user's cget*() functions usage. The memory leak was finely plugged by r278300. Pointed out by: ache
OpenPOWER on IntegriCloud