summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Make KSE_STACKSIZE machine dependent by moving it from thr_kern.c tomarcel2003-09-199-6/+14
| | | | | | pthread_md.h. This commit only moves the definition; it does not change it for any of the platforms. This more easily allows 64-bit architectures (in particular) to pick a slightly larger stack size.
* _ia64_break_setcontext() now takes a mcontext_t. While here, definemarcel2003-09-192-20/+6
| | | | | | | | | | | | THR_SETCONTEXT as PANIC(). The THR_SETCONTEXT macro is currently not used, which means that the definition we had could be wrong, overly pessimistic or unknowingly right. I don't like the odds... The new _ia64_break_setcontext() and corresponding kernel fixes make KSE mostly usable. There's still a case where we don't properly restore a context and end up with a NaT consumption fault (typically an indication for not handling NaT collection points correctly), but at least now mutex_d works...
* Stop using the setcontext() syscall to restore an async context.marcel2003-09-192-10/+10
| | | | | Instead use the break instruction with an immediate specially created for us.
* Ignore ECHILD from waitpid(2) (our child may have been reaped by thedes2003-09-191-1/+2
| | | | | | calling process's SIGCHLD handler) PR: bin/45669
* pthread api should return error code in return value, not in errno.davidxu2003-09-182-4/+2
|
* Fix a typo. Also turn on PTHREAD_SCOPE_SYSTEM after fork().davidxu2003-09-162-2/+4
|
* Remove a comment that questioned why the size of the FPUdeischen2003-09-162-20/+2
| | | | | | | | | | | state for amd64 was twice as large as necessary. Peter recently fixed this, so the comment no longer applies. Also, since the size of struct mcontext changed, adjust the threads library version of get&set context to match. FYI, any change layout/size change to any arch's struct mcontext will likely need some minor changes in libpthread.
* From OpenBSD:fenner2003-09-151-1/+1
| | | | | | | | | | | | always widen the imputed netmask if it is narrower than the specified octets. fixes a strange behaviour where inet_net_pton would always return 4 (bits) for multicast addresses no matter how many octets were specified. negotiated with Paul Vixie, original author of this function. PR: standards/53151 Submitted by: Max Laier <max@love2party.net> Optained from: OpenBSD
* Our getaddrinfo() and getnameinfo() are thread-safe butume2003-09-152-2/+10
| | | | | | some limitation. Reported by: Marc G. Fournier <scrappy@hub.org>
* Fix bogus comment and assign sigmask in critical region, usedavidxu2003-09-152-4/+8
| | | | SIG_CANTMASK to remove unmaskable signal masks.
* Fix a bogus comment, sigmask must be maintained correctly,davidxu2003-09-152-2/+2
| | | | it will be inherited in pthread_create.
* 1. Allocating and freeing lock related resource in _thr_alloc and _thr_freedavidxu2003-09-148-188/+174
| | | | | | | | | | | to avoid potential memory leak, also fix a bug in pthread_create, contention scope should be inherited when PTHREAD_INHERIT_SCHED is set, and also check right field for PTHREAD_INHERIT_SCHED, scheduling inherit flag is in sched_inherit. 2. Execute hooks registered by atexit() on thread stack but not on scheduler stack. 3. Simplify some code in _kse_single_thread by calling xxx_destroy functions. Reviewed by: deischen
* When invoking an old style signal handler, use true traditional BSD style todavidxu2003-09-142-12/+26
| | | | | | invoke signal handler. Reviewed by: deischen
* Respect POSIX specification, a value return from pthread_attr_getguardsizedavidxu2003-09-144-32/+36
| | | | | | | | | should be a value past to pthread_attr_setguardsize, not a rounded up value. Also fix a stack size matching bug in thr_stack.c, now stack matching code uses number of pages but not bytes length to match stack size, so for example, size 512 bytes and size 513 bytes should both match 1 page stack size. Reviewed by: deischen
* Avoid garbage bits in c_flags by direct assigning value.davidxu2003-09-142-2/+2
| | | | Reviewed by: deischen
* If user is seting scope process flag, clear PTHREAD_SCOPE_SYSTEM bitdavidxu2003-09-142-4/+8
| | | | | | accordingly. Reviewed by: deischen
* Check invalid parameter and return EINVAL.davidxu2003-09-142-0/+6
| | | | Reviewed by: deischen
* Get rid of duplicates.ru2003-09-145-5/+5
|
* mdoc(7): Fix common mistakes made in the SEE ALSO section.ru2003-09-123-6/+8
|
* mdoc(7): Properly mark C headers.ru2003-09-1024-34/+34
|
* Document the fact that send(2) can return EPIPE (like when a socket is notroberto2003-09-101-0/+4
| | | | | | | | connected). PR: docs/56683 Submitted by: Chris S.J. Peron <maneo@bsdpro.com> MFC after: 3 days
* Fixed -Wpointer-arith warning.ru2003-09-091-1/+1
| | | | | Submitted by: Stefan Farfeleder PR: bin/56653
* Original pthread_once code has memory leak if pthread_once_t is used indavidxu2003-09-094-18/+104
| | | | | | | | | | | | | | | a shared library or any other dyanmic allocated data block, once pthread_once_t is initialized, a mutex is allocated, if we unload the shared library or free those data block, then there is no way to deallocate the mutex, result is memory leak. To fix this problem, we don't use mutex field in pthread_once_t, instead, we use its state field and an internal mutex and conditional variable in libkse to do any synchronization, we introduce a third state IN_PROGRESS to wait if another thread is already in invoking init_routine(). Also while I am here, make pthread_once() conformed to pthread cancellation point specification. Reviewed by: deischen
* Add code to support pthread spin lock.davidxu2003-09-097-0/+332
| | | | Reviewed by: deischen
* mdoc(7): Use the new feature of the .In macro.ru2003-09-0876-126/+126
|
* In the !MNT_BYFSID case, return EINVAL from unmount(2) when theiedowse2003-09-081-7/+12
| | | | | | | | | | | | | | specified directory is not found in the mount list. Before the MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent path and EINVAL for a non-mountpoint, but we can no longer distinguish between these cases. Of the two error codes, EINVAL was more likely to occur in practice, and it was the only one of the two that was documented. Update the manual page to match the current behaviour. Suggested by: tjr Reviewed by: tjr
* Add small piece of code to support pthread_rwlock_timedrdlock anddavidxu2003-09-063-16/+90
| | | | pthread_rwlock_timedrwlock.
* The caller is expected to set up PIC register corectly beforekan2003-09-052-0/+4
| | | | | jumping to .cerror. This means .cerror has to be present in the same module with its consumers, or bad things will happen.
* Clarify that the second argument to accept() may be a null pointer ifroam2003-09-051-1/+7
| | | | | | | | | no peer address information is desired. PR: 56044 Submitted by: Felix Opatz <felix@zotteljedi.de> and Bernd Luevelsmeyer <bdluevel@heitec.net> MFC after: 1 month
* Remove an unused and incorrect prototype for _none_init().tjr2003-09-051-1/+0
|
* Move a sentence about the terminating \0 from the RETURN VALUES sectionsimon2003-09-042-14/+14
| | | | | | | | (where it didn't really belong), to the DESCRIPTION section. English advice: ceri Requested by: das MFC after: 4 weeks
* Add code to support barrier synchronous object and implementdavidxu2003-09-0413-12/+709
| | | | | | pthread_mutex_timedlock(). Reviewed by: deischen
* Remove repeated macro THR_IN_CONDQ.davidxu2003-09-042-2/+0
|
* Allow hooks registered by atexit() to run with current thread pointer set,davidxu2003-09-042-2/+8
| | | | without this change, my atexit test dumps core.
* Sigh. I can't win anything. Use addq rather than addl with %rsp.peter2003-09-041-1/+1
|
* Apply same basic fix for getcontext(2) as for i386. Store the returnpeter2003-09-042-2/+56
| | | | | | value for getcontext() in a preserved register rather than on the stack. The second time around, the stack value would likely have changed so we can't depend on it for the return value.
* Fix some minor whitespace botchespeter2003-09-041-1/+1
|
* Make getcontext(2) work on i386. It needs a small wrapper in libcpeter2003-09-042-2/+52
| | | | | | | | | | | | | | | | | | | | | | | otherwise the return from the syscall stub for getcontext will pop off the return value for the caller to the getcontext stub and it will appear as though the setcontext() syscall returned instead of the getcontext(). The same bug exists on amd64, a fix is coming there too. The bug can be demonstrated with this test code fragment: main() { ucontext_t top; if (getcontext(&top) == 0) { write(2, "PING!\n", 6); /* Cause a return value of 1 from getcontext this time */ top.uc_mcontext.mc_eax = 1; setcontext(&top); err(1, "setcontext() returned"); } write(2, "PONG!\n", 6); _exit(0); }
* Don't assume sizeof(long) = sizeof(int) on x86; use intdeischen2003-09-0325-42/+109
| | | | | | | | | | | | instead of long types for low-level locks. Add prototypes for some internal libc functions that are wrapped by the library as cancellation points. Add memory barriers to alpha atomic swap functions (submitted by davidxu). Requested by: bde
* Move kse_wakeup_multi call to just before KSE_SCHED_UNLOCK.davidxu2003-09-032-8/+4
| | | | Tested on: SMP
* Rethink the way thr_libc.So is generated. Relying on GCC to extractkan2003-09-024-20/+64
| | | | | | only needed symbols from libc_pic is not working on sparc64. Requested by: jake
* Fix/add errno return values to match the NFS client implementation anddds2003-09-022-5/+16
| | | | | | | | better represent failures of special files accessed over NFS. Approved by: schweikh (mentor) Reviewed by: bde (as a description) MFC after: 6 weeks
* Update the kern.osreldate documentation to document the present formateivind2003-09-011-2/+17
| | | | | | used, and refer to <osreldate.h> to get userland date. Submitted by: ru
* Return (-1) not (ENOENT) for mac_prepare_type(), and set errno torwatson2003-08-301-1/+2
| | | | | | | ENOENT instead. Reported by: "Kenneth D. Merry" <ken@kdm.org> Submitted by: Bryan Liesner <bleez@comcast.net>
* Unbreak the NOINSTALLLIB install.ru2003-08-302-0/+4
| | | | | | PR: 50945 Submitted by: Rene de Vries <rene@tunix.nl> Reminded by: jmallett
* Allow the concurrency level to be reduced.deischen2003-08-306-70/+126
| | | | Reviewed by: davidxu
* Document that read(2) can also return EPERMdds2003-08-301-0/+3
| | | | | | | | | | | | | | | | | See e.g. nfsclient/nfs_vnops.c static int nfs_read(struct vop_read_args *ap) { struct vnode *vp = ap->a_vp; if (vp->v_type != VREG) return (EPERM); return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred)); } Approved by: schweikh (mentor) MFC after: 6 weeks
* Add a reference to bn(3) for those looking for functional multiprecisionseanc2003-08-301-0/+1
| | | | integer arithmetic.
* Don't close a FILE * which we know is bogus.des2003-08-291-1/+0
|
* Introduce more knobs to slim down FreeBSD userlandphk2003-08-291-1/+5
| | | | | | | NO_TOOLCHAIN skips Compilers and Binutils NO_USB skips USB stuff NO_VINUM skips Vinum stuff NO_ACPI skips ACPI stuff
OpenPOWER on IntegriCloud