summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referencenectar2003-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
* Jump to the correct label upon detecting an error.deischen2003-04-291-2/+2
|
* Create the thread signal lock as a KSE lock (as opposed todeischen2003-04-296-44/+46
| | | | | | | | | | | | a thread lock). Better protect access to thread state while searching for threads to handle a signal. Better protect access to process pending signals while processing a thread in sigwait(). Submitted by: davidxu
* Document VM86_INTCALL.mdodd2003-04-291-4/+35
| | | | Submitted by: Bruce M Simpson
* o Don't add a scope system thread's KSE to the list of availabledeischen2003-04-2835-316/+640
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KSEs when it's thread exits; allow the GC handler to do that. o Make spinlock/spinlock critical regions. The following were submitted by davidxu o Alow thr_switch() to take a null mailbox argument. o Better protect cancellation checks. o Don't set KSE specific data when creating new KSEs; rely on the first upcall of the KSE to set it. o Add the ability to set the maximum concurrency level and do this automatically. We should have a way to enable/disable this with some sort of tunable because some applications may not want this to be the default. o Hold the scheduling lock across thread switch calls. o If scheduling of a thread fails, make sure to remove it from the list of active threads. o Better protect accesses to a joining threads when the target thread is exited and detached. o Remove some macro definitions that are now provided by <sys/kse.h>. o Don't leave the library in threaded mode if creation of the initial KSE fails. o Wakeup idle KSEs when there are threads ready to run. o Maintain the number of threads active in the priority queue.
* Use the correct link entry for walking the list of threads.deischen2003-04-282-18/+4
| | | | | | | | While I'm here, use the TAILQ_FOREACH macro instead of a more manual method which was inherited from libc_r (so we could remove elements from the list which isn't needed for libpthread). Submitted by: Kazuaki Oda <kaakun@highway.ne.jp>
* Replace the return value of rfork_thread(3) in its manual pagerobert2003-04-271-1/+1
| | | | | function prototype with `pid_t' to match the declaration in <unistd.h>.
* Correct the return value of vfork(2) and rfork(2) in theirrobert2003-04-272-2/+2
| | | | manual page function prototypes.
* Add vmemoryuse to the list.trhodes2003-04-261-0/+1
| | | | | PR: 50796 Submitted by: Dmitry Sivachenko <mitya@cavia.pp.ru>
* Add sys/user.h to the list of includes. Without it you lack a definition oftrhodes2003-04-261-0/+1
| | | | | | 'struct kinfo_proc' for calls to kvm_getargv() and kvm_getenvv(). PR: 51322
* Add some strategic whitespace.rwatson2003-04-261-0/+1
|
* When using `compat' mode, be sure to re-dispatch setpwent, endpwent,nectar2003-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
* Restore bzip2(1) support in loader(8) after Peter's renames ofru2003-04-251-2/+11
| | | | malloc() to Malloc(), and free() to Free(), in zalloc_malloc.c.
* Connect libpthread to the (i386) world. It is currently installeddeischen2003-04-251-1/+4
| | | | | | | as libkse and will once again be renamed libpthread after more testing. Approved by: re
* Remove the %gs restoring hack (already commented out).deischen2003-04-252-12/+2
| | | | | | | Don't install man pages. Temporarily (again) rename the library to libkse. It will be put back to libpthread after more wide-spread testing.
* In compat mode, we `redispatch' the lookup. It is probably a goodnectar2003-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
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' bynectar2003-04-241-1/+3
| | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories
* Don't complain about missing NSS methods when built statically. It isnectar2003-04-241-1/+3
| | | | | | annoying and not very useful. Sponsored by: DARPA, Network Associates Laboratories
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' bynectar2003-04-242-4/+8
| | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' bynectar2003-04-242-3/+3
| | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories
* Remove a bogus null password check which assumed that a user with an emptydes2003-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.
* Add a macro to get the current thread mailbox pointer.deischen2003-04-231-0/+1
|
* Remove the i386-specific hack (well, we only run on i386 anyways)deischen2003-04-232-8/+8
| | | | | | to always set %gs when resuming a thread. Install this library as libpthread instead of libkse.
* Protect thread errno from being changed while operatingdeischen2003-04-236-2/+76
| | | | | | | | on behalf of the KSE. Add a kse_reinit function to reinitialize a reused KSE. Submitted by: davidxu
* Fix a compiler warning.phk2003-04-231-0/+2
| | | | Submitted by: David Leimbach <leimy2k@mac.com>
* ``Strong typing is a crutch for people with weak memories.''nectar2003-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
* Set the quantum for scope system threads to 0 (no quantum).deischen2003-04-222-0/+4
|
* Add a working pthread_[gs]etconcurrency. Initial null implementationdeischen2003-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
* Add a couple asserts to pthread_cond_foo to ensure the (low-level)deischen2003-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).
* Collapse the meta arguments into normal arguments, trying to distinguishphk2003-04-222-38/+1
| | | | just makes our own life harder.
* Fix compilation errors.phk2003-04-221-2/+1
| | | | I wonder how I managed to cross-compile this yesterday.
* Update libdisk to use the explicing encoding function for sunlabel dataphk2003-04-212-11/+13
| | | | structures.
* Correct a bug that was somehow both obvious and hard-to-see. :-)nectar2003-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
* Don't try to access the NIS `master' maps unless we have superusernectar2003-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
* Add an i386-specifc hack to always set %gs. There still seemsdeischen2003-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.
* Use popfl to get the flags off the stack instead of popf.deischen2003-04-211-1/+1
| | | | Submitted by: davidxu
* fix __FBSDIDobrien2003-04-201-2/+2
|
* style.Makefile(5)obrien2003-04-201-7/+6
|
* Add FILES section to mac.3 and mac.conf.5. Properly Xref mac.conf.5rwatson2003-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
* Add a man page for the mac.conf MAC library configuration file.rwatson2003-04-202-0/+105
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Add support for ia64.marcel2003-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.
* Use STDERR_FILENO as the file descriptor passed to _thread_printf()marcel2003-04-201-4/+7
| | | | instead of 0 (ie stdin). Writing to stdin may not be possible.
* Add the mac_prepare{,_*}() functions to the high-level function listrwatson2003-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
* Fix build breakage (on ia64) caused by a missing file descriptor tomarcel2003-04-202-2/+2
| | | | _thread_printf(). Use STDERR_FILENO as the file descriptor.
* Add stub implementations of pthread_[gs]etconcurrency to libc_r andjdp2003-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
* Repair a bug in which a faulty group entry (one with only 2 colons)nectar2003-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>
* %E-like %g and %G conversions should remove trailing zeroes unlessdas2003-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
* Add prototype for compute_stats() so that libdevstat is WARNS=4 clean.phk2003-04-191-0/+8
| | | | Spotted by: kris
* Follow-up to revision 1.74: Using the result buffer to store our emptynectar2003-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
* Follow-up to revision 1.73: set _PWF_FILES when `compat' source is usednectar2003-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
OpenPOWER on IntegriCloud