summaryrefslogtreecommitdiffstats
path: root/include/unistd.h
Commit message (Collapse)AuthorAgeFilesLines
* Add dup3(), based on F_DUP2FD and F_DUP2FD_CLOEXEC fcntls.jilles2013-08-161-0/+1
| | | | | | | | I removed functionality not proposed for POSIX in Austin group issue #411. A man page (my own) and test cases will follow in later commits. PR: 176233 Submitted by: Jukka Ukkonen
* Add pipe2() system call.jilles2013-05-011-0/+1
| | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib
* Process CPU-Time Clocks option is supported, define _POSIX_CPUTIME.davidxu2012-09-101-0/+1
|
* Add a convenience macro for the returns_twice attribute, and apply it todim2012-04-291-1/+1
| | | | | | | the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). MFC after: 2 weeks
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]cperciva2011-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | Add an API for alerting internal libc routines to the presence of "unsafe" paths post-chroot, and use it in ftpd. [11:07] Fix a buffer overflow in telnetd. [11:08] Make pam_ssh ignore unpassphrased keys unless the "nullok" option is specified. [11:09] Add sanity checking of service names in pam_start. [11:10] Approved by: so (cperciva) Approved by: re (bz) Security: FreeBSD-SA-11:06.bind Security: FreeBSD-SA-11:07.chroot Security: FreeBSD-SA-11:08.telnetd Security: FreeBSD-SA-11:09.pam_ssh Security: FreeBSD-SA-11:10.pam
* Add two new system calls, setloginclass(2) and getloginclass(2). This makestrasz2011-03-051-0/+2
| | | | | | | | | it possible for the kernel to track login class the process is assigned to, which is required for RCTL. This change also make setusercontext(3) call setloginclass(2) and makes it possible to retrieve current login class using id(1). Reviewed by: kib (as part of a larger patch)
* rpc.lockd(8) WARNS cleanupuqs2010-12-201-0/+1
| | | | | | | | | - Provide function prototype for nlm_syscall - Don't assign a variable from the stack to a global var[1] - Remove unused vars Found by: clang static analyser [1] Reviewed by: dfr
* Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,davidxu2010-10-291-0/+1
| | | | | | also add sysconf() key _SC_CPUSET_SIZE to get sysctl value. Submitted by: gcooper
* Style: tabs after #definekevlo2010-08-111-1/+1
|
* Remove the Berkeley clause 3's.imp2010-02-161-5/+1
| | | | Add a few $FreeBSD$
* Phase out ttyslot(3).ed2010-01-141-1/+0
| | | | | | | | The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
* There is an optimization in chmod(1), that makes it not to call chmod(2)trasz2009-07-081-0/+1
| | | | | | | | | | | | | if the new file mode is the same as it was before; however, this optimization must be disabled for filesystems that support NFSv4 ACLs. Chmod uses pathconf(2) to determine whether this is the case - however, pathconf(2) always follows symbolic links, while the 'chmod -h' doesn't. This change adds lpathconf(3) to make it possible to solve that problem in a clean way. Reviewed by: rwatson (earlier version) Approved by: re (kib)
* Add a new 'void closefrom(int lowfd)' system call. When called, it closesjhb2009-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | any open file descriptors >= 'lowfd'. It is largely identical to the same function on other operating systems such as Solaris, DFly, NetBSD, and OpenBSD. One difference from other *BSD is that this closefrom() does not fail with any errors. In practice, while the manpages for NetBSD and OpenBSD claim that they return EINTR, they ignore internal errors from close() and never return EINTR. DFly does return EINTR, but for the common use case (closing fd's prior to execve()), the caller really wants all fd's closed and returning EINTR just forces callers to call closefrom() in a loop until it stops failing. Note that this implementation of closefrom(2) does not make any effort to resolve userland races with open(2) in other threads. As such, it is not multithread safe. Submitted by: rwatson (initial version) Reviewed by: rwatson MFC after: 2 weeks
* Various namespace cleanups, including exposing fchmod() and fchmodat()das2009-03-141-5/+4
| | | | | | | in the POSIX namespace, and hiding eaccess() and setproctitle(). Also move mknodat() from unistd.h to sys/stat.h where it belongs. The *at() syscalls are only in CURRENT, so this shouldn't cause problems.
* - Add getsid, fchdir, getpgid, lchown, pread, pwrite, truncate,das2009-03-041-26/+38
| | | | | | *at, and fexecve to the POSIX.1-2008 namespace. - Remove getwd, ualarm, usleep, and vfork from the XSI namespace. - Remove mkdtemp from the POSIX.1-2008 namespace (should be in stdlib.h).
* Move getosreldate(3) prototype from the machine generated <osreldate.h>peter2008-09-261-0/+1
| | | | | | to <unistd.h> in the BSD section. Suggested by: kib
* posix_spawn() is supported, set _POSIX_SPAWN to 200212L.davidxu2008-07-081-1/+1
|
* Turn execvpe() into an internal libc routine.ed2008-06-231-1/+0
| | | | | | | | | | | | Adding exevpe() has caused some ports to break. Even though execvpe() is a useful routine, it does not conform to any standards. This patch is a little bit different from the patch sent to the mailing list. I forgot to remove execvpe from the Symbol.map (which does not seem to miscompile libc, though). Reviewed by: davidxu Approved by: philip
* Add POSIX routines called posix_spawn() and posix_spawnp(), whichdavidxu2008-06-171-0/+1
| | | | | | | | | can be used as replacements for exec/fork in a lot of cases. This change also added execvpe() which allows environment variable PATH to be used for searching executable file, it is used for implementing posix_spawnp(). PR: standards/122051
* Add the restrict qualifiers to the pointer arguments of the readlinkat.kib2008-04-101-1/+1
|
* Correct the prototype for the faccessat().kib2008-04-011-1/+1
| | | | Reported by: ru
* Add the libc glue and headers definitions for the *at() syscalls.kib2008-03-311-0/+11
| | | | | | | Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* Added the "restrict" type-qualifier to the readlink() prototype.ru2008-02-261-1/+1
|
* Change readlink(2)'s return type and type of the last argumentru2008-02-121-1/+1
| | | | | | to match POSIX. Prodded by: Alexey Lyashkov
* _POSIX_THREAD_CPUTIME is now supported.davidxu2008-01-181-1/+1
|
* Add a feature_present(3) function which checks to see if a named kerneljhb2008-01-101-0/+1
| | | | | | feature is present by checking the kern.features sysctl MIB. MFC after: 1 week
* Forgot to commit this file: add definition for _SC_PHYS_PAGES.pjd2006-12-141-0/+3
|
* barrier and spin_lock had already been implemented in libpthread anddavidxu2005-12-021-2/+2
| | | | | libthr for a long time, set both _POSIX_BARRIERS and _POSIX_SPIN_LOCKS to 200112L.
* Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightlydelphij2005-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different from what has been offered in libc_r (the one spotted in the original PR which is found in libthr has already been removed by David's commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h): - Use POSIX standard prototype for ttyname_r, which is, int ttyname_r(int, char *, size_t); Instead of: char *ttyname_r(int, char *, size_t); This is to conform IEEE Std 1003.1, 2004 Edition [1]. - Since we need to use standard errno for return code, include errno.h in ttyname.c - Update ttyname(3) implementation according to reflect the API change. - Document new ttyname_r(3) behavior - Since we already make use of a thread local storage for ttyname(3), remove the BUGS section. - Remove conflicting ttyname_r related declarations found in libc_r. Hopefully this change should not have changed the API/ABI, as the ttyname_r symbol was never introduced before the last unistd.h change which happens a couple of days before. [1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html Requested by: Tom McLaughlin <tmclaugh sdf lonestar org> Through PR: threads/76938 Patched by: Craig Rodrigues <rodrigc crodrigues org> (with minor changes) Prompted by: mezz@
* Connect MLINKS for ttyname_r(3), and add prototype into unistd.h.delphij2005-05-111-0/+1
|
* - Declare mknod in stat.h (in addition to unistd.h), as per XSI.das2005-03-221-0/+3
| | | | | | - Use blksize_t and blkcnt_t in struct stat. - Hide non-standard fields in stat.h when !__BSD_VISIBLE. - Add restrict qualifiers in stat.h.
* According to the information on:trhodes2004-12-101-1/+6
| | | | | | | | | | | http://www.opengroup.org/onlinepubs/009695399/functions/swab.html the prototype for swab() should be in <unistd.h> and not in <string.h>. Move it, and update to match SUS. Leave the prototype in string.h for now, for backwards compat. PR: 74751 Submitted by: Craig Rodrigues <rodrigc@crodrigues.org> Discussed with: das
* Remove nfsclnt() prototype.phk2004-12-071-1/+0
|
* Add optreset to getopt.h too since NetBSD getopt_long() (but not GNU one)ache2004-02-231-0/+3
| | | | use it too.
* Try to better mimic GNU getopt.h which does not assume to make visibleache2004-02-231-0/+3
| | | | all unistd.h functions, use _GETOPT_DECLARE define for that.
* POSIX clearly states that getsubopt() should be declared in <stdlib.h>,ache2004-02-231-5/+0
| | | | not in <unistd.h>
* Change the definition of NULL on ia64 (for LP64 compilations) frommarcel2003-12-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always passed in registers on ia64, which by virtue of the generated code implicitly widens ints to longs and allows the use of an 32-bit integral type for 64-bit arguments. Subsequent arguments are passed onto the memory stack, which does not exhibit the same behaviour and consequently do not allow this. In practice this means that variadic functions taking pointers and given NULL (without cast) work as long as the NULL is passed in one of the first 8 arguments. A SIGSEGV is more likely the result if such would be done for stack-based arguments. This is due to the fact that the upper 4 bytes remain undefined. 2. All 64-bit platforms that FreeBSD supports, with the obvious exception of ia64, allow 32-bit integral types (specifically NULL) when 64-bit pointers are expected in variadic functions by way of how the compiler generates code. As such, code that works correctly (whether rightfully so or not) on any platform other than ia64, may fail on ia64. To more easily allow tweaking of the definition of NULL, this commit removes the 12 definitions in the various headers and puts it in a new header that can be included whenever NULL is to be made visible. This commit fixes GNOME, emacs, xemacs and a whole bunch of ports that I don't particularly care about at this time...
* Update gethostname() prototype to match source and standard.wollman2003-08-191-1/+1
|
* Fixed namespace pollution and unsorting of the 1003.1-1990 list inbde2003-07-011-1/+1
| | | | previous commit.
* Add a libc function execvP that takes the search path as an arguement.gordon2003-06-291-0/+1
| | | | | | | | Change execvp to be a wrapper around execvP. This is necessary for some of the /rescue pieces. It may also be more generally applicable as well. Submitted by: Tim Kientzle <kientzle@acm.org> Approved by: Silence on arch@
* o Add typedef for off_t, pid_t, and useconds_t.mike2002-12-291-6/+17
| | | | | o Use useconds_t where appropriate. o Fix a bug in typedef for uid_t (5.0-R candidate).
* This is David Schultz's swapoff code which I am finally able to commit.dillon2002-12-151-0/+1
| | | | | | | This should be considered highly experimental for the moment. Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> MFC after: 3 weeks
* Fix XSI (X/Open) namespace support.mike2002-11-121-11/+18
|
* Create a small library function, check_utility_compat(3), to determinewollman2002-10-281-0/+1
| | | | | | | | whether a named utility should behave in FreeBSD 4.x-compatible mode or in a standard mode (default standard). The configuration is done malloc(3)-style, with either an environment variable or a symlink. Update expr(1) to use this new interface.
* Update limits and configuration parameters for 1003.1/TC1/D6.wollman2002-10-271-0/+3
| | | | | | | | | | | Implement new sysconf keys. Change the implenentation of _SC_ASYNCHRONOUS_IO in preparation for the next set of changes. Move some limits which had been in <sys/syslimits.h> to <limits.h> where they belong. They had only ever been in syslimits.h to provide for the kernel implementation of the CTL_USER MIB branch, which went away with newsysctl years ago. (There is a #error in <sys/syslimits.h> which I will downgrade in the next commit.)
* Move the _POSIX_VERSION constant from <unistd.h> to <sys/unistd.h>, somike2002-10-131-2/+1
| | | | that it can be used in-kernel for a sysctl.
* Back down to 1003.2-1992 for the time being -- it is causing too manywollman2002-09-251-1/+1
| | | | headaches for common but deprecated uses of standard utilities.
* o Move select() helper macros from <sys/types.h> to <sys/select.h>.mike2002-09-231-0/+5
| | | | | | | | | | o Include <sys/select.h> from <sys/types.h> in the __BSD_VISIBLE case, so applications and base software can be slowly updated. o Prototype select() in <sys/select.h>. It was previously only prototyped in <unistd.h>. o Add some XXX's to <sys/types.h>. Reviewed by: -standards
* Define constants for those POSIX options and option groups which arewollman2002-09-211-18/+237
| | | | | | | | | | | | | | | | | (or would be) implemented (or not) exclusively in user-land. A threads expert should check over the values I have set to make sure that they correctly reflect reality. Move all sysconf() keys here from <sys/unistd.h> as they are not implemented in the kernel. Add new keys from 1003.1-2001 final text. (Some additional keys are expected in TC1.) Add some protection against redundant declarations between <stdlib.h> and <unistd.h> for some functions which XSI requires in the former and BSD traditionally declares in the latter. Restrict qualifiers and other changes from 1003.1-2001 have not been made to the functions prototyped here. (3 of 5)
* Style: One space between "restrict" qualifier and "*".tjr2002-09-061-2/+2
|
OpenPOWER on IntegriCloud