Eliminate use of sigframe and sigthread throughout.

* Makefile.in (DLL_OFILES): Add sigfe.o.  Remove reliance on cygwin.def from
cygwin0.dll dependency since dependence on sigfe.o implies that.  Generate def
file on the fly using 'gendef'.
* configure.in: Don't auto-generate cygwin.def.
* configure: Regenerate.
* cygwin.din: Add SIGFE stuff where appropriate.
* dcrt0.cc (dll_crt0_1): Initialize cygwin tls early in process startup.  Set
_main_tls to address of the main thread's cygwin tls.
* debug.h: Remove now unneeded WFSO and WFMO declarations.
* exceptions.cc (_last_thread): Define.
(set_thread_state_for_signals): New function.
(reset_thread_exception_for_signals): Ditto.
(init_thread_for_signals): Ditto.
(delete_thread_for_signals): Ditto.
(capture_thread_for_signals): Ditto.
(handle_exceptions): Set return address explicitly for exceptions prior to
calling sig_send.
(interrupt_on_return): Eliminate.
(setup_handler): Add preliminary implementation for dealing with
thread-specific signals by querying _main_tls.
(signal_exit): Use cygthread::main_thread_id instead of mainthread.id.
(call_signal_handler_now): For now, just handle the main thread.
* fork.cc (vfork): Save and restore main _my_tls.
* gendef: New file.  Generates def file and sigfe.s file.
* gentls_offsets: New file.  Generates offsets for perl to use in sigfe.s.
* how-signals-work.txt: Mention that info is obsolete.
* init.cc (dll_entry): Initialize cygwin tls storage here.
* miscfuncs.cc (low_priority_sleep): Make a C function for easier calling from
asm.
* perthread.h (vfork_save::tls): New element.
* signal.cc (nanosleep): Replace previous use of
sigframe.call_signal_handler_now with straight call to call_signal_handler_now.
(abort): Ditto.
* syscalls.cc (readv): Ditto.
* termios.cc (tcsetattr): Ditto.
* wait.cc (wait4): Ditto.
* sigproc.cc (sig_dispatch_pending): Ditto.
(sig_send): Ditto.
* sigproc.h: Declare call_signal_handler_now.
* thread.cc (pthread::thread_init_wrapper): Initialize cygwin tls.  Remove
obsolete and unworking signal stuff.
* thread.h (verifyable_object::sigs): Eliminate.
(verifyable_object::sigmask): Eliminate.
(verifyable_object::sigtodo): Eliminate.
(verifyable_object::exit): Make attribute noreturn.
(verifyable_object::thread_init_wrapper): Ditto.
(pthread_null::exit): Ditto.
* winbase.h (__stackbase): Always define.
* winsup.h (low_priority_sleep): Declare as a "C" function.
* include/cygwin/version.h: Bump API version to reflect sigwait export.
* include/sys/queue.h: Protect SLIST_ENTRY from previous declaration.
* signal.cc (sigwait): Implement.
* select.cc (fhandler_base::ready_for_read): Add debugging output.
* devices.h: Define more device pointers via their storage.
* devices.in: Don't parse things like /dev/inet/tcp, as they really have no
meaning.
* devices.cc: Regenerate.
* gendevices: Set proper protection for output file.
* cygtls.h: New file.
* gendef: New file.
* gentls_offsets: New file.
* tlsoffsets.h: New file.  Autogenerated.
* config/i386/longjmp.c: Remove.  File subsumed by gendef output.
* config/i386/makefrag: Remove obsolete file.
* fhandler.cc: Remove spurious access_worker declaration.
* spawn.cc (spawnve): Make debugging output more accurate.
* cygwin-gperf: Remove.
* devices.cc: Remove.
This commit is contained in:
Christopher Faylor
2003-11-28 20:55:59 +00:00
parent ffe0063843
commit 9a4d574b8d
50 changed files with 3311 additions and 3466 deletions

View File

@ -695,7 +695,6 @@ cygwin_sendto (int fd, const void *buf, int len, int flags,
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -719,7 +718,6 @@ cygwin_recvfrom (int fd, void *buf, int len, int flags,
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -876,7 +874,6 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -950,7 +947,6 @@ extern "C" struct servent *
cygwin_getservbyname (const char *name, const char *proto)
{
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_str_errno (name)
|| (proto != NULL && check_null_str_errno (proto)))
return NULL;
@ -969,7 +965,6 @@ extern "C" struct servent *
cygwin_getservbyport (int port, const char *proto)
{
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (proto != NULL && check_null_str_errno (proto))
return NULL;
@ -986,7 +981,6 @@ extern "C" int
cygwin_gethostname (char *name, size_t len)
{
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (__check_null_invalid_struct_errno (name, len))
return -1;
@ -1022,7 +1016,6 @@ cygwin_gethostbyname (const char *name)
static int a, b, c, d;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_str_errno (name))
return NULL;
@ -1063,7 +1056,6 @@ extern "C" struct hostent *
cygwin_gethostbyaddr (const char *addr, int len, int type)
{
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (__check_invalid_read_ptr_errno (addr, len))
return NULL;
@ -1089,7 +1081,6 @@ cygwin_accept (int fd, struct sockaddr *peer, int *len)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -1122,7 +1113,6 @@ cygwin_bind (int fd, const struct sockaddr *my_addr, int addrlen)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (__check_invalid_read_ptr_errno (my_addr, addrlen) || !fh)
@ -1140,7 +1130,6 @@ cygwin_getsockname (int fd, struct sockaddr *addr, int *namelen)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -1161,7 +1150,6 @@ cygwin_listen (int fd, int backlog)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
if (!fh)
@ -1179,7 +1167,6 @@ cygwin_shutdown (int fd, int how)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -1245,7 +1232,6 @@ cygwin_getpeername (int fd, struct sockaddr *name, int *len)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -1286,7 +1272,6 @@ getdomainname (char *domain, size_t len)
* Punt for now and assume MS-TCP on Win95.
*/
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (__check_null_invalid_struct_errno (domain, len))
return -1;
@ -1900,7 +1885,6 @@ get_ifconf (struct ifconf *ifc, int what)
struct sockaddr_in *sa;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_invalid_struct_errno (ifc))
return -1;
@ -1979,7 +1963,6 @@ cygwin_rcmd (char **ahost, unsigned short inport, char *locuser,
SOCKET fd2s;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_invalid_struct_errno (ahost) ||
check_null_empty_str_errno (*ahost) ||
@ -2032,7 +2015,6 @@ cygwin_rresvport (int *port)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_invalid_struct_errno (port))
return -1;
@ -2061,7 +2043,6 @@ cygwin_rexec (char **ahost, unsigned short inport, char *locuser,
int res = -1;
SOCKET fd2s;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (check_null_invalid_struct_errno (ahost) ||
check_null_empty_str_errno (*ahost) ||
@ -2119,7 +2100,6 @@ socketpair (int family, int type, int protocol, int *sb)
int len;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
if (__check_null_invalid_struct_errno (sb, 2 * sizeof (int)))
return -1;
@ -2314,7 +2294,6 @@ cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);
@ -2341,7 +2320,6 @@ cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
{
int res;
sig_dispatch_pending ();
sigframe thisframe (mainthread);
fhandler_socket *fh = get (fd);