summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add an implementation of fabs() (which is quite trivial).tmm2002-09-132-1/+38
| | | | | | | | | When it is called directly, gcc is smart enough to generate inline code for it, which is why it wasn't noticed before that it was missing. fabs() would probably better fit into libm, but it has traditionally been in libc on FreeBSD, so there is probably software around that makes assumptions about this by now.
* Correct type of second argument: it is wchar_t ** restrict,tjr2002-09-121-2/+2
| | | | not wchar_t * restrict.
* Update to reflect reality.archie2002-09-112-31/+8
| | | | | Reviewed by: mini MFC after: 3 days
* Add man pages for getcontext()/setcontext(), makecontext()/swapcontext(),archie2002-09-114-5/+331
| | | | | | | and ucontext_t. Reviewed by: mini MFC after: 3 days
* In kvm_openfiles/kvm_open, mark the file descriptors as close-on-exec.nectar2002-09-111-0/+12
| | | | | Applications can not do this themselves, as the descriptors are hidden behind the opaque `kvm_t' type.
* Add an implementation of wcsftime() (wide character version of strftime()).tjr2002-09-113-2/+152
|
* Completely redo thread states.julian2002-09-111-21/+24
| | | | Reviewed by: davidxu@freebsd.org
* Add `restrict' type-qualifier.mike2002-09-113-6/+6
|
* Adjust to reflect reality, which is that sigaltstack() takes stack_t *'s.archie2002-09-101-6/+6
| | | | MFC after: 3 days
* Implement C99's _Exit() interface.wollman2002-09-106-55/+158
| | | | | | Implement a version of qsort that provides a thunk to the comparison function. Update manual pages.
* Get this file closer to style(9).phk2002-09-081-51/+55
|
* Add wcstol() and wcstoul(), based on strtol() and strtoul().tjr2002-09-084-4/+314
|
* Replace a stray reference to strtok() with one to wcstok().tjr2002-09-081-1/+1
|
* Fix a syntax error which causes an annoying warning.wollman2002-09-081-0/+1
|
* Add an implementation of wcstok(), based on strtok_r().tjr2002-09-073-3/+213
|
* Two arrays were born from the same seeds, both grew into complementary setsjmallett2002-09-071-1/+1
| | | | | | | | of pointers to strings. These two arrays were fixed to the same size, but one had an implicit zeroed trailer element, which was unused because the size was used up by the ones before said zeroed trailer element. So the unused limb was chopped off the over-sized-but-not-over-sized array, and everyone lived happily ever after.
* Sync prototypes with <wchar.h> with respect to the restrict qualifier.tjr2002-09-071-6/+6
|
* Add restrict qualifiers where C99 permits them. All of these already hadtjr2002-09-076-12/+12
| | | | restrict qualifiers on their prototypes in <wchar.h>.
* Call strtok_r() via a libc private name from within strtok().tjr2002-09-071-2/+6
|
* 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
OpenPOWER on IntegriCloud