Commit Graph

8465 Commits

Author SHA1 Message Date
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
dsl
5dbcc1e019 If VIS_CSTYLE is specified, use \ to escape any printable characters
(especially \ itself, and anything else in 'extra').
Fix strvis() and strvisx() to pass 0..255 to isgraph() etc.
2003-07-16 22:34:34 +00:00
nathanw
e171479839 pthread_kill() prototype moved to <signal.h>. 2003-07-16 21:26:33 +00:00
cb
9b28f9c625 Mark __clockctl_fd close-on-exec to avoid unintentionally leaking
time setting privileges across an exec.
2003-07-16 19:42:11 +00:00
itojun
24fbe10c93 do not build/install shlib 2003-07-16 19:35:34 +00:00
wiz
19aedbe869 Bump date for last. 2003-07-16 11:54:44 +00:00
tshiozak
5e3e3850e3 correct boundary check in _citrus_db_lookup_string_by_string(). 2003-07-16 08:13:51 +00:00
itojun
2ec4a5905e use bounded string op 2003-07-16 08:05:27 +00:00
itojun
427af575fe use bounded string op. bump shlib major for libtelnet due to API change. 2003-07-15 10:14:54 +00:00
itojun
fabed9f775 use bounded string op 2003-07-15 05:09:34 +00:00
jeremy
be8ce1d30b Documented the return values from el_get(). 2003-07-14 22:36:22 +00:00
itojun
df0916cac9 MDC2 is patented 2003-07-14 13:49:21 +00:00
itojun
fcfc71fca0 use strlcat 2003-07-14 12:37:13 +00:00
tshiozak
0e0aa0868c use NONIDENTICAL instead of ILSEQ if the reverse conversion of ISO646.
(fix for lib/22135)
2003-07-14 11:37:49 +00:00
wiz
22c09256dd cpu -> CPU, from jmc@openbsd. 2003-07-14 08:58:57 +00:00
itojun
7b8c272d80 be friendly to unifdef(1) 2003-07-14 08:36:27 +00:00
tshiozak
c1e771ab90 separate "nonidentical conversion" and "ilseq" under csmapper.
"nonidentical" means "the input character index is valid, but not
corresponding to the output codeset."
"ilseq" means "the input character index is invalid for the input codeset."
2003-07-12 15:39:19 +00:00
dsl
880234af7e Stop def_prog_mode() saving incorrect termio settings.
Make set_prog_mode() set the correct settings.
I'm not certain how much restoration set_prog_mode() should do, but it
definitely doesn't want to do all of __restartwin().
Maybe __restartwin() should be calling set_prog_mode()?
2003-07-10 12:50:18 +00:00
lukem
7b6e5e6602 NOxxx= variables must appear before <bsd.own.mk> 2003-07-10 11:27:45 +00:00
lukem
001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
tshiozak
888aa165a5 add forgotten _CITRUS_HASH_REMOVE() at release_shared().
This hopefully fixes the PR pkg/22113.
2003-07-10 09:08:57 +00:00