summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Sweep through pthread locking and use the new locking primitives forMike Makonnen2003-06-297-20/+21
| | | | | | | libthr. Notes: svn path=/head/; revision=117049
* Locking primitives and operations in libthr should use struct umtx,Mike Makonnen2003-06-292-4/+22
| | | | | | | | | | | | | | not spinlock_t. Spinlock_t and the associated functions and macros may require blocking signals in order for async-safe libc functions to behave appropriately in libthr. This is undesriable for libthr internal locking. So, this is the first step in completely separating libthr from libc's locking primitives. Three new macros should be used for internal libthr locking from now on: THR_LOCK, THR_TRYLOCK, THR_UNLOCK. Notes: svn path=/head/; revision=117048
* In a critical section, separate the aquisition of the thread lockMike Makonnen2003-06-292-17/+27
| | | | | | | | | | | | | | | and the disabling of signals. What we are really interested in is keeping track of recursive disabling of signals. We should not be recursively acquiring thread locks. Any such situations should be reorganized to not require a recursive lock. Separating the two out also allows us to block signals independent of acquiring thread locks. This will be needed in libthr in the near future when we put the pieces together to protect libc functions that use pthread mutexes and low level locks. Notes: svn path=/head/; revision=117046
* Add a libc function execvP that takes the search path as an arguement.Gordon Tetlow2003-06-292-15/+40
| | | | | | | | | | | Change execvp to be a wrapper around execvP. This is necessary for some of the /rescue pieces. It may also be more generally applicable as well. Submitted by: Tim Kientzle <kientzle@acm.org> Approved by: Silence on arch@ Notes: svn path=/head/; revision=117030
* Make _thread_suspend work with both the old broken sigtimedwaitJohn Polstra2003-06-293-11/+31
| | | | | | | | | implementation and the new improved one. We now precompute the signal set passed to sigtimedwait, using an inverted set when necessary for compatibility with older kernels. Notes: svn path=/head/; revision=117026
* Teach fmtcheck(3) about the flags a, A, F, G, t, and z.David Schultz2003-06-291-8/+28
| | | | Notes: svn path=/head/; revision=117014
* The move to _retire() a thread in the GC instead of in the thread'sMike Makonnen2003-06-293-21/+5
| | | | | | | | | | exit function has invalidated the need for _spin[un]lock_pthread(). The _spin[un]lock() functions can now dereference curthread without the danger that the ldtentry containing the pointer to the thread has been cleared out from under them. Notes: svn path=/head/; revision=117012
* mdoc(7) fix: Use the normal AT&T macro (.At) rather than itsRuslan Ermilov2003-06-281-1/+1
| | | | | | | internal string in the macro context. Notes: svn path=/head/; revision=117007
* o Use a daemon thread to monitor signal events in kernel, if pendingDavid Xu2003-06-2827-1172/+1622
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | signals were changed in kernel, it will retrieve the pending set and try to find a thread to dispatch the signal. The dispatching process can be rolled back if the signal is no longer in kernel. o Create two functions _thr_signal_init() and _thr_signal_deinit(), all signal action settings are retrieved from kernel when threading mode is turned on, after a fork(), child process will reset them to user settings by calling _thr_signal_deinit(). when threading mode is not turned on, all signal operations are direct past to kernel. o When a thread generated a synchoronous signals and its context returned from completed list, UTS will retrieve the signal from its mailbox and try to deliver the signal to thread. o Context signal mask is now only used when delivering signals, thread's current signal mask is always the one in pthread structure. o Remove have_signals field in pthread structure, replace it with psf_valid in pthread_signal_frame. when psf_valid is true, in context switch time, thread will backout itself from some mutex/condition internal queues, then begin to process signals. when a thread is not at blocked state and running, check_pending indicates there are signals for the thread, after preempted and then resumed time, UTS will try to deliver signals to the thread. o At signal delivering time, not only pending signals in thread will be scanned, process's pending signals will be scanned too. o Change sigwait code a bit, remove field sigwait in pthread_wait_data, replace it with oldsigmask in pthread structure, when a thread calls sigwait(), its current signal mask is backuped to oldsigmask, and waitset is copied to its signal mask and when the thread gets a signal in the waitset range, its current signal mask is restored from oldsigmask, these are done in atomic fashion. o Two additional POSIX APIs are implemented, sigwaitinfo() and sigtimedwait(). o Signal code locking is better than previous, there is fewer race conditions. o Temporary disable most of code in _kse_single_thread as it is not safe after fork(). Notes: svn path=/head/; revision=116977
* Use mmap retuned value.David Xu2003-06-282-4/+6
| | | | | | | Reviewed by: deischen Notes: svn path=/head/; revision=116976
* Temporary disable rwlock based code, replace it with low level KSE lockingDavid Xu2003-06-282-0/+184
| | | | | | | | | | code until rtld-elf and libkse can cooperate better, those code can be restored. Reviewed by: deischen Notes: svn path=/head/; revision=116975
* Write new thread pointer back only when success.David Xu2003-06-282-6/+8
| | | | | | | Reviewed by: deischen Notes: svn path=/head/; revision=116974
* After thread was interrupted by signal, it should relock mutex.David Xu2003-06-282-4/+2
| | | | | | | Reviewed by: deischen Notes: svn path=/head/; revision=116973
* if thread is exiting, just returns. kse_thr_interrupt interfaceDavid Xu2003-06-282-4/+12
| | | | | | | | | | was changed, it needs signal parameter, pass -1 to it, it indicates to interrupt syscall. Reviewed by: deischen Notes: svn path=/head/; revision=116972
* Update to reflect changes in vfscanf.c,v 1.32. Remove bogusDavid Schultz2003-06-281-35/+14
| | | | | | | | | | documentation for %a, and document it correctly instead. s/one of aefg/one of a, e, f, or g/ Reviewed by: standards@ Notes: svn path=/head/; revision=116968
* Revamp scanf's floating-point-parsing algorithm to supportDavid Schultz2003-06-281-94/+172
| | | | | | | | | | | [+|-]Inf, [+|-]NaN, nan(...), and hexidecimal FP constants. While here, add %a and %A, which are aliases for %e, and add support for long doubles. Reviewed by: standards@ Notes: svn path=/head/; revision=116967
* Create compatibility links for libc_r on ia64 to prevent build-timeMarcel Moolenaar2003-06-271-0/+12
| | | | | | | | | | | | breakages. Note that runtime compatibility is not guaranteed. Future changes to setjmp/longjmp in libc will break threaded applications linked against libc_r.so.5 on ia64. We pull our "tier 2" card once more... Reviewed by: ru Notes: svn path=/head/; revision=116920
* Correct a misspelled name of time_hi_and_version.Yaroslav Tykhiy2003-06-271-1/+1
| | | | Notes: svn path=/head/; revision=116916
* o disconnect libc_r from the build on ia64. The library is nowMarcel Moolenaar2003-06-271-0/+6
| | | | | | | | | | | obsolete. The intend is to add glue to either libthr or libpthread to create the necessary compat links. o Hook libpthread to the build on ia64. This is slightly out of order, because the kernel still doesn't have all the support, but that's not a problem in this case. Notes: svn path=/head/; revision=116906
* Implement _ia64_save_context() and _ia64_restore_context(). BothMarcel Moolenaar2003-06-272-0/+570
| | | | | | | | | | | | | | | | | | | functions are derived from the swapctx() and restorectx() (resp) from sys/ia64/ia64/context.s. The code is expected to be 99% correct, but has not yet been tested. Note that with these functions operating on mcontext_t, we also created the foundation upon which we can implement getcontext(2) and setcontext(2) replacements. It's not guaranteed that the use of these syscalls and _ia64_{save|restore}_context() on the same uicontext_t is actually going to work. Replacing the syscalls is now trivially achieved. This commit completes the ia64 port of libpthread itself (modulo testing and bugfixes). Notes: svn path=/head/; revision=116905
* fix NIS+ YP compat modeJohn W. De Boskey2003-06-271-3/+4
| | | | | | | | PR: bin/52792 Submitted by: TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp> Notes: svn path=/head/; revision=116901
* Fix URL of zlib home page: It's hosted at gzip.org now.Stefan Eßer2003-06-261-1/+1
| | | | Notes: svn path=/head/; revision=116890
* . style(9)Alexey Zelkin2003-06-267-19/+41
| | | | | | | | . fix/add comments (to cover changes done thru last 20 months) . extend monetary testcase to cover int_* values Notes: svn path=/head/; revision=116875
* Implement _ia64_enter_uts(). The purpose of this function is to switchMarcel Moolenaar2003-06-266-2/+202
| | | | | | | | | | | | the register stack and memory stack and call the function given to it. While here, provide empty, non-working, stubs for the context functions (_ia64_save_context() and _ia64_restore_context()) so that anyone can at least compile libkse from CVS sources. Real implementations will follow soon. Notes: svn path=/head/; revision=116870
* Implement _thr_enter_uts() and _thr_switch() as inline functions toMarcel Moolenaar2003-06-262-0/+60
| | | | | | | | | | | | | | minimize the amount and complexity of assembly code that needs to be written. This way the core functionality is spread over 3 elementary functions that don't have to do anything that can more easily and more safely be done in C. As such, assembly code will only have to know about the definition of mcontext_t. The runtime cost of not having these functions being inlined is less important than the cleanliness and maintainability of the code at this stage of the implementation. Notes: svn path=/head/; revision=116866
* Re-enable libstand on all platforms including amd64.Peter Wemm2003-06-261-5/+1
| | | | Notes: svn path=/head/; revision=116862
* Add amd64 build gluePeter Wemm2003-06-261-1/+22
| | | | Notes: svn path=/head/; revision=116861
* Reduce code duplication by separating _PathLocle detection code intoAlexey Zelkin2003-06-253-37/+37
| | | | | | | internal helper function. Notes: svn path=/head/; revision=116847
* Move _PathLocale declaration to more logical place (setlocale.c)Alexey Zelkin2003-06-252-1/+5
| | | | Notes: svn path=/head/; revision=116846
* Catch up with _PATH_LOCALE move from rune.h to paths.hAlexey Zelkin2003-06-251-1/+1
| | | | Notes: svn path=/head/; revision=116845
* mdoc policeDavid E. O'Brien2003-06-251-6/+6
| | | | Notes: svn path=/head/; revision=116843
* Be more specific in BUGS.David E. O'Brien2003-06-251-5/+7
| | | | | | | | | Submitted by: ru Add history. Notes: svn path=/head/; revision=116834
* Push the alloca #error warning farther down to play nicer with some out ofDavid E. O'Brien2003-06-251-2/+4
| | | | | | | | | tree local translator. Requested by: jmallett Notes: svn path=/head/; revision=116833
* Don't statically initialize buf to _PATH_DEV, _PATH_DEV always copied toAndrey A. Chernov2003-06-241-1/+1
| | | | | | | it in any case. Notes: svn path=/head/; revision=116797
* Unify cross-references between sigpending(2), sigprocmask(2),Yaroslav Tykhiy2003-06-243-1/+5
| | | | | | | | | | | and sigsuspend(2), all three of which operate or depend on the process signal mask. Add a missing xref to sigsetops(3), without which the above three syscalls would be useless. Notes: svn path=/head/; revision=116786
* Supplement the cross-references section with those to sigpending(2)Yaroslav Tykhiy2003-06-241-0/+2
| | | | | | | | and sigprocmask(2). These two syscalls are likely to be accompanied by a few sigsetops(3) in a typical piece of code. Notes: svn path=/head/; revision=116785
* Implement signalcontext(). Needed by libpthread (aka libkse).Marcel Moolenaar2003-06-242-1/+123
| | | | Notes: svn path=/head/; revision=116775
* Explicitly widen int types before casting to pointer types. On 64-bitMarcel Moolenaar2003-06-242-6/+8
| | | | | | | | | | | platforms the compiler warns about incompatible integer/pointer casts and on ia64 this generally is bad news. We know that what we're doing here is valid/correct, so suppress the warning. No functional change. Sleeps better: marcel Notes: svn path=/head/; revision=116773
* Untangle the inter-dependency of kse types and ksd types/functionsMarcel Moolenaar2003-06-2313-19/+132
| | | | | | | | | | | | | | | | | | | | | | by moving the definition of struct ksd to pthread_md.h and removing the inclusion of ksd.h from thr_private.h (which has the definition of struct kse and kse_critical_t). This allows ksd.h to have inline functions that use struct kse and kse_critical_t and generally yields a cleaner implementation at the cost of not having all ksd related types/definitions in one header. Implement the ksd functionality on ia64 by using inline functions and permanently remove ksd.c from the ia64 specific makefile. This change does not clean up the i386 specific version of ksd.h. NOTE: The ksd code on ia64 abuses the tp register in the same way as it is abused in libthr in that it is incompatible with the runtime specification. This will be address when support for TLS hits the tree. Notes: svn path=/head/; revision=116771
* Change the definition of _ksd_curkse, _ksd_curthread andMarcel Moolenaar2003-06-233-10/+10
| | | | | | | | | | | | _ksd_readandclear_tmbx to be function-like. That way we can define them as inline functions or create prototypes for them. This change allows the ksd interface on ia64 to be fully inlined. Notes: svn path=/head/; revision=116719
* Define THR_{G|S}ETCONTEXT to expand to {g|s}etcontext(2).Marcel Moolenaar2003-06-232-0/+76
| | | | | | | Define THR_ALIGN to align at 16-byte boundaries. Notes: svn path=/head/; revision=116708
* Implement atomic_swap_{int|long|ptr}. Define atomic_swap_ptr as aMarcel Moolenaar2003-06-232-0/+94
| | | | | | | | macro that expands to atomic_swap_long() to avoid compiler warnings caused by incompatible pointer passing. Notes: svn path=/head/; revision=116707
* Remove _atomic_lock. It's not used.Marcel Moolenaar2003-06-232-93/+0
| | | | Notes: svn path=/head/; revision=116706
* Move the machine specific files from sys/Makefile.inc and put themMarcel Moolenaar2003-06-239-12/+35
| | | | | | | | in a machine specific makefile. While here, sort the sub-directories in Makefile and remove _atomic_lock.S from all makefiles. Notes: svn path=/head/; revision=116705
* Add clarifications about the information that ntp_gettime returns.Warner Losh2003-06-211-8/+18
| | | | | | | | | | | | | TAI is a timescale, just like UTC. The tai field returns the offset between the two, and isn't really used for precision time keeping. Explain in brief what a positive and a negative leap seconds are. Add some URLs to very useful web pages about time and time keeping for more information on using this API. Reviewed by: phk Notes: svn path=/head/; revision=116656
* Userland spinlocks bad. Sleep locks good.David Schultz2003-06-211-2/+5
| | | | | | | | | Use the latter for gdtoa. Requested by: deischen (far too long ago) Notes: svn path=/head/; revision=116652
* ttyname(3) must return absolute pathnames.Poul-Henning Kamp2003-06-211-2/+8
| | | | | | | Noticed by: kris Notes: svn path=/head/; revision=116651
* Use devname(3) to do the task.Poul-Henning Kamp2003-06-201-66/+2
| | | | | | | Reviewed by: imp Notes: svn path=/head/; revision=116636
* Explain the relationship to POSIX.Garrett Wollman2003-06-201-0/+14
| | | | Notes: svn path=/head/; revision=116635
* ntp_adjtime returns the current state of the clock (TIME_*) on successWarner Losh2003-06-201-1/+4
| | | | | | | | | | or -1 on failure. The manual used to say it returned 0 or -1. Both examination of the kernel sources, and ntpd show that this is the case. MFC After: 3 days Notes: svn path=/head/; revision=116631