Commit graph

7709 commits

Author SHA1 Message Date
Dag-Erling Smørgrav 3a256117dc Revert previous commit after fixing libpam. 2003-07-21 19:56:28 +00:00
Mark Murray acce0bcdb3 Test correct macro for "without crypto" option(s). 2003-07-20 23:29:46 +00:00
Daniel Eischen f4c57e7baf Add missing arguments to _amd64_restore_context() when called from
THR_SETCONTEXT().
2003-07-20 12:41:38 +00:00
Mike Makonnen e9043a12cc Now that we have the stubs for alpha and we can build it
on that platform, invert the test for the platforms on
which libthr is built. Amd64 and powerpc are the only
platforms excluded.

Compile tested on:	amd64, alpha
2003-07-20 01:34:40 +00:00
Mike Makonnen 9e222aaf7a The MD framework for libthr on alpha 2003-07-19 15:57:52 +00:00
David Xu 1aa2ee9714 Override libc function raise(), in threading mode, raise() will
send signal to current thread.

Reviewed by: deischen
2003-07-19 05:25:49 +00:00
David Xu 5e27d6ab96 Make raise and _raise as weak symbols, so they can be overriden by
thread library.

Reviewed by: deischen
2003-07-19 05:22:56 +00:00
Daniel Eischen 5a201fddb7 Add some very beta amd64 bits. These will also need some tweaking. 2003-07-19 04:44:21 +00:00
Daniel Eischen 4adc354c34 Add amd64 versions of makecontext() and signalcontext() needed
for libkse (makecontext() is also needed for libthr).
These probably will need some tweaking.
2003-07-19 04:41:08 +00:00
Garrett Wollman 157c8e69d7 Rewrite to reflect slight change in semantics for C99, and note a bug
in the standard.  Defer to gettimeofday(2) for error indications.
2003-07-19 03:19:59 +00:00
Garrett Wollman d09b896215 C99 compliance: time() always sets its return value in both places
(if present), even on error.

Pointed out by: Wojtek Lerch, on the Austin Group mailing-list
2003-07-19 02:53:46 +00:00
Bill Paul 0287aa1cee Revert to using yp_order() to probe for master.paswd.by* maps and
don't probe the server at all for passwd.by* maps. This fixes
interoperability with the Services For UNIX NIS server (which is
really a front end to Captive^WActiveDirectory). This server
incorrectly returns success for all YPPROC_MASTER requests,
even for maps that don't exist, which makes it impossible to
(ab)use it to probe for the existence of the master.passwd.by*
maps.

This is a little kludgey, but basically restores the original
behavior of getpwent.c as it is in -stable, and works around both
the lack of YPPROC_ORDER on NIS+ servers as well as the broken
YPPROC_MASTER on Services For UNIX servers.
2003-07-18 23:51:15 +00:00
Garrett Wollman def6489df6 Whitespace after keywords per style(9). 2003-07-18 16:04:32 +00:00
Daniel Eischen a735c7a6ea Cleanup thread accounting. Don't reset a threads timeslice
when it blocks; it only gets reset when it yields.

Properly set a thread's default stack guardsize.

Reviewed by:	davidxu
2003-07-18 02:46:55 +00:00
Daniel Eischen 596ea21c7f Add a preemption point when a mutex or condition variable is
handed-off/signaled to a higher priority thread.  Note that when
there are idle KSEs that could run the higher priority thread,
we still add the preemption point because it seems to take the
kernel a while to schedule an idle KSE.  The drawbacks are that
threads will be swapped more often between CPUs (KSEs) and
that there will be an extra userland context switch (the idle
KSE is still woken and will probably resume the preempted
thread).  We'll revisit this if and when idle CPU/KSE wakeup
times improve.

