summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/setmode.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r315162:pfg2017-04-071-1/+1
| | | | | | | | libc: provide some bounds-checking through reallocarray(3). reallocarray(3) is a non portable extension that originated in OpenBSD. Given that it is already in FreeBSD's libc it is useful for the cases where reallocation involves a multiplication.
* MFC r315095, r315096, r315097, r315187:pfg2017-03-151-2/+2
| | | | | | | | | | | | | | | | libc: small cleanups. Rename nitems to numitems: it shares the anme with an existing macro in sys/params.h. Also initialize the value later which avoids asigning the value if we exit early. Unsign setlen: it is local and will never be negative. Having one more bit for growth is beneficial and it avoids a cast when it's going to be used for allocation. Remove unused initialization: "num" is properly defined before use. Let calloc(3) do the multiplication.
* Switch libc from using _sig{procmask,action,suspend} symbols, whichkib2015-08-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. Since e.g. _sigaction is not interposed by libthr, calling signal() removes thr_sighandler() from the handler slot etc. The result was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French <petefrench@ingresso.co.uk> Tested by: Michiel Boland <boland37@xs4all.nl> Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* setmode(): Use sysctl kern.proc.umask instead of umask() if possible.jilles2015-03-261-9/+33
| | | | | The kern.proc.umask.<pid> sysctl allows querying the umask without temporarily modifying it.
* setmode(3): Make sure that setmode sets errno on failure.pfg2015-02-221-18/+32
| | | | | | | | | | Our man page already documented this partially but now we have some consistent behavior. PR: 136669 Obtained from: NetBSD (CVS rev. 1.31, 1.33) Relnotes: yes MFC after: 3 weeks
* tab vs spaces.pfg2015-02-201-2/+2
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Use prototypes in the function definitions.stefanf2005-04-081-14/+5
|
* More changes from NetBSD:mikeh2003-02-231-9/+11
| | | | | | | | * use correct error detection of realloc failure * strtol negative return check * use strtol to validate string instead of rolling our own validation code * terminate the command sequence correctly
* Grab some changes from NetBSD:mikeh2003-02-231-5/+6
| | | | | | fix const poisoning add cast to silence warning pull in unistd.h
* * Remove __P and convert to ANSI prototypes.obrien2002-02-011-19/+17
| | | | | * Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's.
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Add unsigned char cast to isdigitache1999-11-041-1/+1
|
* If `who' was not specified, set the appropriate bits as the chmod(1)ru1999-09-221-2/+6
| | | | | | manual page states. `chmod +s foo' and `chmod +t foodir' now work. PR: 13889
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-221-3/+3
|
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+453
OpenPOWER on IntegriCloud