summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove a bogus null password check which assumed that a user with an emptyDag-Erling Smørgrav2003-04-241-2/+8
| | | | | | | | | password must necessarily have an empty pwd->pw_passwd. Also add a check that prevents users from setting a blank password unless the nullok option was specified. Root is still allowed to give anyone a blank password. Notes: svn path=/head/; revision=113968
* Add a macro to get the current thread mailbox pointer.Daniel Eischen2003-04-231-0/+1
| | | | Notes: svn path=/head/; revision=113944
* Remove the i386-specific hack (well, we only run on i386 anyways)Daniel Eischen2003-04-232-8/+8
| | | | | | | | | to always set %gs when resuming a thread. Install this library as libpthread instead of libkse. Notes: svn path=/head/; revision=113943
* Protect thread errno from being changed while operatingDaniel Eischen2003-04-236-2/+76
| | | | | | | | | | | on behalf of the KSE. Add a kse_reinit function to reinitialize a reused KSE. Submitted by: davidxu Notes: svn path=/head/; revision=113942
* Fix a compiler warning.Poul-Henning Kamp2003-04-231-0/+2
| | | | | | | Submitted by: David Leimbach <leimy2k@mac.com> Notes: svn path=/head/; revision=113901
* ``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
* Set the quantum for scope system threads to 0 (no quantum).Daniel Eischen2003-04-222-0/+4
| | | | Notes: svn path=/head/; revision=113881
* Add a working pthread_[gs]etconcurrency. Initial null implementationDaniel Eischen2003-04-224-0/+242
| | | | | | | | | | | | provided by Sergey A. Osokin <osa@freebsd.org.ru>. In order to test this on a single CPU machine, you need to: sysctl kern.threads.debug=1 sysctl kern.threads.virtual_cpu=2 Notes: svn path=/head/; revision=113871
* Add a couple asserts to pthread_cond_foo to ensure the (low-level)Daniel Eischen2003-04-2210-42/+144
| | | | | | | | | | | | | | | | | | lock level is 0. Thus far, the threads implementation doesn't use mutexes or condition variables so the lock level should be 0. Save the return value when trying to schedule a new thread and use this to return an error from pthread_create(). Change the max sleep time for an idle KSE to 1 minute from 2 minutes. Maintain a count of the number of KSEs within a KSEG. With these changes scope system threads seem to work, but heavy use of them crash the kernel (supposedly VM bugs). Notes: svn path=/head/; revision=113870
* Collapse the meta arguments into normal arguments, trying to distinguishPoul-Henning Kamp2003-04-222-38/+1
| | | | | | | just makes our own life harder. Notes: svn path=/head/; revision=113861
* Fix compilation errors.Poul-Henning Kamp2003-04-221-2/+1
| | | | | | | I wonder how I managed to cross-compile this yesterday. Notes: svn path=/head/; revision=113840
* Update libdisk to use the explicing encoding function for sunlabel dataPoul-Henning Kamp2003-04-212-11/+13
| | | | | | | structures. Notes: svn path=/head/; revision=113823
* 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 an i386-specifc hack to always set %gs. There still seemsDaniel Eischen2003-04-2114-366/+580
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to be instances where the kernel doesn't properly save and/or restore it. Use noupcall and nocompleted flags in the KSE mailbox. These require kernel changes to work which will be committed sometime later. Things still work without the changes. Remove the general kse entry function and use two different functions -- one for scope system threads and one for scope process threads. The scope system function is not yet enabled and we use the same function for all threads at the moment. Keep a copy of the KSE stack for the case that a KSE runs a scope system thread and uses the same stack as the thread (no upcalls are generated, so a separate stack isn't needed). This isn't enabled yet. Use a separate field for the KSE waiting flag. It isn't correct to use the mailbox flags field. The following fixes were provided by David Xu: o Initialize condition variable locks with thread versions of the low-level locking functions instead of the kse versions. o Enable threading before creating the first thread instead of after. o Don't enter critical regions when trying to malloc/free or call functions that malloc/free. o Take the scheduling lock when inheriting thread attributes. o Check the attribute's stack pointer instead of the attributes stack size for null when allocating a thread's stack. o Add a kseg reinit function so we don't have to destroy and then recreate the same lock. o Check the return value of kse_create() and return an appropriate error if it fails. o Don't forget to destroy a thread's locks when freeing it. o Examine the correct flags word for checking to see if a thread is in a synchronization queue. Things should now work on an SMP kernel. Notes: svn path=/head/; revision=113786
* Use popfl to get the flags off the stack instead of popf.Daniel Eischen2003-04-211-1/+1
| | | | | | | Submitted by: davidxu Notes: svn path=/head/; revision=113784
* fix __FBSDIDDavid E. O'Brien2003-04-201-2/+2
| | | | Notes: svn path=/head/; revision=113756
* style.Makefile(5)David E. O'Brien2003-04-201-7/+6
| | | | Notes: svn path=/head/; revision=113755
* 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 support for ia64.Marcel Moolenaar2003-04-202-0/+64
| | | | | | | | | | | | | | Note that the tp register (r13) is reserved as the TLS pointer in the same way that that gp register (r1) is reserved as the global pointer. This implementation uses the tp register to point to the thread structure used by the threads implementation. This is not in violation with the runtime specification provided the TLS is a fixed distance from the thread structure. This is only an issue when code used the __thread keyword to create TLS. This is not supported at the moment. Notes: svn path=/head/; revision=113735
* Use STDERR_FILENO as the file descriptor passed to _thread_printf()Marcel Moolenaar2003-04-201-4/+7
| | | | | | | instead of 0 (ie stdin). Writing to stdin may not be possible. Notes: svn path=/head/; revision=113733
* 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
* Fix build breakage (on ia64) caused by a missing file descriptor toMarcel Moolenaar2003-04-202-2/+2
| | | | | | | _thread_printf(). Use STDERR_FILENO as the file descriptor. Notes: svn path=/head/; revision=113731
* Add stub implementations of pthread_[gs]etconcurrency to libc_r andJohn Polstra2003-04-206-0/+231
| | | | | | | | | | | | libthr. No changes were made to libpthread by request of deischen, who will soon commit a real implementation for that library. PR: standards/50848 Submitted by: Sergey A. Osokin <osa@freebsd.org.ru> MFC after: 1 week Notes: svn path=/head/; revision=113729
* 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
* Add prototype for compute_stats() so that libdevstat is WARNS=4 clean.Poul-Henning Kamp2003-04-191-0/+8
| | | | | | | Spotted by: kris Notes: svn path=/head/; revision=113710
* 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
* Make this compile under cs_CZ.ISO8859-2 locale.Ruslan Ermilov2003-04-182-6/+6
| | | | | | | | | Reported by: Pav Lucistnik <pav@oook.cz> We hit this problem earlier, in PR misc/45460. Notes: svn path=/head/; revision=113664
* Remove duplicate $FreeBSD$ id.Daniel Eischen2003-04-182-6/+2
| | | | Notes: svn path=/head/; revision=113662
* Sorry folks; I accidentally committed a patch from what I was workingDaniel Eischen2003-04-1836-401/+635
| | | | | | | | | on a couple of days ago. This should be the most recent changes. Noticed by: davidxu Notes: svn path=/head/; revision=113661
* Comment out the addition of -g to CFLAGS. This snuck in fromDaniel Eischen2003-04-182-2/+2
| | | | | | | my local version. Notes: svn path=/head/; revision=113659
* Revamp libpthread so that it has a chance of working in an SMPDaniel Eischen2003-04-18148-7516/+10658
| | | | | | | | | | | | | | | | | | | | | | environment. This includes support for multiple KSEs and KSEGs. The ability to create more than 1 KSE via pthread_setconcurrency() is in the works as well as support for PTHREAD_SCOPE_SYSTEM threads. Those should come shortly. There are still some known issues which davidxu and I are working on, but it'll make it easier for us by committing what we have. This library now passes all of the ACE tests that libc_r passes with the exception of one. It also seems to work OK with KDE including konqueror, kwrite, etc. I haven't been able to get mozilla to run due to lack of java plugin, so I'd be interested to see how it works with that. Reviewed by: davidxu Notes: svn path=/head/; revision=113658
* Add FIFO queueing locking operations based on atomic swap.Daniel Eischen2003-04-188-14/+740
| | | | | | | | | Modify thread errno for the new libpthread changes. Reviewed by: davidxu Notes: svn path=/head/; revision=113657
* Add architecture dependent atomic ops (atomic_swap only), KSE specificDaniel Eischen2003-04-1811-12/+870
| | | | | | | | | | data, and userland versions of [gs]etcontext(). Modify the UTS entry and exit functions to account of FPU validity and format. Notes: svn path=/head/; revision=113656
* 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
* Buffer size is not enough in the previous commit. Use 128.Munechika SUMIKAWA2003-04-171-2/+2
| | | | | | | | Pointed out by: nectar MFC after: 1 week Notes: svn path=/head/; revision=113590
* 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
* Make character buffer more bigger.Munechika SUMIKAWA2003-04-161-2/+2
| | | | | | | | Obtained from: KAME MFC after: 1 week Notes: svn path=/head/; revision=113556
* 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