* cygheap.h (init_cygheap): Play more vfork shell games and move ctty_on_hold
and open_fhs_on_hold (back) here. * dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later initialization deal with tls. * dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here. (dtable:vfork_parent_restore): And here. * fork.cc (vfork): Reflect change to ctty handling. * perthread.h (vfork_save::fhctty): Eliminate. * cygwin.din: Make more exports NOSIGFE that will never be interrupted by a signal. * init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.
This commit is contained in:
parent
d84514bd0f
commit
e80cbe3e52
|
@ -1,3 +1,19 @@
|
||||||
|
2004-01-02 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* cygheap.h (init_cygheap): Play more vfork shell games and move
|
||||||
|
ctty_on_hold and open_fhs_on_hold (back) here.
|
||||||
|
* dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later
|
||||||
|
initialization deal with tls.
|
||||||
|
* dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here.
|
||||||
|
(dtable:vfork_parent_restore): And here.
|
||||||
|
* fork.cc (vfork): Reflect change to ctty handling.
|
||||||
|
* perthread.h (vfork_save::fhctty): Eliminate.
|
||||||
|
|
||||||
|
* cygwin.din: Make more exports NOSIGFE that will never be interrupted
|
||||||
|
by a signal.
|
||||||
|
|
||||||
|
* init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.
|
||||||
|
|
||||||
2003-12-31 Christopher Faylor <cgf@redhat.com>
|
2003-12-31 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* cygwin.din: Make crt0 functions NOSIGFE.
|
* cygwin.din: Make crt0 functions NOSIGFE.
|
||||||
|
|
|
@ -262,6 +262,7 @@ struct init_cygheap
|
||||||
struct sigaction *sigs;
|
struct sigaction *sigs;
|
||||||
|
|
||||||
fhandler_tty_slave *ctty; /* Current tty */
|
fhandler_tty_slave *ctty; /* Current tty */
|
||||||
|
fhandler_tty_slave *ctty_on_hold;
|
||||||
int open_fhs;
|
int open_fhs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ details. */
|
||||||
# define UNLEN 256
|
# define UNLEN 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TLS_STACK_SIZE 1024
|
||||||
|
|
||||||
#pragma pack(push,4)
|
#pragma pack(push,4)
|
||||||
struct _local_storage
|
struct _local_storage
|
||||||
{
|
{
|
||||||
|
@ -107,7 +109,7 @@ struct _threadinfo
|
||||||
struct _threadinfo *prev, *next;
|
struct _threadinfo *prev, *next;
|
||||||
__stack_t *stackptr;
|
__stack_t *stackptr;
|
||||||
int sig;
|
int sig;
|
||||||
__stack_t stack[1024];
|
__stack_t stack[TLS_STACK_SIZE];
|
||||||
|
|
||||||
/*gentls_offsets*/
|
/*gentls_offsets*/
|
||||||
static CRITICAL_SECTION protect_linked_list;
|
static CRITICAL_SECTION protect_linked_list;
|
||||||
|
|
|
@ -34,7 +34,7 @@ __fpclassifyd NOSIGFE
|
||||||
__fpclassifyf NOSIGFE
|
__fpclassifyf NOSIGFE
|
||||||
__getreent NOSIGFE
|
__getreent NOSIGFE
|
||||||
__infinity NOSIGFE
|
__infinity NOSIGFE
|
||||||
__main SIGFE
|
__main NOSIGFE
|
||||||
__signbitd NOSIGFE
|
__signbitd NOSIGFE
|
||||||
__signbitf NOSIGFE
|
__signbitf NOSIGFE
|
||||||
__signgam NOSIGFE
|
__signgam NOSIGFE
|
||||||
|
@ -43,7 +43,7 @@ __swbuf SIGFE
|
||||||
_asprintf_r SIGFE
|
_asprintf_r SIGFE
|
||||||
asprintf_r = _asprintf_r SIGFE
|
asprintf_r = _asprintf_r SIGFE
|
||||||
_dll_crt0@0 NOSIGFE
|
_dll_crt0@0 NOSIGFE
|
||||||
_exit SIGFE
|
_exit NOSIGFE
|
||||||
_f_atan2 NOSIGFE
|
_f_atan2 NOSIGFE
|
||||||
__f_atan2 = _f_atan2 NOSIGFE
|
__f_atan2 = _f_atan2 NOSIGFE
|
||||||
_f_atan2f NOSIGFE
|
_f_atan2f NOSIGFE
|
||||||
|
@ -290,9 +290,9 @@ cygwin_conv_to_posix_path SIGFE
|
||||||
cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
|
cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
|
||||||
cygwin_conv_to_win32_path SIGFE
|
cygwin_conv_to_win32_path SIGFE
|
||||||
cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
|
cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
|
||||||
cygwin_detach_dll SIGFE
|
cygwin_detach_dll NOSIGFE
|
||||||
cygwin32_detach_dll = cygwin_detach_dll SIGFE
|
cygwin32_detach_dll = cygwin_detach_dll NOSIGFE
|
||||||
cygwin_dll_init SIGFE
|
cygwin_dll_init NOSIGFE
|
||||||
endprotoent = cygwin_endprotoent SIGFE
|
endprotoent = cygwin_endprotoent SIGFE
|
||||||
endservent = cygwin_endservent SIGFE
|
endservent = cygwin_endservent SIGFE
|
||||||
endusershell SIGFE
|
endusershell SIGFE
|
||||||
|
@ -434,7 +434,7 @@ execve SIGFE
|
||||||
_execve = execve SIGFE
|
_execve = execve SIGFE
|
||||||
execvp SIGFE
|
execvp SIGFE
|
||||||
_execvp = execvp SIGFE
|
_execvp = execvp SIGFE
|
||||||
exit = cygwin_exit SIGFE
|
exit = cygwin_exit NOSIGFE
|
||||||
exp NOSIGFE
|
exp NOSIGFE
|
||||||
_exp = exp NOSIGFE
|
_exp = exp NOSIGFE
|
||||||
exp2 NOSIGFE
|
exp2 NOSIGFE
|
||||||
|
|
|
@ -916,12 +916,11 @@ _dll_crt0 ()
|
||||||
void
|
void
|
||||||
dll_crt0 (per_process *uptr)
|
dll_crt0 (per_process *uptr)
|
||||||
{
|
{
|
||||||
char padding[CYGTLS_PADSIZE];
|
|
||||||
/* Set the local copy of the pointer into the user space. */
|
/* Set the local copy of the pointer into the user space. */
|
||||||
if (uptr && uptr != user_data)
|
if (uptr && uptr != user_data)
|
||||||
{
|
{
|
||||||
memcpy (user_data, uptr, per_process_overwrite);
|
memcpy (user_data, uptr, per_process_overwrite);
|
||||||
*(user_data->impure_ptr_ptr) = initialize_main_tls (padding);
|
*(user_data->impure_ptr_ptr) = &reent_data;
|
||||||
}
|
}
|
||||||
_dll_crt0 ();
|
_dll_crt0 ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -745,8 +745,13 @@ dtable::vfork_parent_restore ()
|
||||||
fds = fds_on_hold;
|
fds = fds_on_hold;
|
||||||
fds_on_hold = NULL;
|
fds_on_hold = NULL;
|
||||||
cfree (deleteme);
|
cfree (deleteme);
|
||||||
|
|
||||||
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "restore");
|
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "restore");
|
||||||
|
|
||||||
|
cygheap->ctty = cygheap->ctty_on_hold; // revert
|
||||||
|
if (cygheap->ctty)
|
||||||
|
cygheap->ctty->close (); // Undo previous bump of this archetype
|
||||||
|
cygheap->ctty_on_hold = NULL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,6 +782,12 @@ dtable::vfork_child_fixup ()
|
||||||
cfree (fds_on_hold);
|
cfree (fds_on_hold);
|
||||||
fds_on_hold = NULL;
|
fds_on_hold = NULL;
|
||||||
|
|
||||||
|
if (cygheap->ctty_on_hold)
|
||||||
|
{
|
||||||
|
cygheap->ctty_on_hold->close ();
|
||||||
|
cygheap->ctty_on_hold = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -719,7 +719,7 @@ vfork ()
|
||||||
vf->ctty = myself->ctty;
|
vf->ctty = myself->ctty;
|
||||||
vf->sid = myself->sid;
|
vf->sid = myself->sid;
|
||||||
vf->pgid = myself->pgid;
|
vf->pgid = myself->pgid;
|
||||||
vf->fhctty = cygheap->ctty;
|
cygheap->ctty_on_hold = cygheap->ctty;
|
||||||
vf->open_fhs = cygheap->open_fhs;
|
vf->open_fhs = cygheap->open_fhs;
|
||||||
int res = cygheap->fdtab.vfork_child_dup () ? 0 : -1;
|
int res = cygheap->fdtab.vfork_child_dup () ? 0 : -1;
|
||||||
debug_printf ("%d = vfork()", res);
|
debug_printf ("%d = vfork()", res);
|
||||||
|
@ -739,19 +739,7 @@ vfork ()
|
||||||
myself->ctty = vf->ctty;
|
myself->ctty = vf->ctty;
|
||||||
myself->sid = vf->sid;
|
myself->sid = vf->sid;
|
||||||
myself->pgid = vf->pgid;
|
myself->pgid = vf->pgid;
|
||||||
termios_printf ("cygheap->ctty %p, vf->fhctty %p", cygheap->ctty, vf->fhctty);
|
termios_printf ("cygheap->ctty %p, cygheap->ctty_on_hold %p", cygheap->ctty, cygheap->ctty_on_hold);
|
||||||
if (cygheap->ctty != vf->fhctty)
|
|
||||||
{
|
|
||||||
vf->fhctty->close ();
|
|
||||||
if (vf->pid <= 0)
|
|
||||||
{
|
|
||||||
if (vf->ctty)
|
|
||||||
vf->fhctty->close ();
|
|
||||||
cygheap->ctty = vf->fhctty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vf->pid <= 0)
|
|
||||||
cygheap->open_fhs = vf->open_fhs;
|
cygheap->open_fhs = vf->open_fhs;
|
||||||
|
|
||||||
if (vf->pid < 0)
|
if (vf->pid < 0)
|
||||||
|
|
|
@ -34,8 +34,8 @@ details. */
|
||||||
that didn't invalidate existing executables. Both numbers were
|
that didn't invalidate existing executables. Both numbers were
|
||||||
recorded in the executable and in the dll.
|
recorded in the executable and in the dll.
|
||||||
|
|
||||||
In October 1998 (starting with Cygwin 19.6), we started a new
|
In October 1998 (starting with Cygwin 19.6), we started a new method
|
||||||
means of Cygwin versioning: */
|
of Cygwin versioning: */
|
||||||
|
|
||||||
/* The DLL major and minor numbers correspond to the "version of
|
/* The DLL major and minor numbers correspond to the "version of
|
||||||
the Cygwin shared library". This version is used to track important
|
the Cygwin shared library". This version is used to track important
|
||||||
|
|
|
@ -53,7 +53,7 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
dynamically_loaded = (static_load == NULL);
|
dynamically_loaded = (static_load == NULL);
|
||||||
// __cygwin_user_data.impure_ptr = &_my_tls.local_clib;
|
// __cygwin_user_data.impure_ptr = &_my_tls.local_clib;
|
||||||
_my_tls.stackptr = _my_tls.stack;
|
_my_tls.stackptr = NULL;
|
||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -59,7 +59,6 @@ class vfork_save
|
||||||
int ctty;
|
int ctty;
|
||||||
pid_t sid;
|
pid_t sid;
|
||||||
pid_t pgid;
|
pid_t pgid;
|
||||||
class fhandler_tty_slave *fhctty;
|
|
||||||
int open_fhs;
|
int open_fhs;
|
||||||
int is_active () { return pid < 0; }
|
int is_active () { return pid < 0; }
|
||||||
void restore_pid (int val)
|
void restore_pid (int val)
|
||||||
|
|
Loading…
Reference in New Issue