summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
* MFC r309026: open(2): Clarify non-POSIX error when opening a symlink withjilles2016-12-041-1/+17
| | | | | | | | | | O_NOFOLLOW. We return [EMLINK] instead of [ELOOP] when trying to open a symlink with O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code like cmp -h and xz takes advantage of this. PR: 214633
* MFC r305628: intro(2),_exit(2): Update for reaperjilles2016-10-122-5/+10
| | | | (procctl(PROC_REAP_ACQUIRE)).
* MFC r306334:kib2016-10-033-0/+244
| | | | | | | Document thr_suspend(2) and thr_wake(2). MFC r306506: Reword the statement.
* MFC r274925: misc mdoc fixes.pluknet2016-09-271-1/+0
|
* MFC r305956: Add manpage for rctl_* system callsbadger2016-09-242-0/+225
| | | | | Approved by: kib (mentor) Sponsored by: Dell Technologies
* MFC r304928:kib2016-09-033-2/+58
| | | | | | | | | | | | | Do not obliterate errno value in the main thread during ptrace(2) call on x86. MFC r304931: Follow ABI when calling __error from the ptrace(2) wrapper. MFC r305012: Rewrite ptrace(2) wrappers in C. MFC r305022: Restore the requirement of setting errno to zero before calling ptrace(2).
* MFC r305024:kib2016-09-011-41/+41
| | | | Typesetting fixes.
* MFC 304476: Fix various nits in the aio operation manpages.jhb2016-08-224-26/+15
| | | | | | | | | | | | | | | | | | - Avoid double use of "request" in a single sentence. Instead, describe aio_sigevent as being used to request notification of the associated operation's completion. This matches the language used to describe aio_sigevent in aio(4). - Simplify the prohibition on modifying buffers while requests are in flight. - Fix case mismatch. - Drop note about not using stack variables. C programmers should be able to figure out if a stack variable is safe based on the later warning about the life cycle requirements of control blocks. - Remove prohibition on modifying the I/O buffer for aio_fsync() since it does not use an I/O buffer. For aio_mlock(), prohibit modifications to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not prohibit modifications to the memory backing the buffer (stores into the pages backing the buffer).
* MFC 303001: Add PTRACE_VFORK to trace vfork events.jhb2016-08-191-0/+42
| | | | | | | | | First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-151-41/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC 292894,292896: Add ptrace(2) reporting for LWP events.jhb2016-08-121-1/+38
| | | | | | | | | | | | | | 292894: Add ptrace(2) reporting for LWP events. Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting thread creation and destruction. Newly created threads will stop to report PL_FLAG_BORN before returning to userland and exiting threads will stop to report PL_FLAG_EXIT before exiting completely. Both of these events are only enabled and reported if PT_LWP_EVENTS is enabled on a process. 292896: Document the recently added support for ptrace(2) LWP events.
* MFC 302899: Add documentation for the sigevent structure.jhb2016-07-257-22/+175
| | | | | | | | | | - Add a sigevent(3) manpage to give a general overview of the sigevent structure and the available notification mechanisms. - Document that AIO requests contain a nested sigevent structure that can be used to request completion notification. - Expand the sigevent details in other manuals to note details such as the extra values stored in a queued signal's information or in a posted kevent.
* MFC r300983:jamie2016-06-151-1/+1
| | | | | Mark jail(2), and the sysctls that it (and only it) uses as deprecated. jail(8) has long used jail_set(2), and those sysctl only cause confusion.
* MFC r300420: vfork(2): Mention some risks of calling vfork() fromjilles2016-05-291-12/+28
| | | | application code.
* MFC r298982:kib2016-05-161-8/+26
| | | | | | | Add EVFILT_VNODE open, read and close notifications. MFC r298984: Correct wording.
* MFC r298922:kib2016-05-161-2/+8
| | | | | | Issue NOTE_EXTEND when a directory entry is added to or removed from the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported.
* MFC r298898:kib2016-05-081-0/+4
| | | | Explain NOTE_LINK reporting for the directories.
* MFC r298893:bcr2016-05-061-1/+52
| | | | | | | | | | | | | Provide an example to the kqueue man page, showing a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D6082
* MFC r297475:brooks2016-04-131-1/+3
| | | | | | | Document KTRFAC_FAULT and KTRFAC_FAULTEND. Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c) Sponsored by: DARPA, AFRL
* MFC r287753: setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD).jilles2016-04-091-7/+2
|
* MFC r295384: semget(2): Add missing [EINVAL] conditions.jilles2016-04-081-1/+12
| | | | PR: 206927
* MFC r295407:kib2016-03-121-0/+1
| | | | Make libc __pthread_map_stacks_exec() interposed.
* MFC r294234: utimensat(2): Correct description of [EINVAL] error.jilles2016-01-211-3/+6
|
* MFC r293783: futimens/utimensat: Use the new system calls.jilles2016-01-153-4/+10
| | | | | | | | | Update the __FreeBSD_version check in lib/libc/sys/futimens.c and lib/libc/sys/utimensat.c. Before this, fallback code using futimes/futimesat/lutimes was used except when running on a sufficiently recent 11-current kernel. Also, update the history section in the man page.
* MFC r287964:trasz2016-01-121-0/+7
| | | | | | | | | | | | | Kernel part of reroot support - a way to change rootfs without reboot. Note that the mountlist manipulations are somewhat fragile, and not very pretty. The reason for this is to avoid changing vfs_mountroot(), which is (obviously) rather mission-critical, but not very well documented, and thus hard to test properly. It might be possible to rework it to use its own simple root mount mechanism instead of vfs_mountroot(). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2698
* MFC r277610 (by jillies):dchagin2016-01-095-0/+506
| | | | Add futimens and utimensat system calls.
* MFC r292513: clock_gettime(2),gettimeofday(2): Remove [EFAULT] error.jilles2015-12-272-8/+2
| | | | | | | | | Depending on system configuration and parameters, clock_gettime() and gettimeofday() may not be system calls. If so, passing an invalid pointer will cause a signal and not an [EFAULT] error. From a standards perspective, this is OK since passing an invalid pointer is undefined behaviour.
* MFC 289636:jhb2015-11-061-2/+2
| | | | Switch pl_child_pid from int to pid_t.
* MFC 287386,288949,288993:jhb2015-10-231-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Export current system call code and argument count for system call entry and exit events. To preserve the ABI, the new fields are moved to the end of struct thread in these branches (unlike HEAD) and explicitly copied when new threads are created. In addition, the new tests are only added in 10. r287386: Export current system call code and argument count for system call entry and exit events. procfs stop events for system call tracing report these values (argument count for system call entry and code for system call exit), but ptrace() does not provide this information. (Note that while the system call code can be determined in an ABI-specific manner during system call entry, it is not generally available during system call exit.) The values are exported via new fields at the end of struct ptrace_lwpinfo available via PT_LWPINFO. r288949: Fix various edge cases related to system call tracing. - Always set td_dbg_sc_* when P_TRACED is set on system call entry even if the debugger is not tracing system call entries. This ensures the fields are valid when reporting other stops that occur at system call boundaries such as for PT_FOLLOW_FORKS or when only tracing system call exits. - Set TDB_SCX when reporting the stop for a new child process in fork_return(). This causes the event to be reported as a system call exit. - Report a system call exit event in fork_return() for new threads in a traced process. - Copy td_dbg_sc_* to new threads instead of zeroing. This ensures that td_dbg_sc_code in particular will report the system call that created the new thread or process when it reports a system call exit event in fork_return(). - Add new ptrace tests to verify that new child processes and threads report system call exit events with a valid pl_syscall_code via PT_LWPINFO. r288993: Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.
* MFC r288092:bdrewery2015-09-291-2/+0
| | | | | Avoid adding duplicates into OBJS. bsd.lib.mk already handles adding entries to OBJS based on SRCS.
* MFC r285428alc2015-09-271-4/+4
| | | | Correct the description of MADV_DONTNEED.
* Long overdue MFC r284377:jlh2015-09-221-8/+5
| | | | | | | | | | | | | NetBSD commit log: 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 r287292:kib2015-09-053-0/+3
| | | | | | | | | | Switch libc from using _sig{procmask,action,suspend} symbols, which are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. MFC r287300: Use libthr interposed functions instead of syscalls, in posix_spawn()' child.
* MFC r286975:kib2015-08-271-2/+6
| | | | Remove the wrong asserts.
* Implement x86 ptrace(2) requests PT_{GET,SET}{FS,GS}BASE.kib2015-08-051-2/+189
| | | | | | | | | | | | | | | | | | | | | | MFC r284918: Add helper fill_based_sd(9). MFC r284919: Add x86 PT_GETFSBASE, PT_GETGSBASE machine-depended ptrace requests to obtain the thread %fs and %gs bases. Add x86 PT_SETFSBASE and PT_SETGSBASE requests to set the bases from debuggers. The set requests, similarly to the sysarch({I386,AMD64}_SET_FSBASE), override the corresponding segment registers. MFC r284965: Document x86 machine-specific ptrace(2) requests. MFC r285011: Disallow a debugger on 64bit system to set fs/gs bases of the 32bit process beyond the end of the process address space. MFC r285104: Grammar and language fixes.
* MFC r285251:trasz2015-08-021-3/+3
| | | | | | Fix markup. Sponsored by: The FreeBSD Foundation
* MFC 281887:jhb2015-06-022-2/+2
| | | | | Reassign copyright statements on several files from Advanced Computing Technologies LLC to Hudson River Trading LLC.
* MFC 282417:jhb2015-06-021-7/+19
| | | | | | | | | | | | | | | | Various updates to the ftruncate(2) documentation: - 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
* MFC 282416:jhb2015-06-021-4/+4
| | | | | | | | Partially revert r255486, the first argument to socketpair() is a socket domain, not a file descriptor. Use 'domain' instead of the original 'd' for this argument to match socket(2). PR: 199491
* MFC 281170:jhb2015-06-021-2/+2
| | | | | | | vfork() first appeared in 3BSD which pre-dates 2.9BSD. Verified via the copy of 3BSD on disc 1 of "The CSRG Archives". PR: 198612
* MFC r280983:trasz2015-05-151-3/+3
| | | | | | | Update open(2) to make it more obvious that O_NOCTTY and O_TTY_INIT are ignored. Sponsored by: The FreeBSD Foundation
* MFC r278352:trasz2015-05-151-6/+1
| | | | | | Remove useless comment. Sponsored by: The FreeBSD Foundation
* MFC r281712:kib2015-04-254-0/+107
| | | | Make wait6(2), waitid(3) and ppoll(2) cancellation points.
* 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 r280818:kib2015-04-124-2/+78
| | | | Make kevent(2) a cancellation point.
* MFC r280959:kib2015-04-081-3/+0
| | | | Correctly handle __fcntl_compat symbol for the !SYSCALL_COMPAT case.
* MFC r272291:bdrewery2015-04-031-1/+3
| | | | Document [EPERM] for UNIX sockets.
* Merge r263842 from HEAD to stable/10:rwatson2015-03-194-8/+8
| | | | | | Update system man pages for s/capability.h/capsicum.h/. Sponsored by: Google, Inc.
* MFC: r278870marius2015-02-241-1/+7
| | | | | | | | 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 r278751:kib2015-02-171-0/+2
| | | | Properly interpose libc spinlocks, was missed in r276630.
OpenPOWER on IntegriCloud