Inspired by:	Petri Helenius <pete@he.iki.fi>
Reviewed by:	davidxu
2003-07-18 02:46:30 +00:00
Daniel Eischen 584a5a068d Clean up KSE specific data (KSD) macros a bit.
Reviewed by:	davidxu
2003-07-18 02:45:56 +00:00
David Xu 090b336154 o Eliminate upcall for PTHREAD_SYSTEM_SCOPE thread, now it
is system bound thread and when it is blocked, no upcall is generated.

o Add ability to libkse to allow it run in pure 1:1 threading mode,
  defining SYSTEM_SCOPE_ONLY in Makefile can turn on this option.

o Eliminate code for installing dummy signal handler for sigwait call.

o Add hash table to find thread.

Reviewed by: deischen
2003-07-17 23:02:30 +00:00
Mark Murray 4afa371832 Very big makeover in the way telnet, telnetd and libtelnet are built.
Previously, there were two copies of telnet; a non-crypto version
that lived in the usual places, and a crypto version that lived in
crypto/telnet/. The latter was built in a broken manner somewhat akin
to other "contribified" sources. This meant that there were 4 telnets
competing with each other at build time - KerberosIV, Kerberos5,
plain-old-secure and base. KerberosIV is no longer in the running, but
the other three took it in turns to jump all over each other during a
"make buildworld".

As the crypto issue has been clarified, and crypto _calls_ are not
a problem, crypto/telnet has been repo-copied to contrib/telnet,
and with this commit, all telnets are now "contribified". The contrib
path was chosen to not destroy history in the repository, and differs
from other contrib/ entries in that it may be worked on as "normal"
BSD code. There is no dangerous crypto in these sources, only a
very weak system less strong than enigma(1).

Kerberos5 telnet and Secure telnet are now selected by using the usual
macros in /etc/make.conf, and the build process is unsurprising and
less treacherous.
2003-07-16 20:59:15 +00:00
Dag-Erling Smørgrav 015d0cd6e2 Add a __DECONST() to unbreak the build. 2003-07-15 14:36:36 +00:00
Ceri Davies 513e86421d Back out revision 1.22.
Requested by:	bde
2003-07-15 12:23:12 +00:00
Marcel Moolenaar 29cc06cf27 Fix typo: Passing the first argument to exit() in out2 does not work.
Trust me.
2003-07-15 03:50:38 +00:00
Marcel Moolenaar 68d0d87b81 _start() needed to be written in assembly. See crt1.S. 2003-07-14 03:05:42 +00:00
Marcel Moolenaar db7ffe67c6 Rewite _start(). We cannot use a C function due to the fact that we
don't call it according to the runtime specification and especially
WRT to gp this can cause trouble. The gcc 3.3.1 import broke the
ia64 runtime because the compiler saved gp prior to us being able
to set it properly. Restoring gp after the calls would then invalidate
gp and cause segmentation faults later on.
By rewriting _start() as an assembly function, we also avoided even
more gcc dependences, by trying to use gcc specific features to work
around the problem.
This version of _start() does not reference _DYNAMIC. We register the
cleanup function when it's a non-NULL pointer. The kernel will always
pass a NULL pointer and dynamic linkers may pass a non-NULL pointer.

The machine independent code to set __progname now unfortunately is
written in assembly. So be it.
2003-07-13 23:11:37 +00:00
Ceri Davies 03606a211f ioctl macros and defines are now present in ioccom.h, not ioctl.h.
Update the manpage to reflect this.

