summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* un-vax;jmc2016-03-101-17/+2
|
* We are done providing support for the vax.deraadt2016-03-0954-2782/+6
| | | | lots of agreement.
* The range of PIDs has changed, and always included zero.guenther2016-03-061-3/+3
| | | | Based on diff from Michal Mazurek (akfaew (at) jasminek.net)
* No more compat emulations, so remove ktrace EMUL records and the baggageguenther2016-03-061-4/+2
| | | | | | for generating and parsing them. ok mpi@ naddy@ millert@ deraadt@
* Document the PT_GET_THREAD_{FIRST,NEXT} requestsguenther2016-03-061-2/+24
| | | | From Michal Mazurek (akfaew (at) jasminek.net)
* KNF this file; OK stsp@millert2016-03-011-350/+349
|
* Add NET_RT_IFNAMES; OK deraadt@tim2016-02-291-1/+2
|
* __tfork is section 3, not 2;jmc2016-02-291-2/+2
|
* delete the kern.emul/KERN_EMUL sysctl bits since there are nonaddy2016-02-291-27/+2
| | | | emulations left; ok millert@ deraadt@, jmc@ (man pages)
* fruncate() returns EFBIG when length exceeds the max file size.natano2016-02-281-2/+6
| | | | ok mpi@
* Fix STANDARDS: use the appropriate .St argument and add the informationschwarze2016-02-271-5/+8
| | | | that setting errno is required by POSIX, but not by ISO C.
* If an incomplete character is passed to mbtowc(3), set errno to EILSEQ.schwarze2016-02-271-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is unambiguously required both by POSIX and by our own manual page. It also makes a lot of sense because having a function that can fail and that sets errno in some failure modes but does not set errno in other failure modes would be a terrible idea. Such a function would be ridiculously complicated to use. To detect the reason for failure, you would have to: - save errno - reset errno to zero - call the function - inspect the return value to detect failure - inspect errno to decide about the reason for failure - if errno is zero, restore the saved errno That is completely unreasonable, in particular for a seemingly innocous function like mbtowc(3). Next to no programmer would get that right in any real-world program. Note that this bug is very widespread, it also affects NetBSD, FreeBSD, Solaris 11, and glibc. I will also send a note around to the other systems. There may be fallout from programs using the interface incorrectly. If you run into any, please report that to me. OK millert@
* Fix negation of POSIX character classes; passed new regress test.millert2016-02-261-4/+10
| | | | OK tb@
* refactor option letter parsing into a subfunction, to increase clarityderaadt2016-02-251-93/+102
| | | | | about which options are turned on/off by 's' and 'S' ok tedu
* Avoid a possible double-free if the "search" keyword is used multiple times.eric2016-02-241-2/+4
| | | | ok jca@ gilles@
* Document sendsyslog2(2) in man page.bluhm2016-02-221-4/+29
| | | | from Rafael Neves; input jmc@; OK deraadt@
* Remove the "error" variable; we no longer fall back to writing tomillert2016-02-191-5/+5
| | | | | /dev/console so the value of "error" is never read. Also mention that sendsyslog2 can fail due to ENOBUFS in the comment. OK deraadt@
* Dv fix;jmc2016-02-131-2/+3
|
* Fix an obvious cut-and-paste error:schwarze2016-02-131-4/+3
| | | | | This function doesn't even have an "n" argument, so that non-existent argument clearly cannot restrict the return value.
* Document how to use sndio in pledged programs.tim2016-02-111-2/+20
| | | | Input and OK jmc@ ratchov@ semarie@
* new sentence, new line;jmc2016-02-081-2/+3
|
* mention mktime, since that is where struct tm is described. ok schwarzetedu2016-02-082-5/+9
|
* Align with reality, and with POSIX: For this particular function,schwarze2016-02-081-7/+3
| | | | | | incomplete characters are not an error, do not throw EILSEQ, and are not supposed to. OK millert@
* compare pointer to NULL in example codemmcc2016-02-071-3/+3
|
* be more forceful about not using these.espie2016-02-052-9/+28
| | | | improvements sthen@, jmc@. okay millert@, jca@ jmc@
* Fix err(3) calls after allocation failures in examples.schwarze2016-02-051-8/+8
| | | | | | There is long-standing consensus that err(1, NULL) is the best idiom after failure of malloc(3) and friends. Quirk in the manual noticed by tb@.
* avoid an uninitialised value in a return path added in rev 1.5jsg2016-02-051-2/+4
| | | | ok tobias@
* sigsuspend is section 2, not 3.jmc2016-01-281-2/+2
|
* The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),schwarze2016-01-282-12/+7
| | | | | | | | | | | | but it is likely to remain in POSIX for the forseeable future, and there is nothing wrong with using it, so remove the marker. By contrast, POSIX 2008 now declared setitimer(3) obsolescent. While here, remove a few cross references pointing to obsolete or non-standard functions and update the POSIX reference. Triggered by a question from <ChrisBennett at bennettconstruction dot us>. OK millert@ tb@
* Don't crash dumping malloc stats if malloc_init hasn't been called, noted byotto2016-01-261-1/+3
| | | | David CARLIER
* When encoding fails in fputwc(3), set the error indicator as requiredschwarze2016-01-261-2/+2
| | | | | | | | | | | | | | | | by POSIX and as FreeBSD, SunOS 10/11, and glibc also do it. Note that an enquiry to the Austin Group led to the conclusion that this change probably violates the C standard: C and POSIX unintentionally conflict. But the POSIX behaviour makes more sense (easier to write correct error handling code for it, and a lower risk that programs miss errors) and is much more widespread, and the Austin Group intends to approach the C committee in order to adjust the C standard. See: http://austingroupbugs.net/view.php?id=1022 While here, do not set errno a second time, wcrtomb(3) already did that, and it is required to do it by the standard. OK millert@ and tedu@, and jca@ no longer objects
* replace (void *)0 with NULLmmcc2016-01-191-4/+4
|
* remove a nop assignment that has been #if 0'd since 1996mmcc2016-01-191-5/+1
| | | | ok millert@
* adjust some syscalls in proc & id; from Carlin Binghamderaadt2016-01-181-5/+9
|
* Replace "function call" with "function" when referring to a functionmmcc2016-01-091-3/+3
| | | | | | | (well, a syscall, but this is the established practice) in the general sense. ok jmc@
* drop "abort" promise, and make it the default behaviour.semarie2016-01-091-3/+3
| | | | | | | | | The current code has already setted it by default since 1.74 any pledge failure tries to make a coredump (default rules for coredump still applies: so setuid binaries don't create them locally). ok deraadt@
* add a bug that the path whitelist is not available at this time.tedu2016-01-061-2/+4
|
* Long ago, malloc internally had two kinds of failures, warnings and errors.tedu2016-01-062-14/+7
| | | | | | | | The 'A' option elevated warnings to errors, and has been the default for some time. Then warnings were effectively eliminated in favor of everything being an error, but then the 'a' flag turned real errors into warnings! Remove the 'a' option entirely. You shouldn't have used it anyway. ok tb tdeval
* Use "path" not "file" as the function arg to utimes() and utimensat().millert2016-01-051-8/+8
| | | | The DESCRIPTION section already referred to "path" in some places.
* Follow style(9) and drop lint /* NOTREACHED */ annotations fromtb2016-01-042-6/+4
| | | | | | | | the examples. Diff from Juuso Lapinlampi < wub () partyvan ! eu >, thanks! ok schwarze@
* Bugfix: When errno happens to be EILSEQ upon entry to fgetws(3),schwarze2016-01-041-3/+3
| | | | | | | and when the file ends without a terminating Ln character, fgetws(3) discarded any characters read and reported bogus EOF. Never inspect errno(2) unless right after an error occurred! OK millert@
* Fix lots of bugs.schwarze2016-01-041-18/+28
| | | | | | | | | | | | | | | | | | | | | 1. When fprintf(fp, "...%ls...", ...) encounters an encoding error, do not destroy all the fp->_flags, which made the file permanently unreadable and unwriteable. 2. Do not change fp->_flags at all in case of encoding errors. Neither the manual nor POSIX ask for it, no other conversions set the error indicator, and it isn't needed because the return value reports failure and must be checked anyway. 3. Detect failure in mbrtowc(3), do not silently treat invalid bytes in the format string as the end of the format string. 4. Detect failure of __find_arguments(), no matter whether due to out of memory conditions or encoding errors, and gracefully fail rather than accessing an invalid pointer. 5. Remove the pointless and slightly dangerous errno = EILSEQ overrides after functions that already do that and are required by the standard to do so. OK jca@ on items 1, 2, and 5. OK millert@ on the complete diff. "Completely brutal mix of bugs." deraadt@
* another case where bad things would happen after wrterrortedu2015-12-301-2/+4
|
* if somebody makes the mistake of disabling abort, don't deref null intedu2015-12-301-2/+4
| | | | validate_junk. from Michal Mazurek
* Verify that the section header size supplied in the ELF header is whatmmcc2015-12-291-1/+4
| | | | | | | we expect it to be. This prevents out-of-bounds access or excessive memory allocation on a malformed ELF header. Found by Serguey Parkhomovsky with AFL. Improved by and ok kettenis@
* Remove NULL-checks before free() and needless argument casts.mmcc2015-12-281-5/+3
| | | | ok tb@
* Remove NULL-checks before free() and unnecessary argument casts.mmcc2015-12-281-8/+5
| | | | ok tb@
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-2816-96/+53
| | | | ok and valuable input from millert@
* remove unused variablechl2015-12-271-2/+1
| | | | ok tedu@
* Simplify allocation logic based on free and realloc's behavior on NULL.mmcc2015-12-251-4/+3
| | | | ok tedu@