summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug where calling MD5File(3) with a zero-length file generated anbmah2002-09-061-0/+1
| | | | | | error, due to an uninitialized variable. Reviewed by: phk, archie
* Include some verbage about not calling exit() from functions registeredwollman2002-09-062-2/+24
| | | | by atexit().
* Style: One space between "restrict" qualifier and "*".tjr2002-09-0659-92/+92
|
* Don't need to install the signal trampoline here anymore.jake2002-09-031-1/+0
|
* Install the userland signal trampoline when sigaction is first called,jake2002-09-032-1/+50
| | | | | | | instead of on startup. This fixes binary compatibility of dynamically linked binaries from before the signal code move. Suggested by: wollman (a long time ago)
* Fix a nasty bug exposed by mktime() when time_t is significantly biggerpeter2002-09-031-0/+6
| | | | | | | than 32 bits. It was trying to figure out things like the day of week of when time_t is roughly 2^62 etc. Make a better guess for the starting point for the binary search that works on both 32 and 64 bit types. I have been using this for a while now.
* Set errno to EILSEQ when invalid multibyte sequences are detectedtjr2002-09-033-3/+14
| | | | (XSI extension to 1003.1-2001).
* Use FOO(a) for macros with variadic args, instead of FOO(a,) or FOO(a, ).jake2002-09-021-3/+3
| | | | Submitted by: gcc3.2
* - Let their manual pages show the reader that the bzero(3) androbert2002-09-014-22/+33
| | | | | | | | | | bcopy(3) functions are prototyped in <strings.h> and not in <string.h> anymore. - Add a sentence about that to the respective HISTORY sections. In the C source files: - Include <string.h> or <strings.h> depending on what function is to be compiled. - Use ANSI-C function definitions.
* Typo: refer to MB_LEN_MAX instead of MB_CHAR_MAX (which does not exist).tjr2002-09-011-1/+1
|
* Add restrict qualifiers to the arguments of mbstowcs, mbtowc() andtjr2002-09-014-9/+9
| | | | wcstombs().
* Fix a memory leak.mike2002-09-011-1/+3
|
* Implement the XSI extension which allows the destination string to betjr2002-08-312-6/+48
| | | | | | | NULL, and returns the number of bytes that would be required to store the result of the conversion without storing anything. PR: 17694
* Split ansi.c into a separate source file for each function.tjr2002-08-316-85/+253
|
* Use ntohl() to read cnains number in new formatache2002-08-311-2/+4
|
* Add the 'restrict' type qualifier to the function prototyperobert2002-08-301-1/+1
| | | | | of the swab(3) function in its manual page to match the standardization by POSIX.1-2001.
* - Update the manual page of bcmp(3) by replacingrobert2002-08-302-7/+12
| | | | | | | | | | .In string.h with .In strings.h and adding a sentence to the HISTORY section. - Use an ANSI-C function definition. - Include <strings.h> instead of <string.h>. - Apply style(9): Put a space after return keywords.
* Style fixache2002-08-301-3/+3
|
* - Convert the function definition to declare its argumentsrobert2002-08-301-8/+4
| | | | | | | | | | | | | | | | | | | | | | | in the ANSI-C format. - Change the code a bit to hopefully save some cycles. I.e. (simplified) change a = b + 1; while (--b & 0x7) /* ... */ to a = b; for (; b & 0x7; b--) /* ... */ and while (--a >= 0) /* ... */ to for (; a > 0; a--) /* ... */ - Equip two function arguments of swab() with the 'restrict' type qualifier in form of the '__restrict' macro. This is specified by POSIX.1-2001.
* Prepare for switching to unlimited chains format.ache2002-08-302-23/+46
| | | | Optimize chains lookup a bit.
* - Update the manual pages of index() and rindex() to showrobert2002-08-304-17/+38
| | | | | | | | | | | | | | | | | | <strings.h> as the associated header file. The prototypes have been moved there from <string.h> because POSIX.1-2001 said so. - Conditionally include either <strings.h> or <string.h> based on whether the [r]index() or str[r]chr() functions are compiled, respectively. - Style(9) tells us to - put a space after the return keyword - to check for a NUL character without using the ! operator. - use NULL instead of (type *)NULL where the compiler knows the type. Apply these rules. - Rather use ANSI-C function definitions than K&R ones. - For index(3), correct second function argument's type; it was declared to be a `const char' before and is now an `int'.
* - Update the manual page to show that the associated header filerobert2002-08-302-4/+10
| | | | | | | is <strings.h> and not <string.h> anymore. - Tell the reader about this change in the HISTORY section. - Switch to use an ANSI-C function definition. - Include <strings.h> instead of <string.h> in the source file.
* - Update strcasecmp(3)/strncasecmp(3) to reflect the fact thatrobert2002-08-302-2/+9
| | | | | | | | the prototypes for both functions are now in the <strings.h> header, as required by IEEE Std 1003.1-2001. - Add one sentence about that in the HISTORY section. - Include <strings.h> in the source file to have the prototypes in scope when the _ANSI_SOURCE macro is defined.
* Hopefully unbreak world. ke_slptime is gone. It should really have beenpeter2002-08-301-1/+1
| | | | looking at p_ksegrp.kg_slptime anyway.
* Remove much of the dereferencing of the fd table entries to lookdeischen2002-08-2939-77/+115
| | | | | | | | | | | at file flags and replace it with functions that will avoid null pointer checks. MFC to be done by archie ;-) PR: 42100 Reviewed by: archie, robert MFC after: 3 days
* Make the libc_r version of select() set the readable or writablearchie2002-08-293-12/+18
| | | | | | | | | | file descriptor bit if poll() returns POLLERR, POLLHUP, or POLLNVAL. Othewise, it's possible for select() to return successfully but with no bits set. Reviewed by: deischen MFC after: 3 days PR: bin/42175
* When poll(2)'ing for readability or writability of a file descriptorarchie2002-08-293-6/+18
| | | | | | | | on behalf of a thread, we should check the POLLERR, POLLHUP, and POLLNVAL flags as well to wake up the thread in these cases. Suggested by: deischen MFC after: 3 days
* Allow one to grab the definition of struct ucred by defining _WANT_UCREDalfred2002-08-281-2/+1
| | | | | | | instead of forcing _KERNEL. Move the include of sys/_label.h in ucred.h under the _KERNEL || _WANT_UCRED case.
* Print a '-' sign for negative zero. Tested withschweikh2002-08-271-7/+2
| | | | | | | | | | | | | | | | | | | | | #include <stdio.h> int main(void) { printf("%+f\n", -0.0); printf("%+f\n", +0.0); printf("%+f\n", 0.0); return 0; } to output -0.000000 +0.000000 +0.000000 PR: bin/41823 Submitted by: GOTO Kentaro <gotoken@notwork.org> Liked by: bde MFC after: 3 weeks
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-259-9/+9
|
* Fix a bug in __ivaliduser_sa() which caused some rsh/rlogin attemptsjdp2002-08-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | to fail needlessly if a reverse DNS lookup of the IP address didn't come up with a hostname. As a comment in the code clearly stated, the "damn hostname" was looked up only for the purpose of netgroup matching. But if that lookup failed, the function bailed out immediately even though in many cases netgroup matching would not be used. This change marks the hostname as unknown but continues. Where netgroup matching is performed, an unknown hostname is handled conservatively. I.e., for "+@netgroup" (accept) entries an unknown hostname never matches, and for "-@netgroup" (reject) entries an unknown hostname always matches. In the lines affected (only), I also fixed a few bogus casts. There are others, and in fact this entire file would be a good candidate for a cleanup sweep. Reviewed by: imp (wearing his flourescent yellow Security Team cap) MFC after: 2 days
* &x is not a format stringkris2002-08-241-1/+1
|
* Note that <sys/types.h> in no longer a prerequisite for <utime.h> andmike2002-08-248-8/+0
| | | | <sys/mman.h>.
* We cannot use an alloc with only inputs and/or locals. The kernelmarcel2002-08-231-11/+16
| | | | | | assumes that the parameters are passed in output registers. Remove the alloc entirely, but don't depend on the kernel not trashing our registers.
* Wrap the header to prevent multiple inclusion, and mark the DECLS section.jmallett2002-08-221-0/+9
| | | | Reminded by: Rachel Hestilow <hestilow@ximian.com>
* Fixed getaddrinfo to honor sortlist in /etc/resolv.confpirzyk2002-08-211-0/+82
| | | | | | | PR: bin/27939 Reviewed by: ru, sheldonh (about a year ago) Obtained from: ume (via KAME, I think) MFC after: 1 month
* s/EDOFUS/EDOOFUS/phk2002-08-213-5/+5
| | | | Persuaded by: Google
* o Merge <machine/ansi.h> and <machine/types.h> into a new headermike2002-08-2115-26/+26
| | | | | | | | | | | | | | | | | | | | | called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien
* Fix a typo in #if 0 codescottl2002-08-211-1/+1
|
* Add a manual page for wcwidth().tjr2002-08-202-1/+63
|
* Add a manual page for wcswidth().tjr2002-08-202-1/+62
|
* Move just committed version of wcswidth.c here (from "locale"),ache2002-08-202-25/+31
| | | | a bit optimized now.
* Remove wcswidth.c from here (and move it to "string")ache2002-08-202-65/+1
|
* Remove space at the end of continuation line in prev. commitache2002-08-201-1/+1
|
* xdr.3 is added to MAN in ../xdr/Makefile.inc where it belongs, so don'tbde2002-08-191-1/+1
| | | | add it here.
* Implement wcswidth()ache2002-08-192-2/+66
|
* Use modern-style arguments declarationache2002-08-191-2/+1
|
* Write null wide-character as L'\0' like in other placesache2002-08-191-1/+1
|
* According to SUSv2, always return 0 for null wide-character codeache2002-08-191-1/+6
|
* s/trailing NULL/trailing NUL/jmallett2002-08-192-2/+2
|
OpenPOWER on IntegriCloud