summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r281712:kib2015-04-256-1/+119
| | | | Make wait6(2), waitid(3) and ppoll(2) cancellation points.
* MFC r280919: wordexp: Explicitly pass along IFS.jilles2015-04-191-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 r281082: fts: Don't return FTS_SLNONE if it's not a symlink (if race).jilles2015-04-191-5/+6
| | | | | | | | | | | | | | When following symlinks, fts returned FTS_SLNONE when fstatat(flag=0) failed, but a subsequent fstatat(flag=AT_SYMLINK_NOFOLLOW) succeeded. This incorrectly triggered if a filename existed to be read from the directory, was deleted before the fstatat(flag=0) and created again after the fstatat(flag=0). Fix this by only returning FTS_SLNONE if the result from fstatat(flag=AT_SYMLINK_NOFOLLOW) is actually a symlink. If it is not a symlink, treat it as if fstatat(flag=0) succeeded. PR: 196724
* MFC r274933 (by bapt), r281470:pluknet2015-04-191-7/+2
| | | | | r274933 - Ta is only allowed with Bl -column not in Bl -item r281470 - Remove obsolete bits about maximum number of file systems.
* MFC r260571: fts: Stat things relative to the directory fd, if possible.jilles2015-04-181-12/+19
| | | | | | | | | As a result, the kernel needs to process shorter pathnames if fts is not changing directories (if fts follows symlinks (-L option to utilities), fts cannot open "." or FTS_NOCHDIR was specified). Side effect: If pathnames exceed PATH_MAX, [ENAMETOOLONG] is not hit at the stat stage but later (opendir or application fts_accpath) or not at all.
* MFC: r266671, r266725:allanjude2015-04-163-98/+38
| | | | | | | Merge strcspn.3 into strspn.3 and clarify the explaination Approved by: eadler (mentor, implicit) Sponsored by: ScaleEngine Inc.
* MFC r280818:kib2015-04-125-2/+82
| | | | Make kevent(2) a cancellation point.
* MFC r280959:kib2015-04-082-3/+9
| | | | Correctly handle __fcntl_compat symbol for the !SYSCALL_COMPAT case.
* MFC r278530:bdrewery2015-04-031-0/+1
| | | | | | | | When catopen(3) returns an error, it caches the result of that error 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.
* MFC r272291:bdrewery2015-04-031-1/+3
| | | | Document [EPERM] for UNIX sockets.
* MFC r275163: ANSIfy b64_ptonemaste2015-03-231-4/+1
|
* MFC r275060: Fix b64_pton output buffer overrun test for exact-sized bufferemaste2015-03-231-7/+15
| | | | | b64_pton would sometimes erroneously fail to decode a base64 string into a precisely sized buffer. The overflow check was a little too greedy.
* MFC r279037:pfg2015-03-231-4/+2
| | | | | | | | | | | | | dbm_delete(3): correct man page to match current behaviour. "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 r279186:pfg2015-03-232-20/+47
| | | | | | | | | | | setmode(3): Make sure that setmode sets errno on failure. Our man page already documented this partially but now we provide more consistent behavior. PR: 136669 Obtained from: NetBSD (CVS rev. 1.31, 1.33) Relnotes: yes
* Merge an applicable subset of r263234 from HEAD to stable/10:rwatson2015-03-191-1/+1
| | | | | | | | | | | | | Update most userspace consumers of capability.h to use capsicum.h instead. auditdistd is not updated as I will make the change upstream and then do a vendor import sometime in the next week or two. Note that a significant fraction does not apply, as FreeBSD 10 doesn't contain a Capsicumised ping, casperd, libcasper, etc. When these features are merged, the capsicum.h change will need to be merged with them. Sponsored by: Google, Inc.
* Merge r263842 from HEAD to stable/10:rwatson2015-03-197-14/+15
| | | | | | Update system man pages for s/capability.h/capsicum.h/. Sponsored by: Google, Inc.
* MFC r279367:kib2015-03-021-1/+1
| | | | Fix typo.
* MFC: r278870marius2015-02-243-4/+11
| | | | | | | | Unbreak sparc64 after r276630 (MFCed to stable/10 in r277317) by calling __sparc_sigtramp_setup signal trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions)
* MFC r278803, r278905:pfg2015-02-221-5/+7
| | | | | | | | | | | | | | | | ulimit(3): Fix broken check. 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 r278889:kib2015-02-201-1/+1
| | | | Restore the extern qualifier on __cleanup.
* MFC r278301, r278315:pfg2015-02-191-4/+5
| | | | | | | tdelete(3): don't delete the node we are about to return. CID: 272528 Obtained from: NetBSD (CVS rev. 1.4)
* MFC r278300, r278314:pfg2015-02-191-8/+15
| | | | | | | | | | | getdiskbyname(): plug resource leak Variable cq going out of scope leaks the storage it points to. CID: 270511 Phabric: D1775 Reviewed by: imp Obtained from: NetBSD (CVS rev. 1.34)
* MFC r278739:delphij2015-02-171-0/+17
| | | | | | | | Disallow pattern spaces which would cause intermediate calculations to overflow size_t. Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon) Security: CERT VU#695940
* MFC r278751:kib2015-02-173-22/+26
| | | | Properly interpose libc spinlocks, was missed in r276630.
* MFC r268857: ttyname(3): Fix EBADF/ENOTTY error descriptions.jilles2015-02-081-5/+21
| | | | | | | Also, make sure to document the return values and errors for all three functions in the man page. PR: 191931
* MFC r278038: ttyname_r(): Return actual error, not always [ENOTTY].jilles2015-02-081-2/+2
| | | | | | Adjust the test that used to fail because of this bug. PR: 191936
* MFC r277862: sem_post(): Fix and document semaphore value overflow error.jilles2015-02-082-3/+8
| | | | | | | | The error code is per Austin Group issue #315. I provided different wording for the manual page change. Submitted by: pluknet
* MFC r277322:kib2015-01-251-1/+78
| | | | | Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger attachment to the process.
* MFC r274816:brooks2015-01-222-4/+153
| | | | | | | | | | | | | | Add FPU support for MIPS setjmp(3)/longjmp(3). This change saves/restores the callee-saved MIPS floating point registers as documented by the o32/n32/n64 spec ("MIPSpro N32 ABI Handbook", Table 2-1) for the _setjmp(3), _longjmp(3), setjmp(3) and longjmp(3) C library functions. This is only included when the C library is built with hardware floating point support (or when "SOFTFLOAT" is not defined). Submitted by: sson Sponsored by: DARPA, AFRL
* MFC r267004,r274592:ngie2015-01-202-0/+302
| | | | | | | | | | | | | | | | r267004 (by gahr): - Use strlen instead of hardcoding a number - Terminate a sentence with a period Approved by: cognet r274592 (by ngie): Convert tools/regression/lib/libc/stdio/test-fmemopen into an ATF testcase and rename as lib/libc/stdio/fmemopen2_test Sponsored by: EMC / Isilon Storage Division
* MFC r276590:ngie2015-01-201-14/+16
| | | | | | | | | | | | | | | r276590 (by jilles): Link lib/libc/c063 tests to the build. Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's request; the includes are clearly necessary for struct stat. The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with faccessat(), which is not specified by POSIX.1-2008. Differential Revision: https://reviews.freebsd.org/D1411 Reviewed by: ngie
* MFC r276318:ngie2015-01-201-1/+7
| | | | | | | | r276318 (by ngie): Build/install lib/libc/tests/hash/t_sha2 if MK_OPENSSL == yes Reported by: Beeblebrox <zaphod@berentweb.com>
* MFC r274075,r274581,r274582,r274595:ngie2015-01-2031-0/+936
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r274075 (by ngie): Add reachover Makefiles for contrib/netbsd-tests/lib/libc; this adds approximately 500 new testcases Various TODOs have been sprinkled around the Makefiles for items that even need to be ported (missing features), testcases have issues with building/linking, or issues at runtime. A variant of this code has been tested extensively on amd64 and i386 10-STABLE/11-CURRENT for several months without issue. It builds on other architectures, but the code will remain off until I have prove it works on virtual hardware or real hardware on other architectures In collaboration with: pho, Casey Peel <casey.peel@isilon.com> Sponsored by: EMC / Isilon Storage Division r274581 (by ngie): Convert tools/regression/lib/libc/gen/test-arc4random into an ATF testcase and rename as lib/libc/gen/arc4random_test Sponsored by: EMC / Isilon Storage Division r274582 (by ngie): Remove test-arc4random from this Makefile so others can continue to use this as-is for the time being r274595 (by ngie): Convert tools/regression/lib/libc/stdio/test-fpclassify into an ATF testcase and Rename as lib/libc/stdio/fpclassify2_test Sponsored by: EMC / Isilon Storage Division
* Fix known issues which blow up the process after dlopen("libthr.so")kib2015-01-1853-81/+1923
| | | | | | | | | | | | | | | | | | | | | (or loading a dso linked to libthr.so into process which was not linked against threading library). MFC r276630: Remove interposing, fix malloc, reinstall signal handlers wrappers on libthr load. MFC r276681: Avoid calling internal libc function through PLT or accessing data though GOT. MFC r277032: Reduce the size of the interposing table and amount of cancellation-handling code in the libthr. MFC note: r276646 ("do not erronously export 'openat' symbol from rtld") is not applicable to stable/10 yet, since PATHFDS support was not merged.
* MFC r275752:trasz2015-01-141-2/+2
| | | | | | Fix quick_exit(3) manual page to match reality - the status was missing. Sponsored by: The FreeBSD Foundation
* MFC discussed with: jilles, -developersngie2015-01-112-8/+18
| | | | | | | | | | | | | MFC r266971: - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX). Update the manpage to reflect this change. - Always set the current position to the first null-byte when opening in append mode. This makes the implementation compatible with glibc's. Update the test suite. Reported by: pho Approved by: cognet
* MFC r276627:kib2015-01-102-0/+8
| | | | | Add rtld private interface for dso to detect dynamic loading vs. static linking.
* MFC r274722:trasz2015-01-071-43/+0
| | | | | | | | Remove acl_size.c; apparently it was never used. PR: 194398 Submitted by: ngie@ Sponsored by: The FreeBSD Foundation
* Merge reaper facility.kib2015-01-051-5/+222
| | | | | | | | | | | | | | | | | | | | | MFC r270443 (by mjg): Properly reparent traced processes when the tracer dies. MFC r273452 (by mjg): Plug unnecessary PRS_NEW check in kern_procctl. MFC 275800: Add a facility for non-init process to declare itself the reaper of the orphaned descendants. MFC r275821: Add missed break. MFC r275846 (by mckusick): Add some additional clarification and fix a few gammer nits. MFC r275847 (by bdrewery): Bump Dd for r275846.
* MFC r275930:delphij2015-01-021-1/+3
| | | | | | Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece)
* MFC r274462: Add the ppoll() system call.dchagin2014-12-213-2/+70
|
* MFC r271315 (by joel):kib2014-12-181-59/+84
| | | | | | | Minor mdoc nit. MFC r275806: Markup fixes for kqueue(2), no content changes.
* MFC r268843 (by bapt):kib2014-12-181-3/+20
| | | | Extend kqueue's EVFILT_TIMER by adding precision unit flags support.
* MFC 271635,271722:jhb2014-12-161-14/+24
| | | | | | | | | | | | | | | | - Only the manpage updates from 271635 are merged to give additional heads up for the stricter checks in 11, but the kernel in 10 remains permissive. - Fail with EINVAL if an invalid protection mask is passed to mmap(). - Fail with EINVAL if an unknown flag is passed to mmap(). - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it.
* Clean up our ARM assembly:andrew2014-12-147-123/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd
* MFC r275665:delphij2014-12-101-4/+6
| | | | | | | Fix buffer overflow in stdio. Security: FreeBSD-SA-14:27.stdio Security: CVE-2014-8611
* MFC r275071:delphij2014-12-091-9/+28
| | | | | | | | | | | | | Reinstitate send() after syslogd restarts. In r228193 the test of CONNPRIV have been moved to before the _usleep and send in vsyslog(). When syslogd restarts, this would prevent the message being logged after the disconnect/connect dance for scenario #1. PR: 194751 Submitted by: Peter Creath <pjcreath+freebsd gmail com> Reviewed By: glebius
* MFC r263928:brooks2014-12-061-1/+1
| | | | | | Use the correct variable name in the example code. PR: 195749
* MFC r273854:trasz2014-11-291-5/+9
| | | | | | Update acl(3) to expand on NFSv4 ACL support. Sponsored by: The FreeBSD Foundation
* MFC r273853:trasz2014-11-297-14/+14
| | | | | | Make it clear that ACL flags are NFSv4-only. Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud