summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Sync prototypes with <wchar.h> with respect to the restrict qualifier.Tim J. Robbins2002-09-071-6/+6
| | | | Notes: svn path=/head/; revision=103060
* Add restrict qualifiers where C99 permits them. All of these already hadTim J. Robbins2002-09-076-12/+12
| | | | | | | restrict qualifiers on their prototypes in <wchar.h>. Notes: svn path=/head/; revision=103059
* Call strtok_r() via a libc private name from within strtok().Tim J. Robbins2002-09-071-2/+6
| | | | Notes: svn path=/head/; revision=103057
* Include some verbage about not calling exit() from functions registeredGarrett Wollman2002-09-062-2/+24
| | | | | | | by atexit(). Notes: svn path=/head/; revision=103036
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-0659-92/+92
| | | | Notes: svn path=/head/; revision=103012
* Install the userland signal trampoline when sigaction is first called,Jake Burkholder2002-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) Notes: svn path=/head/; revision=102899
* Fix a nasty bug exposed by mktime() when time_t is significantly biggerPeter Wemm2002-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. Notes: svn path=/head/; revision=102885
* Set errno to EILSEQ when invalid multibyte sequences are detectedTim J. Robbins2002-09-033-3/+14
| | | | | | | (XSI extension to 1003.1-2001). Notes: svn path=/head/; revision=102879
* Use FOO(a) for macros with variadic args, instead of FOO(a,) or FOO(a, ).Jake Burkholder2002-09-021-3/+3
| | | | | | | Submitted by: gcc3.2 Notes: svn path=/head/; revision=102831
* - Let their manual pages show the reader that the bzero(3) andRobert Drehmel2002-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. Notes: svn path=/head/; revision=102809
* Typo: refer to MB_LEN_MAX instead of MB_CHAR_MAX (which does not exist).Tim J. Robbins2002-09-011-1/+1
| | | | Notes: svn path=/head/; revision=102767
* Add restrict qualifiers to the arguments of mbstowcs, mbtowc() andTim J. Robbins2002-09-014-9/+9
| | | | | | | wcstombs(). Notes: svn path=/head/; revision=102762
* Fix a memory leak.Mike Barcroft2002-09-011-1/+3
| | | | Notes: svn path=/head/; revision=102750
* Implement the XSI extension which allows the destination string to beTim J. Robbins2002-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 Notes: svn path=/head/; revision=102701
* Split ansi.c into a separate source file for each function.Tim J. Robbins2002-08-316-85/+253
| | | | Notes: svn path=/head/; revision=102697
* Use ntohl() to read cnains number in new formatAndrey A. Chernov2002-08-311-2/+4
| | | | Notes: svn path=/head/; revision=102658
* Add the 'restrict' type qualifier to the function prototypeRobert Drehmel2002-08-301-1/+1
| | | | | | | | of the swab(3) function in its manual page to match the standardization by POSIX.1-2001. Notes: svn path=/head/; revision=102643
* - Update the manual page of bcmp(3) by replacingRobert Drehmel2002-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. Notes: svn path=/head/; revision=102642
* Style fixAndrey A. Chernov2002-08-301-3/+3
| | | | Notes: svn path=/head/; revision=102641
* - Convert the function definition to declare its argumentsRobert Drehmel2002-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. Notes: svn path=/head/; revision=102639
* Prepare for switching to unlimited chains format.Andrey A. Chernov2002-08-302-23/+46
| | | | | | | Optimize chains lookup a bit. Notes: svn path=/head/; revision=102638
* - Update the manual pages of index() and rindex() to showRobert Drehmel2002-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'. Notes: svn path=/head/; revision=102637
* - Update the manual page to show that the associated header fileRobert Drehmel2002-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. Notes: svn path=/head/; revision=102635
* - Update strcasecmp(3)/strncasecmp(3) to reflect the fact thatRobert Drehmel2002-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. Notes: svn path=/head/; revision=102624
* Print a '-' sign for negative zero. Tested withJens Schweikhardt2002-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 Notes: svn path=/head/; revision=102499
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-253-3/+3
| | | | Notes: svn path=/head/; revision=102411
* Fix a bug in __ivaliduser_sa() which caused some rsh/rlogin attemptsJohn Polstra2002-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 Notes: svn path=/head/; revision=102369
* Note that <sys/types.h> in no longer a prerequisite for <utime.h> andMike Barcroft2002-08-248-8/+0
| | | | | | | <sys/mman.h>. Notes: svn path=/head/; revision=102340
* We cannot use an alloc with only inputs and/or locals. The kernelMarcel Moolenaar2002-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. Notes: svn path=/head/; revision=102298
* Fixed getaddrinfo to honor sortlist in /etc/resolv.confJim Pirzyk2002-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 Notes: svn path=/head/; revision=102237
* s/EDOFUS/EDOOFUS/Poul-Henning Kamp2002-08-213-5/+5
| | | | | | | Persuaded by: Google Notes: svn path=/head/; revision=102229
* o Merge <machine/ansi.h> and <machine/types.h> into a new headerMike Barcroft2002-08-2110-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=102227
* Add a manual page for wcwidth().Tim J. Robbins2002-08-202-1/+63
| | | | Notes: svn path=/head/; revision=102167
* Add a manual page for wcswidth().Tim J. Robbins2002-08-202-1/+62
| | | | Notes: svn path=/head/; revision=102166
* Move just committed version of wcswidth.c here (from "locale"),Andrey A. Chernov2002-08-202-25/+31
| | | | | | | a bit optimized now. Notes: svn path=/head/; revision=102159
* Remove wcswidth.c from here (and move it to "string")Andrey A. Chernov2002-08-202-65/+1
| | | | Notes: svn path=/head/; revision=102158
* Remove space at the end of continuation line in prev. commitAndrey A. Chernov2002-08-201-1/+1
| | | | Notes: svn path=/head/; revision=102157
* xdr.3 is added to MAN in ../xdr/Makefile.inc where it belongs, so don'tBruce Evans2002-08-191-1/+1
| | | | | | | add it here. Notes: svn path=/head/; revision=102147
* Implement wcswidth()Andrey A. Chernov2002-08-192-2/+66
| | | | Notes: svn path=/head/; revision=102139
* Use modern-style arguments declarationAndrey A. Chernov2002-08-191-2/+1
| | | | Notes: svn path=/head/; revision=102137
* Write null wide-character as L'\0' like in other placesAndrey A. Chernov2002-08-191-1/+1
| | | | Notes: svn path=/head/; revision=102134
* According to SUSv2, always return 0 for null wide-character codeAndrey A. Chernov2002-08-191-1/+6
| | | | Notes: svn path=/head/; revision=102124
* s/trailing NULL/trailing NUL/Juli Mallett2002-08-192-2/+2
| | | | Notes: svn path=/head/; revision=102117
* Move internal defines from ctype.h hereAndrey A. Chernov2002-08-191-0/+4
| | | | Notes: svn path=/head/; revision=102096
* Leave room for a trailing NUL not a NULL, that's not an ASCII character.Juli Mallett2002-08-192-2/+2
| | | | Notes: svn path=/head/; revision=102085
* Implement the ISO C90 Amd.1 restartable wide and multibyte characterTim J. Robbins2002-08-1813-4/+1020
| | | | | | | | manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(), wcrtomb(), wcsrtombs(). Notes: svn path=/head/; revision=102050
* Move wcwidth() to separate file, it doesn't belong to iswctype.c at allAndrey A. Chernov2002-08-173-11/+58
| | | | Notes: svn path=/head/; revision=102033
* According to SUSv2, wcwidth() should return -1 for non-printing charactersAndrey A. Chernov2002-08-171-1/+1
| | | | Notes: svn path=/head/; revision=102031
* Cosmetic - remove unneded brackets and #undefAndrey A. Chernov2002-08-172-41/+40
| | | | Notes: svn path=/head/; revision=102030
* wcwidth: fix espression to work correctly with SWIDTH0Andrey A. Chernov2002-08-171-2/+4
| | | | Notes: svn path=/head/; revision=102008