PR:		docs/54235
Submitted by:	Karen Thode <thode12@msn.com>
2003-07-13 21:02:48 +00:00
Daniel Eischen 209afb2603 Remove -D_THREAD_SAFE.
Submitted by:   Craig Rodrigues <rodrigc@crodrigues.org>
2003-07-13 05:35:30 +00:00
David Xu 6fbddb9816 Don't resume sigwait thread If signal is masked. 2003-07-09 22:30:55 +00:00
David Xu d80384bc8d POSIX says if a thread is in sigwait state, although a signal may not in
its waitset, but if the signal is not masked by the thread, the signal
can interrupt the thread and signal action can be invoked by the thread,
sigwait should return with errno set to EINTR.
Also save and restore thread internal state(timeout and interrupted)
around signal handler invoking.
2003-07-09 14:30:51 +00:00
David Xu 9efd29f394 Restore signal mask correctly after fork(). 2003-07-09 01:39:24 +00:00
David Xu 0527fc8806 Save and restore thread's error code around signal handling.
Reviewed by: deischen
2003-07-09 01:06:12 +00:00
Mike Makonnen 393441d43b When _PTHREADSINVARIANTS is defined SIGABRT is not included
in the set of signals to block.
Also, make the PANIC macro call abort() instead of simply
exiting.
2003-07-08 09:58:23 +00:00
David Xu db6104d462 Correctly print signal mask, the bug was introduced by cut and paste
in last commit.
2003-07-07 12:12:33 +00:00
David Xu ace6720e77 Add a newline to debug message. 2003-07-07 04:32:17 +00:00
David Xu 91f7616aff Avoid accessing user provided parameters in critical region.
Reviewed by: deischen
2003-07-07 04:28:23 +00:00
Gregory Neil Shapiro dce6e6518b Remove MAINTAINER= lines from individual Makefiles in favor of the
MAINTAINER file (which already had entries for sendmail).
2003-07-07 03:54:04 +00:00
David Xu 62e74c0cb2 Print thread's scope, also print signal mask for every thread and print
it in one line.
2003-07-07 03:08:11 +00:00
Mike Makonnen 659045ffbf Change all instances of THR_LOCK/UNLOCK, etc to UMTX_*.
It is a more acurate description of the locks they
operate on.
2003-07-06 10:18:48 +00:00
Mike Makonnen 9644071977 There's no need for _umtxtrylock to be a separate function.
Roll it into the pre-existing macro that's used to call it.
2003-07-06 10:10:32 +00:00
Andrey A. Chernov 8b2749e901 Add const to __setrunelocale prototype 2003-07-06 04:01:09 +00:00
Andrey A. Chernov 68d429c3fc Reorganize wrapper around setrunelocale() to mark it as deprecated
in FreeBSD 6
2003-07-06 02:03:37 +00:00
Tim J. Robbins 8954a5c85a Add more useful cross-references to the SEE ALSO section. 2003-07-05 07:55:34 +00:00
Tim J. Robbins 759f7dc308 Catch up with recent FP-related changes to scanf.3 and vfwscanf.c. 2003-07-05 07:47:55 +00:00
Tim J. Robbins 4ea76cb195 Fix two incorrect uses of sizeof: we need to divide the size of the buffer
by sizeof(wchar_t) to get the number of wide characters it contains.
Remove the !hardway micro-optimisation from the CT_INT case to avoid
having to fix it for wide characters.
2003-07-05 03:39:23 +00:00
Tim J. Robbins b5c3fe0098 Merge recent floating point conversion changes from vfscanf.c. 2003-07-05 02:35:06 +00:00
David Xu a1a9b0071e Correctly lock/unlock signal lock. I must be in bad state, need to sleep. 2003-07-04 08:51:37 +00:00
David Xu dfde101719 Always check and restore sigaction previously set, also access user parameter
outside of lock.
2003-07-04 07:49:06 +00:00
Ruslan Ermilov b6f8b339d3 With the latest mdoc(7), we can now fix the synopsis like this.
Desired by:	bde
2003-07-03 18:14:39 +00:00
David Xu f399623004 If select() is only used for sleep, convert it to nanosleep,
it only need purely wait in user space.
2003-07-03 13:36:29 +00:00
Mike Makonnen e921a3c976 _pthread_mutex_trylock() is another internal libc function that must block
signals.
2003-07-03 13:28:53 +00:00
David Xu 8b258c151d Check if thread is in critical region, only testing check_pending
is not enough.
2003-07-03 10:12:21 +00:00
Ruslan Ermilov a8f9b6fdbf Style. 2003-07-02 20:52:39 +00:00