summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Move the stack protector to a new "secure" directorypfg2015-08-147-5/+27
| | | | | | | | | | As part of the code refactoring to support FORTIFY_SOURCE we want a new subdirectory "secure" to keep the files related to security. Move the stack protector functions to this new directory. No functional change. Differential Review: https://reviews.freebsd.org/D3333
* Make clear the bcopy(3) manpage regards when it was marked as LEGACYaraujo2015-08-141-13/+23
| | | | | | | | as well as when it was removed from POSIX specification. Reviewed by: theraven, wblock, bapt, rodrigc Approved by: bapt, rodrigc (mentor) Differential Revision: D3374
* Remove the mention of memcpy(3) that is build on top of bcopy(3).araujo2015-08-131-9/+7
| | | | | | | | | | Fix some phrases to make it more clear. Differential Revision: D3378 Reported by: bde@ Reviewed by: wblock Approved by: bapt, rodrigc (mentor) Sponsored by: gandi.net
* Describe that bcopy(3) is deprecated and marked as LEGACY inaraujo2015-08-121-1/+15
| | | | | | | | | | POSIX.1-2001 and removed from the specification in POSIX.1-2008. New softwares shall use memcpy(3) or memmove(3). Differential Revision: D3358 Reviewed by: wblock Approved by: rodrigc Sponsored by: gandi.net
* Fix and re-enable UTF-8 tests.jilles2015-08-111-1/+1
|
* Actually disable the invalid testbapt2015-08-111-1/+1
|
* Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. (part2)bapt2015-08-091-7/+1
| | | | | | Per rfc3629 value greater than 0x10ffff should be rejected Suggested by: jilles
* Remove 5 and 6 bytes sequences which are illegal in UTF-8 space.bapt2015-08-081-8/+0
| | | | | | Per rfc3629 value greater than 0x10ffff should be rejected Suggested by: jilles
* Make it possible to implement poll(2) on top of kqueue(2).ed2015-08-051-1/+9
| | | | | | | | | | | | | | It looks like EVFILT_READ and EVFILT_WRITE trigger under the same conditions as poll()'s POLLRDNORM and POLLWRNORM as described by POSIX. The only difference is that POLLRDNORM has to be triggered on regular files unconditionally, whereas EVFILT_READ only triggers when not EOF. Introduce a new flag, NOTE_FILE_POLL, that can be used to make EVFILT_READ and EVFILT_WRITE behave identically to poll(). This flag will be used by cloudlibc's poll() function. Reviewed by: jmg Differential Revision: https://reviews.freebsd.org/D3303
* Copy the fencing of the algorithm to do lock-less update and readingkib2015-08-043-16/+83
| | | | | | | | | | | | | | of the timehands, from the kern_tc.c implementation to vdso. Add comments giving hints where to look for the algorithm explanation. To compensate the removal of rmb() in userspace binuptime(), add explicit lfence instruction before rdtsc. On i386, add usual complications to detect SSE2 presence; assume that old CPUs which do not implement SSE2 also execute rdtsc almost in order. Reviewed by: alc, bde (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Fix a couple of markup typos.jhb2015-08-021-3/+3
| | | | MFC after: 2 weeks
* unlink(2): Note the possibility for ENOSPC to be returned on ZFS.bdrewery2015-07-281-1/+4
| | | | PR: 154930
* Make shutdown() return ENOTCONN as required by POSIX, part deux.ed2015-07-271-31/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: Back in 2005, maxim@ attempted to fix shutdown() to return ENOTCONN in case the socket was not connected (r150152). This had to be rolled back (r150155), as it broke some of the existing programs that depend on this behavior. I reapplied this change on my system and indeed, syslogd failed to start up. I fixed this back in February (279016) and MFC'ed it to the supported stable branches. Apart from that, things seem to work out all right. Since at least Linux and Mac OS X do the right thing, I'd like to go ahead and give this another try. To keep old copies of syslogd working, only start returning ENOTCONN for recent binaries. I took a look at the XNU sources and they seem to test against both SS_ISCONNECTED, SS_ISCONNECTING and SS_ISDISCONNECTING, instead of just SS_ISCONNECTED. That seams reasonable, so let's do the same. Test Plan: This issue was uncovered while writing tests for shutdown() in CloudABI: https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/sys/socket/shutdown_test.c#L26 Reviewers: glebius, rwatson, #manpages, gnn, #network Reviewed By: gnn, #network Subscribers: bms, mjg, imp Differential Revision: https://reviews.freebsd.org/D3039
* Update Capsicum and Mandatory Access Control manual pagestrasz2015-07-252-24/+2
| | | | | | | | | to no longer claim they are experimental. Reviewed by: rwatson@, wblock@ MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2985
* Document the fact that system(3) can easily be misused due to shell metadelphij2015-07-251-2/+14
| | | | | | | characters are honored. While I'm there also mention posix_spawn in the SEE ALSO section. MFC after: 2 weeks
* Add missing capitalization.trasz2015-07-241-1/+1
|
* Add missing priority argument in example code in BUGS section.pluknet2015-07-211-2/+2
| | | | | | PR: 201725 Submitted by: Thomas Cort MFC after: 1 week
* The si_status field of the siginfo_t, provided by the waitid(2) andkib2015-07-181-7/+9
| | | | | | | | | | | | | | | | SIGCHLD signal, should keep full 32 bits of the status passed to the _exit(2). Split the combined p_xstat of the struct proc into the separate exit status p_xexit for normal process exit, and signalled termination information p_xsig. Kernel-visible macro KW_EXITCODE() reconstructs old p_xstat from p_xexit and p_xsig. p_xexit contains complete status and copied out into si_status. Requested by: Joerg Schilling Reviewed by: jilles (previous version), pho Tested by: pho Sponsored by: The FreeBSD Foundation
* Correct the description of MADV_DONTNEED. Specifically, after usingalc2015-07-121-4/+4
| | | | | | | MADV_DONTNEED, while pages faults on the affected address range are more likely to occur, they are not guaranteed to occur. MFC after: 3 days
* Add an initial NUMA affinity/policy configuration for threads and processes.adrian2015-07-113-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on work done by jeff@ and jhb@, as well as the numa.diff patch that has been circulating when someone asks for first-touch NUMA on -10 or -11. * Introduce a simple set of VM policy and iterator types. * tie the policy types into the vm_phys path for now, mirroring how the initial first-touch allocation work was enabled. * add syscalls to control changing thread and process defaults. * add a global NUMA VM domain policy. * implement a simple cascade policy order - if a thread policy exists, use it; if a process policy exists, use it; use the default policy. * processes inherit policies from their parent processes, threads inherit policies from their parent threads. * add a simple tool (numactl) to query and modify default thread/process policities. * add documentation for the new syscalls, for numa and for numactl. * re-enable first touch NUMA again by default, as now policies can be set in a variety of methods. This is only relevant for very specific workloads. This doesn't pretend to be a final NUMA solution. The previous defaults in -HEAD (with MAXMEMDOM set) can be achieved by 'sysctl vm.default_policy=rr'. This is only relevant if MAXMEMDOM is set to something other than 1. Ie, if you're using GENERIC or a modified kernel with non-NUMA, then this is a glorified no-op for you. Thank you to Norse Corp for giving me access to rather large (for FreeBSD!) NUMA machines in order to develop and verify this. Thank you to Dell for providing me with dual socket sandybridge and westmere v3 hardware to do NUMA development with. Thank you to Scott Long at Netflix for providing me with access to the two-socket, four-domain haswell v3 hardware. Thank you to Peter Holm for running the stress testing suite against the NUMA branch during various stages of development! Tested: * MIPS (regression testing; non-NUMA) * i386 (regression testing; non-NUMA GENERIC) * amd64 (regression testing; non-NUMA GENERIC) * westmere, 2 socket (thankyou norse!) * sandy bridge, 2 socket (thankyou dell!) * ivy bridge, 2 socket (thankyou norse!) * westmere-EX, 4 socket / 1TB RAM (thankyou norse!) * haswell, 2 socket (thankyou norse!) * haswell v3, 2 socket (thankyou dell) * haswell v3, 2x18 core (thankyou scott long / netflix!) * Peter Holm ran a stress test suite on this work and found one issue, but has not been able to verify it (it doesn't look NUMA related, and he only saw it once over many testing runs.) * I've tested bhyve instances running in fixed NUMA domains and cpusets; all seems to work correctly. Verified: * intel-pcm - pcm-numa.x and pcm-memory.x, whilst selecting different NUMA policies for processes under test. Review: This was reviewed through phabricator (https://reviews.freebsd.org/D2559) as well as privately and via emails to freebsd-arch@. The git history with specific attributes is available at https://github.com/erikarn/freebsd/ in the NUMA branch (https://github.com/erikarn/freebsd/compare/local/adrian_numa_policy). This has been reviewed by a number of people (stas, rpaulo, kib, ngie, wblock) but not achieved a clear consensus. My hope is that with further exposure and testing more functionality can be implemented and evaluated. Notes: * The VM doesn't handle unbalanced domains very well, and if you have an overly unbalanced memory setup whilst under high memory pressure, VM page allocation may fail leading to a kernel panic. This was a problem in the past, but it's much more easily triggered now with these tools. * This work only controls the path through vm_phys; it doesn't yet strongly/predictably affect contigmalloc, KVA placement, UMA, etc. So, driver placement of memory isn't really guaranteed in any way. That's next on my plate. Sponsored by: Norse Corp, Inc.; Dell
* Since sh(1) now supports mulitbyte (only UTF-8) clarify the related BUGSbapt2015-07-111-3/+3
| | | | | | section in wordexp(3) manual page Discussed with: jilles
* Add support for makecontext. This supports up to 8 arguments as thisandrew2015-07-105-3/+129
| | | | | | | simplifies the code, these can be passed in registers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Fix markup.trasz2015-07-071-3/+3
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Remove reboot.S (part of libc). It's not needed and was actuallytrasz2015-07-074-97/+2
| | | | | | | broken - returning 0 from reboot(2) resulted in SIGBUS. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add hton and ntoh to the arm64 Symbols.map file, they exist but were notandrew2015-07-061-0/+4
| | | | exported.
* Fix sysctl(3) so it returns the intended values for all mib names inpkelsey2015-07-061-2/+14
| | | | | | | | | | the 'user' sysctl tree, which have all been coming back 0 or empty since r240176. Differential Revision: https://reviews.freebsd.org/D2945 Reviewed by: sbruno Approved by: jmallett (mentor) MFC after: 3 days
* Add fdclose(3) function.oshogbo2015-07-043-27/+134
| | | | | | | | | | This function is equivalent to fclose(3) function except that it does not close the underlying file descriptor. fdclose(3) is step forward to make FILE structure private. Reviewed by: wblock, jilles, jhb, pjd Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D2697
* Grammar and language fixes.kib2015-07-031-36/+50
| | | | | | Submitted by: wblock Review: https://reviews.freebsd.org/D2969 MFC after: 12 days
* Cleanup brk and sbrk to use the same code to find curbrk and minbrk whenandrew2015-07-023-36/+13
| | | | | | both compiling for PIC and non-PIC. Sponsored by: ABT Systems Ltd
* Document x86 machine-specific ptrace(2) requests. Provide list of thekib2015-06-301-2/+175
| | | | | | | | | ppc requests. Reviewed by: brueffer, emaste, gjb (previous version) Sponsored by: The FreeBSD Foundation Review: https://reviews.freebsd.org/D2962 MFC after: 2 weeks
* Implement fpgetmask, it's needed by Python.andrew2015-06-253-0/+49
| | | | | Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Export __flt_rounds from the arm64 libc.soandrew2015-06-251-0/+1
|
* Implement fpsetmask. Some third-party software makes use of it, for exampleandrew2015-06-243-0/+54
| | | | | | | perl. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Set the alignment of the setjmp magic values correctly. The alignment needsandrew2015-06-243-3/+3
| | | | | | | | to be before the lavel, otherwise an extra word may be added between the label and the data. Obtained from: ABT Systems Ltd Sponsored by: The FReeBSD Foundation
* fts_children: preserve errno after running close/fchdirjilles2015-06-201-5/+8
| | | | | | | PR: 200942 Submitted by: Conrad Meyer Differential Revision: https://reviews.freebsd.org/D2852 MFC after: 1 week
* new dependssjg2015-06-161-0/+1
|
* Export the ARM __aeabi_mem* functions from libc, they are needed by the gccandrew2015-06-162-8/+17
| | | | | | | from ports as it doesn't include these in the copy of libgcc it installs uses. Obtained from: ABT Systems Ltd
* Revert r284417 it is not necessary anymorebapt2015-06-151-1/+1
|
* Enforce overwritting SHLIBDIRbapt2015-06-151-1/+1
| | | | | | | | | Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere. This makes /lib being populated again. Reported by: many
* Fix name of a constant.tuexen2015-06-141-2/+2
| | | | MFC after: 3 days
* NetBSD commit log:jlh2015-06-141-8/+5
| | | | | | | | | | | | | Use a constant array for the MIB. Newer LLVM decided that mib[] warranted stack protections, with the obvious crash after the setup was done. As a positive side effect, code size shrinks a bit. I'm not sure why this hasn't bitten us yes, but it is certainly possible and there are no real drawbacks to this change anyway. Submitted by: pfg Obtained from: NetBSD MFC after: 1 week
* Add META_MODE support.sjg2015-06-132-0/+185
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-27287-1661/+5508
| |\
| * \ Merge from head@274682sjg2014-11-19177-442/+2967
| |\ \
| * \ \ Merge head from 7/28sjg2014-08-19214-4940/+1402
| |\ \ \
| * | | | Updated dependenciessjg2014-05-101-0/+1
| | | | |
| * | | | Merge from headsjg2014-05-087-22/+23
| |\ \ \ \
| * \ \ \ \ Merge headsjg2014-04-27265-3684/+5177
| |\ \ \ \ \
| * \ \ \ \ \ Merge head@256284sjg2013-10-1311-43/+197
| |\ \ \ \ \ \
OpenPOWER on IntegriCloud