summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* tdelete(3): don't delete the node we are about to return.pfg2015-02-051-1/+2
| | | | | | CID: 272528 Obtained from: NetBSD (CVS rev. 1.4) MFC after: 2 weeks
* getdiskbyname(): plug resource leakpfg2015-02-051-8/+16
| | | | | | | | | | 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 after: 2 weeks
* rpc: Uninitialized pointer readpfg2015-02-021-1/+1
| | | | | | | | | Initialize *xprt to avoid exposing a random value in cleanup_svc_vc_create. CID: 1018723 Phabric: D1749 Reviewed by: alfred
* Resource leakpfg2015-02-011-0/+1
| | | | | CID: 1016703 Reviewed by: alfred
* ttyname_r(): Return actual error, not always [ENOTTY].jilles2015-02-011-2/+2
| | | | | | | Adjust the test that used to fail because of this bug. PR: 191936 MFC after: 1 week
* Use zero register instead of immediate 0x0 in MIPS assemblyemaste2015-01-291-1/+1
| | | | | | | | It seems GAS makes the substitution automatically, but Clang's integrated assembler does not (yet). It fails with "invalid operand for instruction." Reported by: sbruno
* sem_post(): Fix and document semaphore value overflow error.jilles2015-01-282-3/+8
| | | | | | | | | The error code is per Austin Group issue #315. I provided different wording for the manual page change. Submitted by: pluknet MFC after: 1 week
* Enable utimensat tests from NetBSD.jilles2015-01-241-1/+2
| | | | As with other tests from c063, a required #include <sys/stat.h> was missing.
* Add futimens and utimensat system calls.jilles2015-01-236-0/+510
| | | | | | | | | | | | | | The core kernel part is patch file utimes.2008.4.diff from pluknet@FreeBSD.org. I updated the code for API changes, added the manual page and added compatibility code for old kernels. There is also audit and Capsicum support. A new UTIME_* constant might allow setting birthtimes in future. Differential Revision: https://reviews.freebsd.org/D1426 Submitted by: pluknet (partially) Reviewed by: delphij, pluknet, rwatson Relnotes: yes
* Add procctl(2) PROC_TRACE_CTL command to enable or disable debuggerkib2015-01-181-1/+78
| | | | | | | | | | | attachment to the process. Note that the command is not intended to be a security measure, rather it is an obfuscation feature, implemented for parity with other operating systems. Discussed with: jilles, rwatson Man page fixes by: rwatson Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add a ${CP} alias for copying files in the build.will2015-01-161-2/+2
| | | | | | | | | | | | | | Some users build FreeBSD as non-root in Perforce workspaces. By default, Perforce sets files read-only unless they're explicitly being edited. As a result, the -f argument must be used to cp in order to override the read-only flag when copying source files to object directories. Bare use of 'cp' should be avoided in the future. Update all current users of 'cp' in the src tree. Reviewed by: emaste MFC after: 1 week Sponsored by: Spectra Logic
* Remove duplicate copies of trivial getcontextx.cemaste2015-01-1210-314/+16
| | | | | | | | | | Only i386 and amd64 provide a non-trivial __getcontextx(). Use a common trivial implementation in gen/ for other architectures, rather than copying the file to each MD subdirectory. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1472
* Reduce the size of the interposing table and amount ofkib2015-01-1113-142/+49
| | | | | | | | | | | | | | | | | cancellation-handling code in the libthr. Translate some syscalls into their more generic counterpart, and remove translated syscalls from the table. List of the affected syscalls: creat, open -> openat raise -> thr_kill sleep, usleep -> nanosleep pause -> sigsuspend wait, wait3, waitpid -> wait4 Suggested and reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Apparently more Makefiles use stuff from compiler-rt, so fix them updim2015-01-081-1/+1
| | | | too. (This did not show during a make universe, strangely.)
* Document CPU_WHICH_DOMAIN and bump Dd for cpuset.1.jhb2015-01-081-1/+2
| | | | Missed in: r276829
* Clarify text to be consistent with nanosleep(2),rodrigc2015-01-081-4/+4
| | | | | | since sleep(3) is implemented in terms of nanosleep(2). This is similar to the sleep(3) man page for Darwin.
* Avoid use of register variables. Clang 3.5 treats this as undefined behavior,jhibbits2015-01-062-4/+2
| | | | | | and bad things happen. MFC after: 1 week
* Avoid calling internal libc function through PLT or accessing datakib2015-01-053-7/+14
| | | | | | | | | though GOT, by staticizing and hiding. Add setter for __error_selector to hide it as well. Suggested and reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 1 week
* mdoc: paragraph improvements.joel2015-01-041-1/+1
|
* Fix known issues which blow up the process after dlopen("libthr.so")kib2015-01-0354-92/+2020
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or loading a dso linked to libthr.so into process which was not linked against threading library). - Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries. - Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization. - Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary. In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr. Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen. No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add rtld private interface for dso to detect dynamic loadingkib2015-01-032-0/+8
| | | | | | | | vs. static linking. Tested by: pho, antoine (exp-run) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Link lib/libc/c063 tests to the build.jilles2015-01-021-14/+16
| | | | | | | | | | | 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
* Don't install h_raw if dealing with clang 3.5.0+ to unbreak the tests2 Jenkinsngie2015-01-021-3/+4
| | | | | | | | | | | job The h_raw application doesn't do proper bounds checking without the option being supplied via the build, which means that it doesn't throw signals and fail as expected PR: 196430 X-MFC with: r276479
* mdoc: remove EOL whitespace.joel2014-12-291-2/+2
|
* Build/install lib/libc/tests/hash/t_sha2 if MK_OPENSSL == yesngie2014-12-271-1/+7
| | | | Reported by: Beeblebrox <zaphod@berentweb.com>
* mdoc: improvements to SEE ALSO.joel2014-12-275-6/+6
|
* Various mdoc fixes and a few EOL whitespace removals.brueffer2014-12-2123-46/+50
| | | | Found with: mandoc -Tlint
* Plug a memory leak.delphij2014-12-191-1/+3
| | | | | Obtained from: DragonFlyBSD (commit 5119ece) MFC after: 2 weeks
* Initilize the msg_flags field consistently in all code paths.tuexen2014-12-171-1/+4
| | | | | Reported by: Coverity CID: 1018726
* Bump Dd for r275846bdrewery2014-12-171-1/+1
| | | | MFC after: 3 weeks
* Add some additional clarification and fix a few gammer nits.mckusick2014-12-171-58/+66
| | | | | Reviewed by: kib MFC after: 3 weeks
* Markup fixes for kqueue(2), no content changes.kib2014-12-151-61/+87
| | | | | | Reviewed by: brueffer (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Fix incorrect type of "invalids" argument in __iconv() prototype.kuriyama2014-12-151-1/+1
|
* Add a facility for non-init process to declare itself the reaper ofkib2014-12-151-3/+212
| | | | | | | | | | | the orphaned descendants. Base of the API is modelled after the same feature from the DragonFlyBSD. Requested by: bapt Reviewed by: jilles (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
* Fix quick_exit(3) manual page to match reality - the status was missing.trasz2014-12-131-2/+2
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix a typo reported by Lennart Grahl.tuexen2014-12-101-1/+1
| | | | MFC after: 3 days
* In r268924 __fflush was modified so that when write(2) was not successful,delphij2014-12-101-4/+6
| | | | | | | | | | | | _p and _w are adjusted to account for the partial write (if any). However, _p and _w should not be unconditionally adjusted and should only be changed when we actually wrote some bytes, or the accumulated accounting error will eventually result in a heap buffer overflow. Reported by: adrian and alfred (Norse Corporation) Security: FreeBSD-SA-14:27.stdio Security: CVE-2014-8611
* Switch to the ARM unified assembly language as the clang integrated as onlyandrew2014-11-297-123/+138
| | | | | | | supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd
* ANSIfy b64_ptonemaste2014-11-271-4/+1
|
* Reinstitate send() after syslogd restarts.delphij2014-11-251-9/+28
| | | | | | | | | | | | | 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 after: 2 weeks Differential Revision: https://reviews.freebsd.org/D1227
* Fix b64_pton output buffer overrun test for exact-sized bufferemaste2014-11-251-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. Reported by: Ted Unangst on freebsd-hackers@ Reviewed by: loos, trasz Obtained from: OpenBSD MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1218
* Fix ifa_data description.pluknet2014-11-251-12/+10
| | | | | | | PR: 176583 Discussed with: glebius MFC after: 1 week Sponsored by: Nginx, Inc.
* Convert libraries to use LIBADDbapt2014-11-251-4/+2
| | | | While here reduce a bit overlinking
* The fallback flag in nsdispatch prevents the fallback implementation ofdes2014-11-251-9/+16
| | | | | | | | | | | | | | getgroupmembership() from invoking the correct backend in the compat case. Replace it with a nesting depth counter so it only blocks one level (the first is the group -> group_compat translation, the second is the actual backend). This is one of two bugs that break getgrouplist() in the compat case, the second being that the backend's own getgroupmembership() method is ignored. Unfortunately, that is not easily fixable without a redesign of our nss implementation (which is also needed to implement the +@group syntax in /etc/passwd). PR: 190055 MFC after: 1 week
* Revert r274772: it is not valid on MIPSemaste2014-11-256-10/+10
| | | | Reported by: sbruno
* For now, disable using -fsanitize=bounds for the libc ssp tests, whendim2014-11-241-0/+3
| | | | | | using clang 3.5.0, until the runtime support (via compiler-rt) is added. Otherwise, this would lead to link errors about missing support libraries.
* Ta is only allowed with Bl -column not in Bl -itembapt2014-11-231-1/+1
|
* Misc mdoc fixes:joel2014-11-231-1/+0
| | | | | | | | - Remove superfluous paragraph macros. - Remove/fix empty or incorrect macros. - Sort sections into conventional order. - Terminate quoted strings properly. - Remove EOL whitespace.
* Add FPU support for MIPS setjmp(3)/longjmp(3).brooks2014-11-212-4/+153
| | | | | | | | | | | | | 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 MFC after: 1 month Sponsored by: DARPA, AFRL
* Use canonical __PIC__ flagemaste2014-11-216-10/+10
| | | | | | | | It is automatically set when -fPIC is passed to the compiler. Reviewed by: dim, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1179
OpenPOWER on IntegriCloud