* dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely know to be
set. * exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since it is reset automatically. * fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP. * include/sys/cygwin.h: Ditto. * sigproc.cc (sig_send): Use sigframe init method to set frame since it checks for previous ownership of the frame. * sigproc.h (sigframe::init): Accept an "is_exception" argument.
This commit is contained in:
parent
51d340e1c8
commit
3ef50005c7
|
@ -1,3 +1,15 @@
|
||||||
|
2003-09-08 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely
|
||||||
|
know to be set.
|
||||||
|
* exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since
|
||||||
|
it is reset automatically.
|
||||||
|
* fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
|
||||||
|
* include/sys/cygwin.h: Ditto.
|
||||||
|
* sigproc.cc (sig_send): Use sigframe init method to set frame since it
|
||||||
|
checks for previous ownership of the frame.
|
||||||
|
* sigproc.h (sigframe::init): Accept an "is_exception" argument.
|
||||||
|
|
||||||
2003-09-08 Christopher Faylor <cgf@redhat.com>
|
2003-09-08 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* dir.cc (readdir): Reinstate setting of old ino field for legacy
|
* dir.cc (readdir): Reinstate setting of old ino field for legacy
|
||||||
|
|
|
@ -607,7 +607,7 @@ dll_crt0_1 ()
|
||||||
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
||||||
h = NULL;
|
h = NULL;
|
||||||
set_myself (mypid, h);
|
set_myself (mypid, h);
|
||||||
__argc = __argc_safe = spawn_info->moreinfo->argc;
|
__argc = spawn_info->moreinfo->argc;
|
||||||
__argv = spawn_info->moreinfo->argv;
|
__argv = spawn_info->moreinfo->argv;
|
||||||
envp = spawn_info->moreinfo->envp;
|
envp = spawn_info->moreinfo->envp;
|
||||||
envc = spawn_info->moreinfo->envc;
|
envc = spawn_info->moreinfo->envc;
|
||||||
|
@ -724,6 +724,7 @@ dll_crt0_1 ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__argc_safe = __argc;
|
||||||
if (user_data->premain[0])
|
if (user_data->premain[0])
|
||||||
for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
|
for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
|
||||||
user_data->premain[i] (__argc, __argv, user_data);
|
user_data->premain[i] (__argc, __argv, user_data);
|
||||||
|
|
|
@ -618,7 +618,6 @@ sig_handle_tty_stop (int sig)
|
||||||
myself->pid, sig, myself->ppid_handle);
|
myself->pid, sig, myself->ppid_handle);
|
||||||
if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0)
|
if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0)
|
||||||
api_fatal ("WaitSingleObject failed, %E");
|
api_fatal ("WaitSingleObject failed, %E");
|
||||||
(void) ResetEvent (sigCONT);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1048,23 +1047,23 @@ sig_handle (int sig)
|
||||||
|
|
||||||
goto dosig;
|
goto dosig;
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
/* Eat multiple attempts to STOP */
|
/* Eat multiple attempts to STOP */
|
||||||
if (ISSTATE (myself, PID_STOPPED))
|
if (ISSTATE (myself, PID_STOPPED))
|
||||||
goto done;
|
goto done;
|
||||||
handler = (void *) sig_handle_tty_stop;
|
handler = (void *) sig_handle_tty_stop;
|
||||||
thissig = myself->getsig (SIGSTOP);
|
thissig = myself->getsig (SIGSTOP);
|
||||||
|
|
||||||
dosig:
|
dosig:
|
||||||
/* Dispatch to the appropriate function. */
|
/* Dispatch to the appropriate function. */
|
||||||
sigproc_printf ("signal %d, about to call %p", sig, handler);
|
sigproc_printf ("signal %d, about to call %p", sig, handler);
|
||||||
rc = setup_handler (sig, handler, thissig);
|
rc = setup_handler (sig, handler, thissig);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
sigproc_printf ("returning %d", rc);
|
sigproc_printf ("returning %d", rc);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
exit_sig:
|
exit_sig:
|
||||||
if (sig == SIGQUIT || sig == SIGABRT)
|
if (sig == SIGQUIT || sig == SIGABRT)
|
||||||
{
|
{
|
||||||
CONTEXT c;
|
CONTEXT c;
|
||||||
|
|
|
@ -510,7 +510,7 @@ err:
|
||||||
buflen = (size_t) -1;
|
buflen = (size_t) -1;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sig_exit:
|
sig_exit:
|
||||||
set_sig_errno (EINTR);
|
set_sig_errno (EINTR);
|
||||||
buflen = (size_t) -1;
|
buflen = (size_t) -1;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -633,15 +633,6 @@ fork ()
|
||||||
grouped.hParent = grouped.first_dll = NULL;
|
grouped.hParent = grouped.first_dll = NULL;
|
||||||
grouped.load_dlls = 0;
|
grouped.load_dlls = 0;
|
||||||
|
|
||||||
if (ISSTATE(myself, PID_SPLIT_HEAP))
|
|
||||||
{
|
|
||||||
system_printf ("The heap has been split, CYGWIN can't fork this process.");
|
|
||||||
system_printf ("Increase the heap_chunk_size in the registry and try again.");
|
|
||||||
set_errno (ENOMEM);
|
|
||||||
syscall_printf ("-1 = fork (), split heap");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *esp;
|
void *esp;
|
||||||
__asm__ volatile ("movl %%esp,%0": "=r" (esp));
|
__asm__ volatile ("movl %%esp,%0": "=r" (esp));
|
||||||
|
|
||||||
|
|
|
@ -89,8 +89,7 @@ enum
|
||||||
PID_ORPHANED = 0x0020, /* Member of an orphaned process group. */
|
PID_ORPHANED = 0x0020, /* Member of an orphaned process group. */
|
||||||
PID_ACTIVE = 0x0040, /* Pid accepts signals. */
|
PID_ACTIVE = 0x0040, /* Pid accepts signals. */
|
||||||
PID_CYGPARENT = 0x0080, /* Set if parent was a cygwin app. */
|
PID_CYGPARENT = 0x0080, /* Set if parent was a cygwin app. */
|
||||||
PID_SPLIT_HEAP = 0x0100, /* Set if the heap has been split, */
|
PID_UNUSED = 0x0100, /* ... */
|
||||||
/* which means we can't fork again. */
|
|
||||||
PID_MYSELF = 0x0200, /* Flag that pid is me. */
|
PID_MYSELF = 0x0200, /* Flag that pid is me. */
|
||||||
PID_NOCLDSTOP = 0x0400, /* Set if no SIGCHLD signal on stop. */
|
PID_NOCLDSTOP = 0x0400, /* Set if no SIGCHLD signal on stop. */
|
||||||
PID_INITIALIZING = 0x0800, /* Set until ready to receive signals. */
|
PID_INITIALIZING = 0x0800, /* Set until ready to receive signals. */
|
||||||
|
|
|
@ -717,7 +717,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp, bool exception)
|
||||||
{
|
{
|
||||||
thiscatch = sigcatch_main;
|
thiscatch = sigcatch_main;
|
||||||
thiscomplete = sigcomplete_main;
|
thiscomplete = sigcomplete_main;
|
||||||
thisframe.set (mainthread, ebp, exception);
|
thisframe.init (mainthread, ebp, exception);
|
||||||
todo = getlocal_sigtodo (sig);
|
todo = getlocal_sigtodo (sig);
|
||||||
issem = true;
|
issem = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,10 +75,10 @@ public:
|
||||||
if (!oframe)
|
if (!oframe)
|
||||||
t.get_winapi_lock ();
|
t.get_winapi_lock ();
|
||||||
}
|
}
|
||||||
inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0))
|
inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0), bool is_exception = 0)
|
||||||
{
|
{
|
||||||
if (!t.frame && t.id == GetCurrentThreadId ())
|
if (is_exception || (!t.frame && t.id == GetCurrentThreadId ()))
|
||||||
set (t, ebp);
|
set (t, ebp, is_exception);
|
||||||
else
|
else
|
||||||
st = NULL;
|
st = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue