summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add missing capitalization.trasz2015-07-241-1/+1
|
* 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
* Fix markup.trasz2015-07-071-3/+3
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Grammar and language fixes.kib2015-07-031-36/+50
| | | | | | Submitted by: wblock Review: https://reviews.freebsd.org/D2969 MFC after: 12 days
* 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
* 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
* Various updates to the ftruncate(2) documentation:jhb2015-05-041-7/+19
| | | | | | | | | | | | | | | | | - Note that ftruncate(2) can operate on shared memory objects and cross reference shm_open(2). - Note that ftruncate(2) does not change the file position pointer (aka seek pointer) of the file descriptor. - ftruncate(2) will fail with EINVAL for all sorts of other fd types than just sockets, so instead note that it fails for all but regular files and shared memory objects. - Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2). (Or at least the manpage for both appeared in 4.2, I did not check the kernel code itself to see if either predated 4.2.) PR: 199472 (2) Submitted by: andrew@ugh.net.au (2) MFC after: 1 week
* Partially revert r255486, the first argument to socketpair() is a socketjhb2015-05-041-4/+4
| | | | | | | | | domain, not a file descriptor. Use 'domain' instead of the original 'd' for this argument to match socket(2). PR: 199491 Reported by: sp55aa@qq.com MFC after: 1 week
* fork(2): Add a note to the effect that kqueue descriptors, unlike othermarkj2015-05-021-2/+5
| | | | | | | descriptor types, are not inherited from the parent process. Reported by: kmacy MFC after: 1 week
* Escape "Ed"bapt2015-04-261-1/+1
|
* Reassign copyright statements on several files from Advancedjhb2015-04-232-2/+2
| | | | | | | Computing Technologies LLC to Hudson River Trading LLC. Approved by: Hudson River Trading LLC (who owns ACT LLC) MFC after: 1 week
* The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andkib2015-04-189-404/+7
| | | | | | | | | | | | | | | | | | | | | | | | pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. For COMPAT32, the syscalls were under COMPAT6 already. Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to (partially) disable the removed shims. Reviewed by: jhb, imp (previous versions) Discussed with: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Make wait6(2), waitid(3) and ppoll(2) cancellation points. Thekib2015-04-184-0/+107
| | | | | | | | | waitid() function is required to be cancellable by the standard. The wait6() and ppoll() follow the other syscalls in their groups. Reviewed by: jhb, jilles (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Remove obsolete bits about maximum number of file systems.pluknet2015-04-121-6/+1
| | | | | | NMOUNT has gone together with static mount table in 4.3BSD-Reno. MFC after: 1 week
* vfork() first appeared in 3BSD which pre-dates 2.9BSD. Verified via thejhb2015-04-061-2/+2
| | | | | | | copy of 3BSD on disc 1 of "The CSRG Archives". PR: 198612 MFC after: 1 week
* libc: Eliminate duplicate copies of __vdso_gettc.cemaste2015-04-021-0/+48
| | | | | 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-011-3/+0
| | | | | | | | | 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
* Make kevent(2) a cancellation point.kib2015-03-294-2/+78
| | | | | | | | | | | | | | | | | | | | | 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
* 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
* 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...
* Unbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signalmarius2015-02-161-1/+7
| | | | | | | trampoline as part of the MD __sys_sigaction again. Submitted by: kib (initial versions) MFC after: 3 days
* Properly interpose libc spinlocks, was missed in r276630. Inkib2015-02-141-0/+2
| | | | | | | | 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
* Remove useless comment.trasz2015-02-071-6/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add futimens and utimensat system calls.jilles2015-01-235-0/+506
| | | | | | | | | | | | | | 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
* Reduce the size of the interposing table and amount ofkib2015-01-112-11/+2
| | | | | | | | | | | | | | | | | 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
* Document CPU_WHICH_DOMAIN and bump Dd for cpuset.1.jhb2015-01-081-1/+2
| | | | Missed in: r276829
* Avoid calling internal libc function through PLT or accessing datakib2015-01-052-5/+12
| | | | | | | | | 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
* Fix known issues which blow up the process after dlopen("libthr.so")kib2015-01-0336-20/+1707
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* Various mdoc fixes and a few EOL whitespace removals.brueffer2014-12-2110-19/+20
| | | | Found with: mandoc -Tlint
* 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
* 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
* Revert r274772: it is not valid on MIPSemaste2014-11-252-2/+2
| | | | Reported by: sbruno
* 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.
* Use canonical __PIC__ flagemaste2014-11-212-2/+2
| | | | | | | | 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
* Add the ppoll() system call.dchagin2014-11-133-2/+70
| | | | | | | | Export kern_poll() needed by an upcoming Linuxulator change. Differential Revision: https://reviews.freebsd.org/D1133 Reviewed by: kib, wblock MFC after: 1 month
* <sys/param.h> is a superset of <sys/types.h> and must always comedes2014-11-011-2/+1
| | | | | | | first. Coincidentally, today is the 11th anniversary of this man page's (and this bug's) first appearance in FreeBSD. MFC after: 3 days
* Slightly improve grammar in EAGAIN description.gavin2014-10-151-3/+3
| | | | | | PR: 176806 Submitted by: Jeremy Chadwick MFC after: 3 days
* accept(2) may and can return EAGAIN, document it.delphij2014-10-101-2/+2
| | | | MFC after: 1 week
* Document [EPERM] for UNIX sockets.bdrewery2014-09-301-1/+3
| | | | MFC after: 2 weeks
* - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteenjhb2014-09-171-14/+1
| | | | | | | | years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it. Submitted by: alc (2)
OpenPOWER on IntegriCloud