summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Floating point libc functions traditionally written in ASM.David E. O'Brien2003-04-302-0/+113
| | | | | | | | | | AMD64 does away with the x87 in 64-bit long mode, so we have to play the SSE/SSE2 game now. Obtained from: NetBSD/x86-64 Notes: svn path=/head/; revision=114298
* Backout my changes in rev. 1.32 and 1.33. There is some code that dependsMike Makonnen2003-04-301-4/+2
| | | | | | | | | | on the previous behaviour. This also brings strptime(3) behaviour back in line with the other BSDs. Approved by: markm (mentor) Notes: svn path=/head/; revision=114285
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referenceJacques Vidrine2003-04-2920-51/+71
| | | | | | | | | | technique) so that we don't wind up calling into an application's version if the application defines them. Inspired by: qpopper's interfering and buggy version of strlcpy Notes: svn path=/head/; revision=114256
* Document VM86_INTCALL.Matthew N. Dodd2003-04-291-4/+35
| | | | | | | Submitted by: Bruce M Simpson Notes: svn path=/head/; revision=114203
* Replace the return value of rfork_thread(3) in its manual pageRobert Drehmel2003-04-271-1/+1
| | | | | | | | function prototype with `pid_t' to match the declaration in <unistd.h>. Notes: svn path=/head/; revision=114132
* Correct the return value of vfork(2) and rfork(2) in theirRobert Drehmel2003-04-272-2/+2
| | | | | | | manual page function prototypes. Notes: svn path=/head/; revision=114131
* Add some strategic whitespace.Robert Watson2003-04-261-0/+1
| | | | Notes: svn path=/head/; revision=114051
* When using `compat' mode, be sure to re-dispatch setpwent, endpwent,Jacques Vidrine2003-04-252-0/+58
| | | | | | | | | | | | | setgrent, and endgrent also. (The previous NSS implementation used to simply twiddle the internal data of the various modules directly.) A symptom (group list set incorrectly in sshd) was Reported by: Glenn Johnson <gjohnson@srrc.ars.usda.gov> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=114021
* In compat mode, we `redispatch' the lookup. It is probably a goodJacques Vidrine2003-04-241-0/+1
| | | | | | | | | | | idea to re-initialize `struct passwd', because e.g. pw_class might get set by one module, but not by another. Add another call to the internal pwd_init function to accomplish this. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113992
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' byJacques Vidrine2003-04-241-1/+3
| | | | | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113984
* Don't complain about missing NSS methods when built statically. It isJacques Vidrine2003-04-241-1/+3
| | | | | | | | | annoying and not very useful. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113983
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' byJacques Vidrine2003-04-242-4/+8
| | | | | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113977
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' byJacques Vidrine2003-04-242-3/+3
| | | | | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113976
* ``Strong typing is a crutch for people with weak memories.''Jacques Vidrine2003-04-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Correct a bug that should have wreaked havoc everywhere, but for some reason only bit unlucky people who use `-march' optimizations. The compiler cannot assist one in distinguishing between the two function calls below. int nsdispatch(void *, ...); void *discard; nsdispatch(&discard, ...); /* correct .. no, really! */ nsdispatch(discard, ...); /* Boom */ Robin provided me with a debugging environment in which I could see what was going on. Badness when using CPUTYPE was Reported by: "Robin P. Blanchard" <Robin.Blanchard@gactr.uga.edu> Reported by: nork Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113882
* Correct a bug that was somehow both obvious and hard-to-see. :-)Jacques Vidrine2003-04-211-1/+1
| | | | | | | | | | | | | | | An incorrectly-sized allocation was being made due to an incorrect argument to the `sizeof' operator. Obvious, because it violated the `foo = malloc(sizeof(*foo))' idiom. Hard-to-see, because it was a missing `*' (`*p' versus `**p'). Resulting failure was Reported by: ache Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113798
* Don't try to access the NIS `master' maps unless we have superuserJacques Vidrine2003-04-211-7/+9
| | | | | | | | | | | privileges. To do so may cause the NIS server to log spurious and annoying `access denied' messages. Reported by: Philip Paeps <philip@paeps.cx> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113794
* Add FILES section to mac.3 and mac.conf.5. Properly Xref mac.conf.5Robert Watson2003-04-203-1/+22
| | | | | | | | | | from mac.3; likewise, mac.conf.5 from mac_prepare.3. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113741
* Add a man page for the mac.conf MAC library configuration file.Robert Watson2003-04-202-0/+105
| | | | | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113737
* Add the mac_prepare{,_*}() functions to the high-level function listRobert Watson2003-04-201-0/+11
| | | | | | | | | | | in the mac.3 library man page. They were already cross-referenced at the end of the man page, just not explicitly listed here. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113732
* Repair a bug in which a faulty group entry (one with only 2 colons)Jacques Vidrine2003-04-201-8/+6
| | | | | | | | | | | would result in an incorrectly terminated grouplist. login(1) crashes Reported by: Morten Rodal <morten@rodal.no>, Matthias Schuendehuette <msch@snafu.de> Notes: svn path=/head/; revision=113727
* %E-like %g and %G conversions should remove trailing zeroes unlessDavid Schultz2003-04-192-0/+14
| | | | | | | | | | | the # flag is present. Implement this behavior and add a comment describing it. Noticed by: Enache Adrian <enache@rdslink.ro> Pointy hat to: das Notes: svn path=/head/; revision=113723
* Follow-up to revision 1.74: Using the result buffer to store our emptyJacques Vidrine2003-04-181-22/+16
| | | | | | | | | | string was an incredibly dumb idea (of course it will be changed by an NSS module on success!). Use a static empty string instead. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113694
* Follow-up to revision 1.73: set _PWF_FILES when `compat' source is usedJacques Vidrine2003-04-181-4/+13
| | | | | | | | | | but user is found in local file. Reported by: Shizuka Kudo <shizukakudo_99@yahoo.com> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113691
* Don't use `memset' to initialize a struct passwd. A moduleJacques Vidrine2003-04-181-6/+31
| | | | | | | | | | | | | | | | | | | may not fill in all fields, and in the case of string fields, this could cause trouble for applications. (The only likely example is `pw_class', because this field is not used by all modules in all cases.) Move initialization of struct passwd from module-specific code to the dispatch code. The problem of a NULL pw_class was Noticed by: Philip Paeps <philip@paeps.cx> and the c^Htrusty ssh(1) command. Déjà vu by: getpwent.c revision 1.56 Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113672
* Correctly set _PWF_FILES in pw_fields when appropriate.Jacques Vidrine2003-04-181-2/+6
| | | | | | | | | | (_PWF_NIS and _PWF_HESIOD were already being set.) Reported by: Shizuka Kudo <shizukakudo_99@yahoo.com> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113670
* Revert the definitions of _PW_KEY* to their previous values. There isJacques Vidrine2003-04-181-2/+2
| | | | | | | | | | | | | at least one consumer outside of libc and pwd_mkdb. Adjust the versioning in libc and pwd_mkdb accordingly. named was the application affected, and that fact was first Reported by: Zherdev Anatoly <tolyar@mx.ru> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113666
* The default if nsswitch.conf(5) is not present is supposed to be theJacques Vidrine2003-04-182-2/+2
| | | | | | | | | | hated `compat' source, not `files'. Reported by: Philip Paeps <philip@paeps.cx> Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113643
* Add a manual page for the ntp_gettime syscall.Tom Rhodes2003-04-172-2/+106
| | | | | | | Reviewed by: ru, phk (older version). Notes: svn path=/head/; revision=113608
* = Implement thread-safe versions of the getpwent(3) and getgrent(3)Jacques Vidrine2003-04-174-1542/+2604
| | | | | | | | | | | | | | | | | | | | | | | | | family of functions using the new nsdispatch(3) core. Remove arbitrary size limits when using the thread-safe versions. = Re-implement the traditional getpwent(3)/getgrent(3) functions on top of the thread-safe versions. = Update the on-disk format of the hashed version of the passwd(5) databases to allow for versioned entries. The legacy version is `3'. (Don't ask.) = Add support for version `4' entries in the passwd(5) database. Entries in this format are identical to version 3 entries except that all integers are stored as 32-bit integers in network byte order (big endian). = pwd_mkdb is updated to generate both version 3 and version 4 entries. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113596
* = Implement name service switch modules (NSS modules). NSS modulesJacques Vidrine2003-04-1711-205/+970
| | | | | | | | | | | | | | | | | | | | | | | | may be built into libc (`static NSS modules') or dynamically loaded via dlopen (`dynamic NSS modules'). Modules are loaded/initialized at configuration time (i.e. when nsdispatch is called and nsswitch.conf is read or re-read). = Make the nsdispatch(3) core thread-safe. = New status code for nsdispatch(3) `NS_RETURN', currently used to signal ERANGE-type issues. = syslog(3) problems, don't warn/err/abort. = Try harder to avoid namespace pollution. = Implement some shims to assist in porting NSS modules written for the GNU C Library nsswitch interface. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113595
* Clarify the relationship between the MAC library APIs and POSIX.1e:Robert Watson2003-04-161-2/+6
| | | | | | | | | | | they resemble one another, but POSIX.1e interfaces were not sufficiently expressive to do what we needed. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113578
* Add a manual page for the ntp_adjtime syscall.Tom Rhodes2003-04-152-1/+148
| | | | | | | | PR: 32674 Reviewed by: phk, ru Notes: svn path=/head/; revision=113515
* Merge in vfprintf.c rev. 1.58.Tim J. Robbins2003-04-141-9/+11
| | | | Notes: svn path=/head/; revision=113470
* Fix a bug where printf was erroneously printing a decimal point forDavid Schultz2003-04-141-8/+10
| | | | | | | | | | | | %f and sufficiently short %g specifiers where the precision was explicitly zero, no '#' flag was specified, and the floating point argument was > 0 and <= 0.5. While at it, add some comments to better explain the relevant bits of code. Noticed by: Christoph Kukulies <kuku@physik.rwth-aachen.de> Notes: svn path=/head/; revision=113468
* Return "/boot/kernel/kernel" instead of "/kernel" if the sysctl() callTim J. Robbins2003-04-111-1/+1
| | | | | | | fails. The documentation was incorrectly updated in getbootfile.3 rev. 1.10. Notes: svn path=/head/; revision=113362
* When called with s == NULL, behave as if wc == L'\0' as required by theTim J. Robbins2003-04-101-1/+3
| | | | | | | standard. Notes: svn path=/head/; revision=113331
* /strtopx/ s/result/&result/David Schultz2003-04-092-2/+2
| | | | | | | This is the version I *meant* to commit last week. Notes: svn path=/head/; revision=113278
* o In struct prison, add an allprison linked list of prisons (protectedMike Barcroft2003-04-092-3/+30
| | | | | | | | | | | | | | | | | | by allprison_mtx), a unique prison/jail identifier field, two path fields (pr_path for reporting and pr_root vnode instance) to store the chroot() point of each jail. o Add jail_attach(2) to allow a process to bind to an existing jail. o Add change_root() to perform the chroot operation on a specified vnode. o Generalize change_dir() to accept a vnode, and move namei() calls to callers of change_dir(). o Add a new sysctl (security.jail.list) which is a group of struct xprison instances that represent a snapshot of active jails. Reviewed by: rwatson, tjr Notes: svn path=/head/; revision=113275
* Bump the date.Matthew N. Dodd2003-04-071-1/+1
| | | | Notes: svn path=/head/; revision=113235
* Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.Matthew N. Dodd2003-04-071-0/+7
| | | | | | | Requested by: ru Notes: svn path=/head/; revision=113224
* - Add setfstab() and getfstab().Matthew N. Dodd2003-04-073-4/+71
| | | | | | | | - Use the environment variable 'PATH_FSTAB' if set rather than the hardcoded '/etc/fstab' (fstab.h:_PATH_FSTAB) Notes: svn path=/head/; revision=113219
* Catch up with recent vfprintf.c changes.Tim J. Robbins2003-04-071-175/+215
| | | | Notes: svn path=/head/; revision=113199
* __wcsconv(): free(convbuf) before returning NULLAndrey A. Chernov2003-04-071-2/+4
| | | | Notes: svn path=/head/; revision=113196
* Today just isn't my day. Remove some old commented out code that snuckDavid Schultz2003-04-071-1/+1
| | | | | | | | | into the last commit. Noticed by: mike Notes: svn path=/head/; revision=113194
* - %e conversions with precision 0 should not cause a decimal point toDavid Schultz2003-04-071-18/+22
| | | | | | | | | | | be printed. - Fix %f conversions where the number of significant digits is < expt. This would be a one-line change were it not for thousands separators. Noticed by tjr. - Remove some unnecessary code in the parsing of precision specifiers. Notes: svn path=/head/; revision=113191
* Rework the floating point code in printf(). Significant changes:David Schultz2003-04-052-151/+191
| | | | | | | | | | | | | | | | | | | | | - We used to round long double arguments to double. Now we print them properly. - Bugs involving '%F', corner cases of '#' and 'g' format specifiers, and the '.*' precision specifier have been fixed. - Added support for the "'" specifier to print thousands' grouping characters in a locale-dependent manner. - Implement the __vfprintf() side of hexadecimal floating point support. All that is still needed is a routine to convert the mantissa to hex digits one nibble at a time in the style of ultoa(). Reviewed by: silence on standards@ Notes: svn path=/head/; revision=113146
* Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().David Schultz2003-04-058-1/+135
| | | | | | | | | | In support of this, add some MD macros to assist in converting long doubles to the format expected by gdtoa(). Reviewed by: silence on standards@ Notes: svn path=/head/; revision=113145
* Add missing #include to unbreak previous commit.David Schultz2003-04-051-0/+1
| | | | Notes: svn path=/head/; revision=113143
* Correct some buffer sizes.David Schultz2003-04-053-23/+42
| | | | | | | | | | | | | - __vfprintf()'s 'buf' has never been used for floating point, so don't define it in terms of (incorrect) constants describing floating point numbers. The actual size needed depends on sizeof(uintmax_t) and locale details, so I slightly overestimated. - We don't need a 308-character buffer to store the string "308". With long doubles and %a we need more than three characters, though. Notes: svn path=/head/; revision=113142
* MFp4: Link strtof.3 and strtold.3 to strtod.3.Tim J. Robbins2003-04-051-0/+1
| | | | Notes: svn path=/head/; revision=113105