summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace use of the pipe(2) system call with pipe2(2) with a zero flagsbrooks2016-06-223-1/+53
| | | | | | | | | | | | | | | | value. This eliminates the need for machine dependant assembly wrappers for pipe(2). It also make passing an invalid address to pipe(2) return EFAULT rather than triggering a segfault. Document this behavior (which was already true for pipe2(2), but undocumented). Reviewed by: andrew Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6815
* utimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2).jilles2016-06-091-2/+15
| | | | | | | Setting time by seconds or microseconds may cause unexpected effects especially if sysctl vfs.timestamp_precision=3 (not default). Calling the obsolete functions with NULL timestamps is acceptable.
* Introduce the PD_CLOEXEC for pdfork(2).oshogbo2016-06-081-1/+5
| | | | Reviewed by: mjg
* Fix markup.kib2016-06-041-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* Improve errno documentation in pthread_create(3) and thr_new(2)vangyzen2016-06-032-4/+11
| | | | | | | | | | Add some missing errno values to thr_new(2) and pthread_create(3). In particular, EDEADLK was not documented in the latter. While I'm here, improve some English and cross-references. Reviewed by: kib Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6663
* thr_*(2): Add xrefs to what libthr implements using each syscall.jilles2016-06-015-8/+29
| | | | | | | | | | | Add text to thr_exit(2) and thr_new(2) discouraging their use in applications since calling these in a process with libthr loaded will confuse libthr and is likely to cause hangs or crashes. The thr_kill2(2) call is not used by libthr and may be useful in special applications. The other calls can be used in applications but it should not be necessary.
* Document behavior of wait introduced in the r286698.oshogbo2016-06-011-1/+9
| | | | | | Suggested by: glebius Reviewed by: wblock, bjk Differential Revision: https://reviews.freebsd.org/D6080
* Mark jail(2), and the sysctls that it (and only it) uses as deprecated.jamie2016-05-301-1/+1
| | | | jail(8) has long used jail_set(2), and those sysctl only cause confusion.
* _umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE.jilles2016-05-291-1/+15
|
* _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes.jilles2016-05-296-60/+73
|
* vfork(2): Mention some risks of calling vfork() from application code.jilles2016-05-221-12/+28
| | | | MFC after: 1 week
* Document _umtx_op(2) interface for the implementation of robust mutexes.kib2016-05-191-12/+183
| | | | | | | | In libthr(3), list added knobs. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6427
* Add thr*.2 and _umtx_op.2 manpages to the build.kib2016-05-141-1/+8
| | | | Sponsored by: The FreeBSD Foundation
* Document the non-obsoleted kernel interfaces used by libthr.kib2016-05-146-0/+1858
| | | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6335
* Correct wording.kib2016-05-031-1/+1
| | | | | Submitted by: David A. Bright MFC after: 2 weeks
* Add EVFILT_VNODE open, read and close notifications.kib2016-05-031-8/+26
| | | | | | | While there, order EVFILT_VNODE notes descriptions alphabetically. Based on submission, and tested by: Vladimir Kondratyev <wulf@cicgroup.ru> MFC after: 2 weeks
* Issue NOTE_EXTEND when a directory entry is added to or removed fromkib2016-05-021-2/+8
| | | | | | | | the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported. Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru> MFC after: 2 weeks
* As a reader service, explain NOTE_LINK reporting for the directories.kib2016-05-011-0/+4
| | | | | Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru> MFC after: 1 week
* Provide an example to the kqueue man page, showingbcr2016-05-011-1/+52
| | | | | | | | | | | | | 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 MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D6082
* libc: spelling fixes.pfg2016-04-301-1/+1
| | | | Mostly on comments.
* Document KTRFAC_FAULT and KTRFAC_FAULTEND.brooks2016-03-311-1/+3
| | | | | | Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c) MFC after: 1 week Sponsored by: DARPA, AFRL
* Fix bunch of .Xrs.trasz2016-03-281-1/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fully handle size_t lengths in AIO requests.jhb2016-03-212-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, update the return types of aio_return() and aio_waitcomplete() to ssize_t. POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason. aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int. Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value. Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. aio_read/write should now honor the same length limits as normal read/write. Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned. Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file.
* Use the right argumant namejulian2016-03-181-1/+1
| | | | | MFC after: 1 week Sponsored by: Panzura inc
* Remove Symbol.map entries for old AIO system calls for FreeBSD 6 compat.jhb2016-03-121-9/+0
| | | | | | | | | | | These entries should have never been present since they only exist for compat with FreeBSD 6.x (and older) binaries. This was missed in r296572. Technically this breaks the ABI by removing versioned symbols. However, no binaries should be linked against these symbols. No release has shipped with a header that contained a prototype for these functions. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5615
* Fix spelling of MAXNAMLEN.trasz2016-03-091-2/+2
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* kenv(8) -> kenv(1)trasz2016-02-291-1/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* sysconf(2) -> sysconf(3)trasz2016-02-291-1/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Bump .Dd for r295764bjk2016-02-181-3/+3
| | | | Also fix a spelling and grammar nit while here.
* Right now, the "virtual hole" API feature of lseek(2) is very vaguelysobomax2016-02-181-4/+12
| | | | | | | | | | | documented and easy to miss. At the same time, it's pretty important for anyone who is trying to use SEEK_HOLE/SEEK_DATA in real app. Try to bridge that gap by making that description more pronounced and also document how it affects failure codes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5162
* Remove man page references to rndassociates.com, which has been taken overjamie2016-02-101-1/+0
| | | | by a domain squatter.
* If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbolskib2016-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | do not participate in the global symbols namespace, but rtld locks are still replaced and functions are interposed. In particular, __pthread_map_stacks_exec is resolved to the libc version. If a library is loaded later, which requires adjustment of the stack protection mode, rtld calls into libc __pthread_map_stacks_exec due to the symbols scope. The libc version might recurse into binder and recursively acquire rtld bind lock, causing the hang. Make libc __pthread_map_stacks_exec() interposed, which synchronizes rtld locks and version of the stack exec hook when libthr loaded, regardless of the symbol scope control or symbol resolution order. The __pthread_map_stacks_exec() symbol is removed from the private version in libthr since libc symbol now operates correctly in presence of libthr. Reported and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* semget(2): Add missing [EINVAL] conditions.jilles2016-02-071-1/+12
| | | | PR: 206927
* - connect(2) Clarify namelenjgh2016-02-041-1/+9
| | | | | | | | PR: 206838 Submitted by: t@tobik.me Approved by: bcr (mentor) MFH: after 1 week Differential Revision: https://reviews.freebsd.org/D5194
* Add implementations of sendmmsg(3) and recvmmsg(3) functions whichkib2016-01-293-20/+135
| | | | | | | | | | | | | | | | | | wraps sendmsg(2) and recvmsg(2) into batch send and receive operation. The goal of this implementation is only to provide API compatibility with Linux. The cancellation behaviour of the functions is not quite right, but due to relative rare use of cancellation it is considered acceptable comparing with the complexity of the correct implementation. If functions are reimplemented as syscalls, the fix would come almost trivial. The direct use of the syscall trampolines instead of libc wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on cancellation. Submitted by: Boris Astardzhiev <boris.astardzhiev@gmail.com> Discussed with: jilles (cancellation behaviour) MFC after: 1 month
* Restore flushing of output for revoke(2) again. Document revoke()'skib2016-01-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intended behaviour in its man page. Simplify tty_drain() to match. Don't call ttydevsw methods in tty_flush() if the device is gone since we now sometimes call it then. The flushing was supposed to be implemented by passing the FNONBLOCK flag to VOP_CLOSE() for revoke(). The tty driver is one of the few that can block in close and was one of the fewer that knew about this. This almost worked in FreeBSD-1 and similarly in Net/2. These versions only almost worked because there was and is considerable confusion between IO_NDELAY and FNONBLOCK (aka O_NONBLOCK). IO_NDELAY is only valid for VOP_READ() and VOP_WRITE(). For other VOPs it has the same value as O_SHLOCK. But since vfs_subr.c and tty.c consistently used the wrong flag and the O_SHLOCK flag is rarely set, this mostly worked. It also gave the feature than applications could get the non-blocking close by abusing O_SHLOCK. This was first broken then fixed in 1995. I changed only the tty driver to use FNONBLOCK, as a hack to get non-blocking via the normal flag FNONBLOCK for last closes. I didn't know about revoke()'s use of IO_NDELAY or change it to be consistent, so revoke() was broken. Then I changed revoke() to match. This was next broken in 1997 then fixed in 1998. Importing Lite2 made the flags inconsistent again by undoing the fix only in vfs_subr.c. This was next broken in 2008 by replacing everything in tty.c and not checking any flags in last close. Other bugs in draining limited the resulting unbounded waits to drain in some cases. It is now possible to fix this better using the new FREVOKE flag. Just restore flushing for revoke() for now. Don't restore or undo any hacks for ordinary last closes yet. But remove dead code in the 1-second relative timeout (r272789). This did extra work to extend the buggy draining for revoke() for as long as possible. The 1-second timeout made this not very long by usually flushing after 1 second. Submitted by: bde MFC after: 2 weeks
* mdoc: sort Xrjoel2016-01-181-1/+1
|
* utimensat(2): Correct description of [EINVAL] error.jilles2016-01-171-3/+6
| | | | MFC after: 4 days
* - Add the 'restrict' type qualifier to match function prototype.kevlo2016-01-141-4/+3
| | | | - Remove sys/types.h.
* Update futimens/utimensat for MFC to stable/10:jilles2016-01-123-4/+10
| | | | | | | | | | * Fix __FreeBSD_version check. * Update history section in man page. An MFC of this commit to stable/10 will allow using the new system calls instead of the fallback. MFC after: 3 days
* New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 andglebius2016-01-081-32/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | up to now. The new sendfile is the code that Netflix uses to send their multiple tens of gigabits of data per second. The new implementation features asynchronous I/O, when I/O operations are launched, but not awaited to be complete. An explanation of why such behavior is beneficial compared to old one is going to be too long for a commit message, so we will skip it here. Additional features of new syscall are extra flags, which provide an application more control over data sent. The SF_NOCACHE flag tells kernel that data shouldn't be cached after it was sent. The SF_READAHEAD() macro allows to specify readahead size in pages. The new syscalls is a drop in replacement. No modifications are required to applications. One can take nginx binary for stable/10 and run it successfully on head. Although SF_NODISKIO lost its original sense, as now sendfile doesn't block, and now means something completely different (tm), using the new sendfile the old way is absolutely safe. Celebrates: Netflix global launch! Sponsored by: Nginx, Inc. Sponsored by: Netflix Relnotes: yes
* Document the recently added support for ptrace(2) LWP events.jhb2015-12-301-1/+38
|
* Verify that tv_sec value specified in settimeofday() and clock_settime()dchagin2015-12-272-2/+8
| | | | | | | | | | | | | | (CLOCK_REALTIME case) system calls is non negative. This commit hides a kernel panic in atrtc_settime() as the clock_ts_to_ct() does not properly convert negative tv_sec. ps. in my opinion clock_ts_to_ct() should be rewritten to properly handle negative tv_sec values. Differential Revision: https://reviews.freebsd.org/D4714 Reviewed by: kib MFC after: 1 week
* clock_gettime(2),gettimeofday(2): Remove [EFAULT] error.jilles2015-12-202-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 after: 1 week
* Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h.kevlo2015-12-155-10/+5
|
* Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h.kevlo2015-12-152-4/+2
| | | | Reviewed by: bde
* Start on a new library (libsysdecode) that provides routines for decodingjhb2015-12-151-2/+3
| | | | | | | | | | | | | | | | | system call information such as system call arguments. Initially this will consist of pulling duplicated code out of truss and kdump though it may prove useful for other utilities in the future. This commit moves the shared utrace(2) record parser out of kdump into the library and updates kdump and truss to use it. One difference from the previous version is that the library version treats unknown events that start with the "RTLD" signature as unknown events. This simplifies the interface and allows the consumer to decide how to handle all non-recognized events. Instead, this function only generates a string description for known malloc() and RTLD records. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4537
* cpuset.9: Link to/from the new pagecem2015-10-202-4/+6
| | | | | | A follow-up to r289667. Sponsored by: EMC / Isilon Storage Division
* Switch pl_child_pid from int to pid_t.jhb2015-10-201-2/+2
| | | | | | Reviewed by: emaste, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3857
* Change the default setting of kern.ipc.shm_allow_removed from 0 to 1.trasz2015-10-101-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need for manually changing this flag for Google Chrome users. It also improves compatibility with Linux applications running under Linuxulator compatibility layer, and possibly also helps in porting software from Linux. Generally speaking, the flag allows applications to create the shared memory segment, attach it, remove it, and then continue to use it and to reattach it later. This means that the kernel will automatically "clean up" after the application exits. It could be argued that it's against POSIX. However, SUSv3 says this about IPC_RMID: "Remove the shared memory identifier specified by shmid from the system and destroy the shared memory segment and shmid_ds data structure associated with it." From my reading, we break it in any case by deferring removal of the segment until it's detached; we won't break it any more by also deferring removal of the identifier. This is the behaviour exhibited by Linux since... probably always, and also by OpenBSD since the following commit: revision 1.54 date: 2011/10/27 07:56:28; author: robert; state: Exp; lines: +3 -8; Allow segments to be used even after they were marked for deletion with the IPC_RMID flag. This is permitted as an extension beyond the standards and this is similar to what other operating systems like linux do. MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3603
OpenPOWER on IntegriCloud