summaryrefslogtreecommitdiff
path: root/lib/libc_r
Commit message (Collapse)AuthorAgeFilesLines
* For the amd64 we need to do some extra stack alignment fixups. OtherwisePeter Wemm2003-12-033-6/+27
| | | | | | | | | | | | we can end up with some threads with a non-16-byte-aligned stack. This causes some interesting side effects, including general protection faults leading to a SIGBUS when doing floating point or varargs. This should be just a verbose NOP for the other platforms. Approved by: re (scottl) Notes: svn path=/head/; revision=123117
* If __sys_write() returns 0, allow that to exit the loop in libc_r'sDaniel Eischen2003-09-291-2/+2
| | | | | | | | | wrapped version of write(). Submitted by: dan@langille.org Notes: svn path=/head/; revision=120575
* Get rid of duplicates.Ruslan Ermilov2003-09-141-1/+1
| | | | Notes: svn path=/head/; revision=120054
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-081-1/+1
| | | | Notes: svn path=/head/; revision=119893
* Add wrapper for kqueue() to keep track of the allocated fd and allow it toMark Peek2003-07-252-0/+54
| | | | | | | | | | be closed. This fixes a file descriptor leak when closing a kqueue() fd. Reviewed by: deischen MFC after: 1 week Notes: svn path=/head/; revision=118019
* Remove -D_THREAD_SAFE.Daniel Eischen2003-07-131-1/+1
| | | | | | | Submitted by: Craig Rodrigues <rodrigc@crodrigues.org> Notes: svn path=/head/; revision=117500
* Make libc/${MACHINE_ARCH} include directory not required by Alpha.Ruslan Ermilov2003-07-022-2/+2
| | | | | | | | Submitted by: bde Tested by: beast Notes: svn path=/head/; revision=117163
* libc/${MACHINE_ARCH} include directory is required by Alpha,Alexander Kabaev2003-07-021-1/+1
| | | | | | | add it to CFLAGS. Notes: svn path=/head/; revision=117144
* Axe AINC.Ruslan Ermilov2003-07-011-1/+0
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=117120
* Sanity check fd before using it as an array index.Alexander Leidinger2003-06-091-1/+2
| | | | | | | | Noticed by: ted@NLnetLabs.nl (Ted Lindgreen) Approved by: ru Notes: svn path=/head/; revision=116092
* The .Fn functionPhilippe Charnier2003-06-081-3/+6
| | | | Notes: svn path=/head/; revision=116025
* Make this compile without warnings on 64-bit architectures:Marcel Moolenaar2003-06-041-6/+7
| | | | | | | | Don't cast thread_self() to int. Cast to uintptr_t. Pull in the predefined printf format from <inttypes.h> Notes: svn path=/head/; revision=115855
* Make this compile without warnings on 64-bit architectures:Marcel Moolenaar2003-06-041-1/+1
| | | | | | | | In recurse(), cast the pointer difference to int to match the format. The difference is expected to fit in an int. Notes: svn path=/head/; revision=115854
* If the library is not able to create a thread because resourcesMike Makonnen2003-06-041-0/+4
| | | | | | | | | don't allow it at the moment, the correct thing to do is try again. Otherwise, libthr would fail this test because it doesn't allow an unlimited number of concurrent threads per application. Notes: svn path=/head/; revision=115819
* Update for amd64 after repocopy from i386/Peter Wemm2003-06-021-2/+1
| | | | Notes: svn path=/head/; revision=115742
* Port libc_r to amd64, and turn it back on for amd64. It passes all ofPeter Wemm2003-06-021-0/+18
| | | | | | | the same src/lib/libc_r/test/* tests that the other platforms pass. Notes: svn path=/head/; revision=115740
* Revert accidental change: don't change the thread library for testing toRobert Watson2003-06-021-1/+1
| | | | | | | | | libthr. Oops, sorry about that. Submitted by: "Simon L. Nielsen" <simon@nitro.dk> Notes: svn path=/head/; revision=115658
* Include string.h for memset().Robert Watson2003-06-012-1/+2
| | | | Notes: svn path=/head/; revision=115649
* Fixed another bug in the threaded close() call; clear theRuslan Ermilov2003-05-311-0/+4
| | | | | | | | | | | | stale stdio descriptors flags. PR: bin/51535 Submitted by: Enache Adrian <enache@rdslink.ro> Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=115422
* If an application closes one of its stdio descriptors (0..2),Ruslan Ermilov2003-05-311-2/+4
| | | | | | | | | | | | | | | | | | | | an excessive close() on one of these descriptors would cause a memory for this descriptor to be allocated in the internal descriptor table. When this descriptor gets used again, e.g. through the call to open() or socket(), the descriptor would be erroneously left in the blocking mode, and the whole application would get stuck on a blocking operation, e.g., in accept(2). Prevent this bug from happening by disallowing close() against non-active descriptors (return -1 and set errno to EBADF in this case). Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=115421
* mdoc(7) fixes.Ruslan Ermilov2003-05-241-19/+27
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115288
* Add stub implementations of pthread_[gs]etconcurrency to libc_r andJohn Polstra2003-04-204-0/+170
| | | | | | | | | | | | 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
* - Define a _spinunlock() function so that threading implementations may doJeff Roberson2003-03-261-0/+6
| | | | | | | | | more complicated things than just setting the lock to 0. - Implement stubs for this function in libc and the two threading libraries that are currently in the tree. Notes: svn path=/head/; revision=112665
* The .Fn function. Use .Xr where appropriate.Philippe Charnier2003-03-2431-73/+139
| | | | Notes: svn path=/head/; revision=112542
* Fix threaded applications on ia64 that are linked dynamicly. We didMarcel Moolenaar2003-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | not save (restore) the global pointer (GP) in the jmpbuf in setjmp (longjmp) because it's not needed in general. GP is considered a scratch register at callsites and hence is always restored after a call (when it's possible that the call resolves to a symbol in a different loadmodule; otherwise GP does not have to be saved and restored at all), including calls to setjmp/longjmp. There's just one problem with this now that we use setjmp/longjmp for context switching: A new context must have GP defined properly for the thread's entry point. This means that we need to put GP in the jmpbuf and consequently that we have to restore is in longjmp. This automaticly requires us to save it as well. When setjmp/longjmp isn't used for context switching, this can be reverted again. Notes: svn path=/head/; revision=111897
* Don't cast an int to a pointer type without (possibly) widening theMarcel Moolenaar2003-03-051-1/+1
| | | | | | | | | | | | | | integral type to the size of a pointer type when it's known that the cast is valid. On ia64 such casts are generally bad news and has led us (=peter :-) to make such casts fatal. By casting to intptr_t before casting to a pointer type, this now compiles cleanly in LP64 architectures. Note that the final cast has been changed to void* (instead of siginfo_t*) to make it explicit that we're not trying to pass a siginfo_t pointer but rather trying to pass an int when the prototype says it should be a pointer. Notes: svn path=/head/; revision=111896
* Fixed a typo in MLINKS.Ruslan Ermilov2003-02-241-1/+1
| | | | Notes: svn path=/head/; revision=111452
* mdoc(7) police: Scheduled sweep.Ruslan Ermilov2003-02-2413-154/+124
| | | | Notes: svn path=/head/; revision=111447
* Enable just committed manual pages, update MLINKSAlexey Zelkin2003-02-131-0/+13
| | | | Notes: svn path=/head/; revision=110829
* Add AUTHORS sectionAlexey Zelkin2003-02-131-0/+6
| | | | Notes: svn path=/head/; revision=110828
* Finally! Document all undocumented functions in libc_r.Alexey Zelkin2003-02-1310-0/+696
| | | | | | | | | | | | | | | | | | | | | | | Add manual pages for following functions: . pthread_attr_setcreatesuspend_np(3) . pthread_main_np(3) . pthread_multi_np(3) . pthread_single_np(3) . pthread_mutexattr_getkind_np(3) . pthread_mutexattr_setkind_np(3) . pthread_resume_all_np(3) . pthread_resume_np(3) . pthread_set_name_np(3) . pthread_suspend_all_np(3) . pthread_suspend_np(3) . pthread_switch_add_np(3) . pthread_switch_delete_np(3) MFC after: 3 days Notes: svn path=/head/; revision=110827
* Break important implementation detail note into IMPLEMENTATION DETAILSAlexey Zelkin2003-02-131-3/+7
| | | | | | | | | section. Add cross reference to pthread_attr_getstack() function. MFC after: 1 day Notes: svn path=/head/; revision=110813
* Add cross reference for pthread_attr_get_np()Alexey Zelkin2003-02-131-0/+1
| | | | Notes: svn path=/head/; revision=110812
* Rehash MLINKS: add missing ones for recently added pthread_attr_{get,set}stack()Alexey Zelkin2003-02-131-3/+2
| | | | | | | functions and remove links for 3 non-existent functions Notes: svn path=/head/; revision=110811
* Actually link in the attr_{set,get}stack.Alfred Perlstein2003-02-111-0/+2
| | | | Notes: svn path=/head/; revision=110677
* Add pthread_attr_getstack() and pthread_attr_setstack().Alfred Perlstein2003-02-103-0/+125
| | | | | | | Submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=110636
* The .Fn functionPhilippe Charnier2003-02-0611-29/+58
| | | | Notes: svn path=/head/; revision=110442
* Document additional behaviour of this function (seeAlexey Zelkin2003-02-031-2/+12
| | | | | | | rev 1.3 of uthread_attr_get_np.c) Notes: svn path=/head/; revision=110277
* Improve pthread_attr_get_np() by enabling it to return thread's real stackAlexey Zelkin2003-02-031-1/+9
| | | | | | | | | address instead of specified by pthread_attr_t passed to pthread_create(). Suggested by: deischen Notes: svn path=/head/; revision=110276
* remove #ifdef _THREAD_SAFEMax Khon2003-01-241-2/+0
| | | | Notes: svn path=/head/; revision=109772
* Add a missing word.Tim J. Robbins2003-01-151-1/+1
| | | | Notes: svn path=/head/; revision=109297
* Document the named semaphore functions. This could still use a bitTim J. Robbins2003-01-151-18/+165
| | | | | | | of polishing. Notes: svn path=/head/; revision=109275
* Back out previous; sharing semaphores between processes only worksTim J. Robbins2003-01-141-8/+16
| | | | | | | in certain special cases. Notes: svn path=/head/; revision=109226
* Sharing semaphores between processes works now, so remove the stale commentsTim J. Robbins2003-01-141-16/+8
| | | | | | | | about it always returning EPERM. Document that ENFILE occurs when the limit on kernel semaphores is reached. Notes: svn path=/head/; revision=109222
* Cross reference sem(4) so users know which kernel options are requiredTim J. Robbins2003-01-145-5/+10
| | | | | | | to use these semaphore functions. Notes: svn path=/head/; revision=109220
* Increase the scheduler stack to 4 pages. This should prevent a stackDaniel Eischen2003-01-111-1/+1
| | | | | | | | | overflow when dumping thread info (generated by receipt of SIGINFO). Reported by: jmallet Notes: svn path=/head/; revision=109085
* pthread_attr_get_np() now takes 'pthread_t' (not 'pthread_t *')Max Khon2003-01-072-9/+8
| | | | | | | to be consistent with other pthread_XXX functions Notes: svn path=/head/; revision=108898
* Port libc_r to ia64. We need to do things slightly differentMarcel Moolenaar2003-01-064-0/+44
| | | | | | | | | | | | | | because we have 2 stacks per thread: the regular downward memory stack and the irregular upward register stack. This implementation lets both stacks grow toward each other. An alternative scheme is to have them grow away from each other. The alternate scheme has the advantage that both stack grow toward guard pages. Since libc_r is virtually dead and we really want the *context stuff for thread switching, we don't try to be perfect, just functional. Notes: svn path=/head/; revision=108753
* Add MD definitions for sparc64. This is based on work by des.Thomas Moestl2003-01-051-0/+29
| | | | Notes: svn path=/head/; revision=108740
* Add an implementation of _atomic_lock for sparc64. This was submitted byThomas Moestl2003-01-051-0/+45
| | | | | | | | des; I tweaked it slightly by extending the membar and making it match the style of the rest of the sparc64 assembler code. Notes: svn path=/head/; revision=108739