Commit Graph

8485 Commits

Author SHA1 Message Date
skrll 795970599f Typo in comment. 2003-07-24 08:03:44 +00:00
wiz 576530e520 Add pthread(3), based on one by Hubert Feyrer, improved by yours truly,
reviewed by Nathan J. Williams.
2003-07-24 07:50:24 +00:00
itojun 5d70d89eb1 don't provide crypt() here. use libcrypt. 2003-07-24 02:23:51 +00:00
itojun 62be3f2658 libkafs is needed for both krb4 and krb5. lha 2003-07-23 20:48:51 +00:00
itojun 4e1706e9af kerberosIV/des.h is not needed, Love says 2003-07-23 20:30:34 +00:00
itojun bf8555f163 no longer need to -I/usr/include first (yes, it's still confusing, i admit) 2003-07-23 13:35:13 +00:00
itojun 332aac83ab make /usr/include/kerberosIV/des.h a symlink to /usr/include/des.h,
it will avoid file inclusion loop
2003-07-23 13:33:15 +00:00
tron c04353144d Fix build problem caused by recent "Makefile" changes. 2003-07-23 13:19:43 +00:00
itojun 6f4e912af4 call malloc_init() on first call to free/realloc, to make malloc.conf to
take effect.  in response to PR 22223
2003-07-23 08:15:02 +00:00
itojun e63468d8cc split MKKERBEROS4 from MKKERBEROS. based on work by lha at stacken.kth.se
(build confirmed with both MKKERBEROS4=yes and MKKERBEROS4=no)
2003-07-23 08:01:24 +00:00
itojun 44ca808ae1 include /usr/include/des.h, not openssl/des.h (as openssl will change API soon) 2003-07-23 06:49:14 +00:00
itojun 476d185fa0 avoid recursion on des.h inclusion 2003-07-23 06:10:26 +00:00
itojun e9ce38e623 des_random_key() returns 1 on success 2003-07-23 05:57:01 +00:00
itojun df738798b1 install des_modes(7) from libdes, not from libcrypto 2003-07-23 05:46:00 +00:00
itojun 80af8890f3 install des.3 from libdes, not from libcrypto.
(eventually libcrypto will switch to DES_xx)
2003-07-23 05:43:44 +00:00
itojun b372c5a1f3 avoid arg name in prototype 2003-07-23 05:43:43 +00:00
itojun 98cf94c860 install des.3 from libdes, not from libcrypto.
(eventually libcrypto will switch to DES_xx)
2003-07-23 05:43:43 +00:00
itojun 75905560e6 go down to libdes 2003-07-23 05:27:38 +00:00
itojun 9f89c3577c split libdes from libcrypto. libdes bumps shlib major.
(no dependency in libraries)

libdes provides des_xx functions based on openssl 0.9.6j.
2003-07-23 05:20:17 +00:00
itojun 8cf58d7c5b DES code from openssl 0.9.6j 2003-07-23 04:57:33 +00:00
itojun 0ee6664ebd support hmac-sha2 2003-07-22 03:33:10 +00:00
itojun 26585fc6b8 don't explicitly clear "reserved" field. instead clear "id" field. 2003-07-22 03:32:58 +00:00
itojun 24389b0290 plug memory leak 2003-07-22 03:32:17 +00:00
itojun 536967658d cosmetic 2003-07-22 03:31:44 +00:00
nathanw 6d30f1a3db Disable cancellation on the first lock, too, not just on internal
recursive locks (Duh).

Disable cancellation around the cond_wait() call, since that's also a
cancellation point. Arguably, that would be better handled with
pthread_cleanup_*(), but stubbing those for libc is difficult, and the
current non-exception-based implementation of cleanup handlers is
probably no faster than disabling and reenabling cancellation.
Finally, it only happens in the slow path where the thread is going to
sleep anyway...
2003-07-22 00:56:25 +00:00
nathanw 5a5cd67fff Set the _LOCKINTERNAL() count on initial locking as well as subsequent
recursive locks.
2003-07-21 22:24:47 +00:00
nathanw 0878df5d25 Lock accesses to pt_flags and pt_cancel.
When disabling cancellation, clear the pt_cancel flag if it was set
and note the cancellation request with PT_FLAG_CS_PENDING. This avoids
a problem where a cancellation request entered but not acted upon before
pthread_setcanclstate(PTHREAD_CANCEL_DISABLE) is called would still be
aceted upon before cancellation was re-enabled.
2003-07-21 22:24:09 +00:00
nathanw 329747fb90 Add a lock on the pt_flags field. 2003-07-21 22:21:07 +00:00
nathanw 0c96790183 Use _sys_write() instead of write() in the assertion and error
functions, to avoid invoking the cancellation machinery in the middle
of trying to print an assertion or error message.
2003-07-21 22:17:14 +00:00
nathanw 68a63a4079 Move initialization of variable 'nthreads' so that pthread_exit() from
the main thread, with no other threads created, exits cleanly instead
of triggering an assertion in pthread_next().
2003-07-21 22:14:57 +00:00
thorpej 31ede4a9e3 Pull in host-tool config.h, if necessary. 2003-07-21 07:10:28 +00:00
nathanw d3ebb21ecd Use threadlib stub rather than pthread_setcancelstate() directly. 2003-07-19 05:06:16 +00:00
nathanw ec2c169839 pthread.c was getting a bit unwieldly. Move pthread_attr stuff out
into a new file, and put the shared private structure definition in
pthread_int.h.
2003-07-18 22:33:45 +00:00
nathanw 0172694e7d Implement a bunch of pthread_attr_() functions, which genuinely set and examine
pthread_attr_t objects, although most of the properties being set don't really
affect threads yet:

pthread_attr_{get,set}guardsize()
pthread_attr_{get,set}inheritsched()
pthread_attr_{get,set}scope()
pthread_attr_{get,set}stack()
pthread_attr_setstack{size,addr}()

Remove some useless assertions and error checks in the existing pthread_attr()
routines.

Implement pthread_attr_get_np(), to examine the attributes of an existing
thread. Idea and interface from FreeBSD.

Change PTHREAD_ERRORMODE environment variable to PTHREAD_DIAGASSERT, and
make it behave like libc's LIBC_DIAGASSERT. The way to disable error-checking
and aborting is now "PTHREAD_DIAGASSERT=AEL", rather than
"PTHREAD_ERRORMODE=ignore".
2003-07-18 22:12:30 +00:00
nathanw 067fa34e42 Add prototypes and necessary symbols for a bunch of pthread_attr_*() functions,
including (interface borrowed from FreeBSD) pthread_attr_get_np().

Remove a few limit-indicating symbols that don't actually need to be defined
(and if they did need to be defined, it would be in limits.h, not here).
2003-07-18 22:01:47 +00:00
nathanw 9e5c87057d Add strong alias for setcancelstate. 2003-07-18 21:57:26 +00:00
nathanw a74e50ddaf #include "local.h" to get __flockfile_internal() prototype. 2003-07-18 21:52:16 +00:00
nathanw 2b293cab66 Adapt definition of FLOCKFILE()/FUNLOCKFILE() to new __flockfile_internal()
routines.
2003-07-18 21:51:22 +00:00
nathanw ad09d62fcc Move guts of flockfile()/funlockfile() to __flockfile_internal(), which
takes an additional argument indicating whether this is an internal caller
taking the lock or an external (application) caller. When making an internal
lock, save the current thread cancellation state and disable cancellation
until the matching unlock. This should prevent canccelled threads from exiting
inside of stdio while holding a file lock and potentially leaving other
parts of the FILE structure in an inconsistent state.
2003-07-18 21:50:41 +00:00
nathanw b5665a9b84 Add fields to struct __sfileext to track how many times the lock has been
taken by internal stdio functions, and what the cancellation state was when
the first such lock was taken.
2003-07-18 21:46:41 +00:00
nathanw d271509d77 Add a stub for setcancelstate(). 2003-07-18 21:44:38 +00:00
lukem 98e8a6d142 #include <pthread_types.h> instead of "pthread_types.h" 2003-07-18 15:58:43 +00:00
nathanw d5ef0c1f39 Adapt to structure name changes. 2003-07-17 21:14:49 +00:00
nathanw 1a9edd35f7 Simplify pthread__stackalloc() by using the newish aligned-mmap()
feature.
2003-07-17 21:07:39 +00:00
nathanw d686fc0deb Define PTHREAD_* structure initializers from _PTHREAD_* macros from
pthread_types.h.
2003-07-17 20:59:35 +00:00
nathanw d37a996a49 Adapt to structure name changes. 2003-07-17 20:55:25 +00:00
nathanw deb18e9d04 Adapt to internal structure name changes.
Add a couple of useful flags and symbols.
2003-07-17 20:52:38 +00:00
nathanw c541f9e56a Prepare for inclusion in sys/types.h by ensuring that all the symbols
defined end with _t or start with _[A-Z_].
2003-07-17 20:51:36 +00:00
nathanw 608b92c095 Don't use PTHREAD_DESTRUCTOR_ITERATIONS; the constant is going away. 2003-07-17 20:40:43 +00:00
fvdl 2949ab0051 Take the normal return path in sigtimedwait when the current thread was
canceled as well. From Stephan Uphoff.
2003-07-17 18:15:21 +00:00