From 7f775bd24d32bc1887c41550339eb0b4382e8178 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 22 Jan 2004 20:41:26 +0000 Subject: * dcrt0.cc (reent_data): Make global. * cygwin.din: Reexport reent_data. * cygtls.cc (_threadinfo::remove): Don't assume that we are removing _my_tls. * exceptions.cc (setup_handler): Improve debugging output. (call_signal_handler_now): Remove ill-advised debugger call. * sigproc.cc (sigcomplete_main): Delete. (sig_send): Honor FIXME and avoid using main thread's completion event for everything or suffer races. (pending_signals::add): Default stored mask to current process mask rather than mask at time of signal send. (wait_sig): Add debugging output. * sigproc.h (sigpacket::mask_storage): Delete. * fhandler.cc (fhandler_base::open): Revert isfs change. --- winsup/cygwin/ChangeLog | 23 + winsup/cygwin/cygtls.cc | 3 +- winsup/cygwin/cygwin.din | 1542 ++++++++++++++++++++++++++++++++ winsup/cygwin/dcrt0.cc | 2 +- winsup/cygwin/exceptions.cc | 1115 +++++++++++++++++++++++ winsup/cygwin/include/cygwin/version.h | 308 +++++++ winsup/cygwin/sigproc.cc | 35 +- 7 files changed, 3008 insertions(+), 20 deletions(-) create mode 100644 winsup/cygwin/cygwin.din create mode 100644 winsup/cygwin/exceptions.cc create mode 100644 winsup/cygwin/include/cygwin/version.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fec42cf2d7b..d3eb606ff31 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,26 @@ +2004-01-22 Christopher Faylor + + * dcrt0.cc (reent_data): Make global. + * cygwin.din: Reexport reent_data. + +2004-01-22 Christopher Faylor + + * cygtls.cc (_threadinfo::remove): Don't assume that we are removing + _my_tls. + * exceptions.cc (setup_handler): Improve debugging output. + (call_signal_handler_now): Remove ill-advised debugger call. + * sigproc.cc (sigcomplete_main): Delete. + (sig_send): Honor FIXME and avoid using main thread's completion event + for everything or suffer races. + (pending_signals::add): Default stored mask to current process mask + rather than mask at time of signal send. + (wait_sig): Add debugging output. + * sigproc.h (sigpacket::mask_storage): Delete. + +2004-01-22 Christopher Faylor + + * fhandler.cc (fhandler_base::open): Revert isfs change. + 2004-01-21 Christopher Faylor * devices.in: Change raw com device to more correct form. diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 88c8bfb323c..bb1b43a5e0e 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -139,10 +139,11 @@ _threadinfo::remove (DWORD wait) if (here.acquired ()) { for (size_t i = 0; i < nthreads; i++) - if (&_my_tls == cygheap->threadlist[i]) + if (this == cygheap->threadlist[i]) { if (i < --nthreads) cygheap->threadlist[i] = cygheap->threadlist[nthreads]; + debug_printf ("removed %p element %d", this, i); break; } } diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din new file mode 100644 index 00000000000..c208244cb27 --- /dev/null +++ b/winsup/cygwin/cygwin.din @@ -0,0 +1,1542 @@ +LIBRARY "cygwin1.dll" BASE=0x61000000 + +EXPORTS +__argc DATA +__argv DATA +__check_rhosts_file DATA +__cygwin_environ DATA +__cygwin_user_data DATA +__mb_cur_max DATA +__progname DATA +__rcmd_errstr DATA +_check_for_executable DATA +_ctype_ DATA +_daylight DATA +_sys_errlist DATA +sys_errlist = _sys_errlist DATA +_sys_nerr DATA +sys_nerr = _sys_nerr DATA +_timezone DATA +_tzname DATA +h_errno DATA +optarg DATA +opterr DATA +optind DATA +optopt DATA +optreset DATA +reent_data DATA +_alloca NOSIGFE +dll_entry@12 NOSIGFE +__assert SIGFE +__assertfail SIGFE +__eprintf SIGFE +__errno NOSIGFE +__fpclassifyd NOSIGFE +__fpclassifyf NOSIGFE +__getreent NOSIGFE +__infinity NOSIGFE +__main NOSIGFE +__signbitd NOSIGFE +__signbitf NOSIGFE +__signgam NOSIGFE +__srget SIGFE +__swbuf SIGFE +_asprintf_r SIGFE +asprintf_r = _asprintf_r SIGFE +_dll_crt0@0 NOSIGFE +_exit NOSIGFE +_f_atan2 NOSIGFE +__f_atan2 = _f_atan2 NOSIGFE +_f_atan2f NOSIGFE +__f_atan2f = _f_atan2f NOSIGFE +_f_exp NOSIGFE +__f_exp = _f_exp NOSIGFE +_f_expf NOSIGFE +__f_expf = _f_expf NOSIGFE +_f_frexp NOSIGFE +__f_frexp = _f_frexp NOSIGFE +_f_frexpf NOSIGFE +__f_frexpf = _f_frexpf NOSIGFE +_f_ldexp NOSIGFE +__f_ldexp = _f_ldexp NOSIGFE +_f_ldexpf NOSIGFE +__f_ldexpf = _f_ldexpf NOSIGFE +_f_log NOSIGFE +__f_log = _f_log NOSIGFE +_f_log10 NOSIGFE +__f_log10 = _f_log10 NOSIGFE +_f_log10f NOSIGFE +__f_log10f = _f_log10f NOSIGFE +_f_logf NOSIGFE +__f_logf = _f_logf NOSIGFE +_f_pow NOSIGFE +__f_pow = _f_pow NOSIGFE +_f_powf NOSIGFE +__f_powf = _f_powf NOSIGFE +_f_tan NOSIGFE +__f_tan = _f_tan NOSIGFE +_f_tanf NOSIGFE +__f_tanf = _f_tanf NOSIGFE +_fcloseall_r SIGFE +fcloseall_r = _fcloseall_r SIGFE +_fscanf_r SIGFE +fscanf_r = _fscanf_r SIGFE +fstat SIGFE +_fstat = fstat SIGFE +_pipe SIGFE +_pthread_cleanup_pop NOSIGFE +_pthread_cleanup_push NOSIGFE +_scanf_r SIGFE +scanf_r = _scanf_r SIGFE +_sscanf_r SIGFE +sscanf_r = _sscanf_r SIGFE +stat SIGFE +_stat = stat SIGFE +_strtold SIGFE +trunc NOSIGFE +_vasprintf_r SIGFE +vasprintf_r = _vasprintf_r SIGFE +_vfscanf_r NOSIGFE +vfscanf_r = _vfscanf_r NOSIGFE +_vscanf_r SIGFE +vscanf_r = _vscanf_r SIGFE +_vsscanf_r SIGFE +vsscanf_r = _vsscanf_r SIGFE +a64l NOSIGFE +abort SIGFE +_abort = abort SIGFE +abs NOSIGFE +_abs = abs NOSIGFE +access SIGFE +_access = access SIGFE +acl SIGFE +_acl = acl SIGFE +_acl32 = acl32 SIGFE +aclcheck NOSIGFE +_aclcheck = aclcheck NOSIGFE +_aclcheck32 = aclcheck32 NOSIGFE +aclfrommode SIGFE +_aclfrommode = aclfrommode SIGFE +_aclfrommode32 = aclfrommode32 SIGFE +aclfrompbits SIGFE +_aclfrompbits = aclfrompbits SIGFE +_aclfrompbits32 = aclfrompbits32 SIGFE +aclfromtext SIGFE +_aclfromtext = aclfromtext SIGFE +_aclfromtext32 = aclfromtext32 SIGFE +aclsort SIGFE +_aclsort = aclsort SIGFE +_aclsort32 = aclsort32 SIGFE +acltomode SIGFE +_acltomode = acltomode SIGFE +_acltomode32 = acltomode32 SIGFE +acltopbits SIGFE +_acltopbits = acltopbits SIGFE +_acltopbits32 = acltopbits32 SIGFE +acltotext SIGFE +_acltotext = acltotext SIGFE +_acltotext32 = acltotext32 SIGFE +acos NOSIGFE +_acos = acos NOSIGFE +acosf NOSIGFE +_acosf = acosf NOSIGFE +acosh NOSIGFE +_acosh = acosh NOSIGFE +acoshf NOSIGFE +_acoshf = acoshf NOSIGFE +alarm SIGFE +_alarm = alarm SIGFE +alphasort NOSIGFE +_alphasort = alphasort NOSIGFE +argz_add SIGFE +__argz_add = argz_add SIGFE +argz_add_sep SIGFE +__argz_add_sep = argz_add_sep SIGFE +argz_append SIGFE +__argz_append = argz_append SIGFE +argz_count NOSIGFE +__argz_count = argz_count NOSIGFE +argz_create SIGFE +__argz_create = argz_create SIGFE +argz_create_sep SIGFE +__argz_create_sep = argz_create_sep SIGFE +argz_delete SIGFE +__argz_delete = argz_delete SIGFE +argz_extract NOSIGFE +__argz_extract = argz_extract NOSIGFE +argz_insert SIGFE +__argz_insert = argz_insert SIGFE +argz_next NOSIGFE +__argz_next = argz_next NOSIGFE +argz_replace SIGFE +__argz_replace = argz_replace SIGFE +argz_stringify NOSIGFE +__argz_stringify = argz_stringify NOSIGFE +asctime SIGFE +_asctime = asctime SIGFE +asctime_r SIGFE +_asctime_r = asctime_r SIGFE +asin NOSIGFE +_asin = asin NOSIGFE +asinf NOSIGFE +_asinf = asinf NOSIGFE +asinh NOSIGFE +_asinh = asinh NOSIGFE +asinhf NOSIGFE +_asinhf = asinhf NOSIGFE +asprintf SIGFE +_asprintf = asprintf SIGFE +atan NOSIGFE +_atan = atan NOSIGFE +atan2 NOSIGFE +_atan2 = atan2 NOSIGFE +atan2f NOSIGFE +_atan2f = atan2f NOSIGFE +atanf NOSIGFE +_atanf = atanf NOSIGFE +atanh NOSIGFE +_atanh = atanh NOSIGFE +atanhf NOSIGFE +_atanhf = atanhf NOSIGFE +atexit = cygwin_atexit SIGFE +_atexit = cygwin_atexit SIGFE +atof SIGFE +_atof = atof SIGFE +atoff SIGFE +_atoff = atoff SIGFE +atoi NOSIGFE +_atoi = atoi NOSIGFE +atol NOSIGFE +_atol = atol NOSIGFE +bcmp NOSIGFE +_bcmp = bcmp NOSIGFE +bcopy NOSIGFE +_bcopy = bcopy NOSIGFE +bsearch NOSIGFE +_bsearch = bsearch NOSIGFE +btowc NOSIGFE +bzero NOSIGFE +_bzero = bzero NOSIGFE +cabs NOSIGFE +_cabs = cabs NOSIGFE +cabsf NOSIGFE +_cabsf = cabsf NOSIGFE +calloc SIGFE +_calloc = calloc SIGFE +cbrt NOSIGFE +_cbrt = cbrt NOSIGFE +cbrtf NOSIGFE +_cbrtf = cbrtf NOSIGFE +ceil NOSIGFE +_ceil = ceil NOSIGFE +ceilf NOSIGFE +_ceilf = ceilf NOSIGFE +cfgetispeed NOSIGFE +cfgetospeed NOSIGFE +cfsetispeed SIGFE +cfsetospeed SIGFE +chdir SIGFE +_chdir = chdir SIGFE +chmod SIGFE +_chmod = chmod SIGFE +chown SIGFE +_chown = chown SIGFE +_chown32 = chown32 SIGFE +chroot SIGFE +_chroot = chroot SIGFE +cleanup_glue NOSIGFE +clearerr NOSIGFE +_clearerr = clearerr NOSIGFE +clock NOSIGFE +_clock = clock NOSIGFE +close SIGFE +_close = close SIGFE +closedir SIGFE +_closedir = closedir SIGFE +closelog NOSIGFE +_closelog = closelog NOSIGFE +copysign NOSIGFE +_copysign = copysign NOSIGFE +copysignf NOSIGFE +_copysignf = copysignf NOSIGFE +cos NOSIGFE +_cos = cos NOSIGFE +cosf NOSIGFE +_cosf = cosf NOSIGFE +cosh NOSIGFE +_cosh = cosh NOSIGFE +coshf NOSIGFE +_coshf = coshf NOSIGFE +creat SIGFE +_creat = creat SIGFE +ctermid NOSIGFE +ctime SIGFE +_ctime = ctime SIGFE +ctime_r SIGFE +_ctime_r = ctime_r SIGFE +cuserid NOSIGFE +_cuserid = cuserid NOSIGFE +cwait SIGFE +_cwait = cwait SIGFE +accept = cygwin_accept SIGFE +cygwin_attach_handle_to_fd SIGFE +cygwin32_attach_handle_to_fd = cygwin_attach_handle_to_fd SIGFE +bind = cygwin_bind SIGFE +connect = cygwin_connect SIGFE +cygwin_conv_to_full_posix_path SIGFE +cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE +cygwin_conv_to_full_win32_path SIGFE +cygwin32_conv_to_full_win32_path = cygwin_conv_to_full_win32_path SIGFE +cygwin_conv_to_posix_path SIGFE +cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE +cygwin_conv_to_win32_path SIGFE +cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE +cygwin_detach_dll NOSIGFE +cygwin32_detach_dll = cygwin_detach_dll NOSIGFE +cygwin_dll_init NOSIGFE +endprotoent = cygwin_endprotoent SIGFE +endservent = cygwin_endservent SIGFE +endusershell SIGFE +err SIGFE +errx SIGFE +gethostbyaddr = cygwin_gethostbyaddr SIGFE +gethostbyname = cygwin_gethostbyname SIGFE +_gethostname = cygwin_gethostname SIGFE +gethostname = cygwin_gethostname SIGFE +getpeername = cygwin_getpeername SIGFE +getprogname NOSIGFE +getprotobyname = cygwin_getprotobyname SIGFE +getprotobynumber = cygwin_getprotobynumber SIGFE +getprotoent = cygwin_getprotoent SIGFE +getservbyname = cygwin_getservbyname SIGFE +getservbyport = cygwin_getservbyport SIGFE +getservent = cygwin_getservent SIGFE +getsockname = cygwin_getsockname SIGFE +getsockopt = cygwin_getsockopt SIGFE +getusershell SIGFE +herror = cygwin_herror SIGFE +hstrerror = cygwin_hstrerror NOSIGFE +inet_addr = cygwin_inet_addr SIGFE +inet_aton = cygwin_inet_aton SIGFE +inet_network = cygwin_inet_network SIGFE +inet_ntoa = cygwin_inet_ntoa SIGFE +cygwin_internal NOSIGFE +cygwin32_internal = cygwin_internal NOSIGFE +listen = cygwin_listen SIGFE +cygwin_logon_user SIGFE +lstat SIGFE +_lstat = lstat SIGFE +cygwin_posix_path_list_p NOSIGFE +cygwin32_posix_path_list_p = cygwin_posix_path_list_p NOSIGFE +cygwin_posix_to_win32_path_list NOSIGFE +cygwin32_posix_to_win32_path_list = cygwin_posix_to_win32_path_list NOSIGFE +cygwin_posix_to_win32_path_list_buf_size SIGFE +cygwin32_posix_to_win32_path_list_buf_size = cygwin_posix_to_win32_path_list_buf_size SIGFE +rcmd = cygwin_rcmd SIGFE +recv = cygwin_recv SIGFE +recvfrom = cygwin_recvfrom SIGFE +recvmsg = cygwin_recvmsg SIGFE +rexec = cygwin_rexec SIGFE +rresvport = cygwin_rresvport SIGFE +_select = cygwin_select SIGFE +select = cygwin_select SIGFE +send = cygwin_send SIGFE +sendmsg = cygwin_sendmsg SIGFE +sendto = cygwin_sendto SIGFE +cygwin_set_impersonation_token SIGFE +setprogname SIGFE +setprotoent = cygwin_setprotoent SIGFE +setservent = cygwin_setservent SIGFE +setsockopt = cygwin_setsockopt SIGFE +setusershell SIGFE +shutdown = cygwin_shutdown SIGFE +socket = cygwin_socket SIGFE +cygwin_split_path NOSIGFE +cygwin32_split_path = cygwin_split_path NOSIGFE +cygwin_stackdump SIGFE +cygwin_umount SIGFE +cygwin_win32_to_posix_path_list NOSIGFE +cygwin32_win32_to_posix_path_list = cygwin_win32_to_posix_path_list NOSIGFE +cygwin_win32_to_posix_path_list_buf_size SIGFE +cygwin32_win32_to_posix_path_list_buf_size = cygwin_win32_to_posix_path_list_buf_size SIGFE +cygwin_winpid_to_pid SIGFE +cygwin32_winpid_to_pid = cygwin_winpid_to_pid SIGFE +daemon SIGFE +difftime NOSIGFE +_difftime = difftime NOSIGFE +dirfd SIGFE +_dirfd = dirfd SIGFE +div NOSIGFE +_div = div NOSIGFE +dlclose SIGFE +dlerror NOSIGFE +dlfork NOSIGFE +dll_crt0__FP11per_process NOSIGFE +dll_dllcrt0 NOSIGFE +dll_noncygwin_dllcrt0 NOSIGFE +dlopen SIGFE +dlsym SIGFE +drand48 NOSIGFE +_drand48 = drand48 NOSIGFE +drem NOSIGFE +_drem = drem NOSIGFE +dremf NOSIGFE +_dremf = dremf NOSIGFE +dup SIGFE +_dup = dup SIGFE +dup2 SIGFE +_dup2 = dup2 SIGFE +ecvt SIGFE +_ecvt = ecvt SIGFE +ecvtbuf SIGFE +_ecvtbuf = ecvtbuf SIGFE +ecvtf SIGFE +_ecvtf = ecvtf SIGFE +endgrent NOSIGFE +_endgrent = endgrent NOSIGFE +endhostent NOSIGFE +endmntent NOSIGFE +_endmntent = endmntent NOSIGFE +endpwent NOSIGFE +_endpwent = endpwent NOSIGFE +endutent SIGFE +_endutent = endutent SIGFE +envz_add SIGFE +__envz_add = envz_add SIGFE +envz_entry NOSIGFE +__envz_entry = envz_entry NOSIGFE +envz_get NOSIGFE +__envz_get = envz_get NOSIGFE +envz_merge SIGFE +__envz_merge = envz_merge SIGFE +envz_remove SIGFE +__envz_remove = envz_remove SIGFE +envz_strip SIGFE +__envz_strip = envz_strip SIGFE +erand48 NOSIGFE +_erand48 = erand48 NOSIGFE +erf NOSIGFE +_erf = erf NOSIGFE +erfc NOSIGFE +_erfc = erfc NOSIGFE +erfcf NOSIGFE +_erfcf = erfcf NOSIGFE +erff NOSIGFE +_erff = erff NOSIGFE +execl SIGFE +_execl = execl SIGFE +execle SIGFE +_execle = execle SIGFE +execlp SIGFE +_execlp = execlp SIGFE +execv SIGFE +_execv = execv SIGFE +execve SIGFE +_execve = execve SIGFE +execvp SIGFE +_execvp = execvp SIGFE +exit = cygwin_exit NOSIGFE +exp NOSIGFE +_exp = exp NOSIGFE +exp2 NOSIGFE +exp2f NOSIGFE +expf NOSIGFE +_expf = expf NOSIGFE +expm1 NOSIGFE +_expm1 = expm1 NOSIGFE +expm1f NOSIGFE +_expm1f = expm1f NOSIGFE +fabs NOSIGFE +_fabs = fabs NOSIGFE +fabsf NOSIGFE +_fabsf = fabsf NOSIGFE +facl SIGFE +_facl = facl SIGFE +_facl32 = facl32 SIGFE +fchdir SIGFE +_fchdir = fchdir SIGFE +fchmod SIGFE +_fchmod = fchmod SIGFE +fchown SIGFE +_fchown = fchown SIGFE +_fchown32 = fchown32 SIGFE +fclose SIGFE +_fclose = fclose SIGFE +fcloseall SIGFE +_fcloseall = fcloseall SIGFE +fcntl SIGFE +_fcntl = fcntl SIGFE +_fcntl64 = fcntl64 SIGFE +fcvt SIGFE +_fcvt = fcvt SIGFE +fcvtbuf SIGFE +_fcvtbuf = fcvtbuf SIGFE +fcvtf SIGFE +_fcvtf = fcvtf SIGFE +fdim NOSIGFE +fdimf NOSIGFE +fdopen SIGFE +_fdopen = fdopen SIGFE +_fdopen64 = fdopen64 SIGFE +feof NOSIGFE +_feof = feof NOSIGFE +ferror NOSIGFE +_ferror = ferror NOSIGFE +fflush NOSIGFE +_fflush = fflush NOSIGFE +ffs NOSIGFE +_ffs = ffs NOSIGFE +fgetc SIGFE +_fgetc = fgetc SIGFE +fgetpos NOSIGFE +_fgetpos = fgetpos NOSIGFE +_fgetpos64 = fgetpos64 NOSIGFE +fgets SIGFE +_fgets = fgets SIGFE +fileno NOSIGFE +_fileno = fileno NOSIGFE +finite NOSIGFE +_finite = finite NOSIGFE +finitef NOSIGFE +_finitef = finitef NOSIGFE +fiprintf SIGFE +_fiprintf = fiprintf SIGFE +flock SIGFE +flock SIGFE +floor NOSIGFE +_floor = floor NOSIGFE +floorf NOSIGFE +_floorf = floorf NOSIGFE +fma NOSIGFE +fmaf NOSIGFE +fmax NOSIGFE +fmaxf NOSIGFE +fmin NOSIGFE +fminf NOSIGFE +fmod NOSIGFE +_fmod = fmod NOSIGFE +fmodf NOSIGFE +_fmodf = fmodf NOSIGFE +fnmatch NOSIGFE +_fnmatch = fnmatch NOSIGFE +fopen SIGFE +_fopen = fopen SIGFE +_fopen64 = fopen64 SIGFE +fork SIGFE +_fork = fork SIGFE +forkpty SIGFE +fpathconf SIGFE +fprintf SIGFE +_fprintf = fprintf SIGFE +fputc NOSIGFE +_fputc = fputc NOSIGFE +fputs SIGFE +_fputs = fputs SIGFE +fread SIGFE +_fread = fread SIGFE +free SIGFE +_free = free SIGFE +freopen SIGFE +_freopen = freopen SIGFE +_freopen64 = freopen64 SIGFE +frexp NOSIGFE +_frexp = frexp NOSIGFE +frexpf NOSIGFE +_frexpf = frexpf NOSIGFE +fscanf SIGFE +_fscanf = fscanf SIGFE +fseek SIGFE +_fseek = fseek SIGFE +fseeko SIGFE +_fseeko = fseeko SIGFE +_fseeko64 = fseeko64 SIGFE +fsetpos SIGFE +_fsetpos = fsetpos SIGFE +_fsetpos64 = fsetpos64 SIGFE +_fstat64 = fstat64 SIGFE +fstatfs SIGFE +_fstatfs = fstatfs SIGFE +fsync SIGFE +_fsync = fsync SIGFE +ftell NOSIGFE +_ftell = ftell NOSIGFE +ftello NOSIGFE +_ftello = ftello NOSIGFE +_ftello64 = ftello64 NOSIGFE +ftime SIGFE +_ftime = ftime SIGFE +ftok SIGFE +_ftok = ftok SIGFE +ftruncate SIGFE +_ftruncate = ftruncate SIGFE +_ftruncate64 = ftruncate64 SIGFE +fwrite SIGFE +_fwrite = fwrite SIGFE +gamma NOSIGFE +_gamma = gamma NOSIGFE +gamma_r NOSIGFE +_gamma_r = gamma_r NOSIGFE +gammaf NOSIGFE +_gammaf = gammaf NOSIGFE +gammaf_r NOSIGFE +_gammaf_r = gammaf_r NOSIGFE +gcvt SIGFE +_gcvt = gcvt SIGFE +gcvtf SIGFE +_gcvtf = gcvtf SIGFE +get_osfhandle SIGFE +_get_osfhandle = get_osfhandle SIGFE +getc SIGFE +_getc = getc SIGFE +getc_unlocked SIGFE +_getc_unlocked = getc_unlocked SIGFE +getchar NOSIGFE +_getchar = getchar NOSIGFE +getchar_unlocked NOSIGFE +_getchar_unlocked = getchar_unlocked NOSIGFE +getcwd SIGFE +_getcwd = getcwd SIGFE +getdomainname SIGFE +_getdomainname = getdomainname SIGFE +getdtablesize NOSIGFE +_getdtablesize = getdtablesize NOSIGFE +getegid NOSIGFE +_getegid = getegid NOSIGFE +_getegid32 = getegid32 NOSIGFE +getenv NOSIGFE +_getenv = getenv NOSIGFE +geteuid NOSIGFE +_geteuid = geteuid NOSIGFE +_geteuid32 = geteuid32 NOSIGFE +getgid NOSIGFE +_getgid = getgid NOSIGFE +_getgid32 = getgid32 NOSIGFE +getgrent SIGFE +_getgrent = getgrent SIGFE +_getgrent32 = getgrent32 SIGFE +getgrgid SIGFE +_getgrgid = getgrgid SIGFE +_getgrgid32 = getgrgid32 SIGFE +getgrnam SIGFE +_getgrnam = getgrnam SIGFE +_getgrnam32 = getgrnam32 SIGFE +getgroups SIGFE +_getgroups = getgroups SIGFE +_getgroups32 = getgroups32 SIGFE +gethostid SIGFE +getitimer SIGFE +getlogin NOSIGFE +_getlogin = getlogin NOSIGFE +getmntent SIGFE +_getmntent = getmntent SIGFE +getmode SIGFE +_getmode = getmode SIGFE +getopt SIGFE +getopt_long SIGFE +getpagesize SIGFE +_getpagesize = getpagesize SIGFE +getpass SIGFE +_getpass = getpass SIGFE +getpgid SIGFE +getpgrp SIGFE +_getpgrp = getpgrp SIGFE +getpid NOSIGFE +_getpid = getpid NOSIGFE +getppid NOSIGFE +_getppid = getppid NOSIGFE +getpwduid NOSIGFE +_getpwduid = getpwduid NOSIGFE +getpwent SIGFE +_getpwent = getpwent SIGFE +getpwnam SIGFE +_getpwnam = getpwnam SIGFE +getpwnam_r SIGFE +getpwuid SIGFE +_getpwuid = getpwuid SIGFE +_getpwuid32 = getpwuid32 SIGFE +getpwuid_r SIGFE +_getpwuid_r32 = getpwuid_r32 SIGFE +getrlimit SIGFE +_getrlimit = getrlimit SIGFE +getrusage SIGFE +_getrusage = getrusage SIGFE +gets NOSIGFE +_gets = gets NOSIGFE +getsid SIGFE +gettimeofday SIGFE +_gettimeofday = gettimeofday SIGFE +getuid NOSIGFE +_getuid = getuid NOSIGFE +_getuid32 = getuid32 NOSIGFE +getutent SIGFE +_getutent = getutent SIGFE +getutid SIGFE +_getutid = getutid SIGFE +getutline SIGFE +_getutline = getutline SIGFE +getw SIGFE +_getw = getw SIGFE +getwd SIGFE +_getwd = getwd SIGFE +glob SIGFE +_glob = glob SIGFE +globfree SIGFE +_globfree = globfree SIGFE +gmtime SIGFE +_gmtime = gmtime SIGFE +gmtime_r SIGFE +_gmtime_r = gmtime_r SIGFE +grantpt NOSIGFE +hcreate SIGFE +hcreate_r SIGFE +hdestroy SIGFE +hdestroy_r SIGFE +hsearch SIGFE +hsearch_r SIGFE +htonl NOSIGFE +_htonl = htonl NOSIGFE +htons NOSIGFE +_htons = htons NOSIGFE +hypot NOSIGFE +_hypot = hypot NOSIGFE +hypotf NOSIGFE +_hypotf = hypotf NOSIGFE +ilogb NOSIGFE +_ilogb = ilogb NOSIGFE +ilogbf NOSIGFE +_ilogbf = ilogbf NOSIGFE +index NOSIGFE +_index = index NOSIGFE +inet_makeaddr NOSIGFE +inet_netof NOSIGFE +infinity NOSIGFE +_infinity = infinity NOSIGFE +infinityf NOSIGFE +_infinityf = infinityf NOSIGFE +initgroups SIGFE +_initgroups32 = initgroups32 SIGFE +initstate NOSIGFE +ioctl SIGFE +_ioctl = ioctl SIGFE +iprintf SIGFE +_iprintf = iprintf SIGFE +iruserok SIGFE +ruserok SIGFE +isalnum NOSIGFE +_isalnum = isalnum NOSIGFE +isalpha NOSIGFE +_isalpha = isalpha NOSIGFE +isascii NOSIGFE +_isascii = isascii NOSIGFE +isatty SIGFE +_isatty = isatty SIGFE +isblank NOSIGFE +iscntrl NOSIGFE +_iscntrl = iscntrl NOSIGFE +isdigit NOSIGFE +_isdigit = isdigit NOSIGFE +isgraph NOSIGFE +_isgraph = isgraph NOSIGFE +isinf NOSIGFE +_isinf = isinf NOSIGFE +isinff NOSIGFE +_isinff = isinff NOSIGFE +islower NOSIGFE +_islower = islower NOSIGFE +isnan NOSIGFE +_isnan = isnan NOSIGFE +isnanf NOSIGFE +_isnanf = isnanf NOSIGFE +isprint NOSIGFE +_isprint = isprint NOSIGFE +ispunct NOSIGFE +_ispunct = ispunct NOSIGFE +isspace NOSIGFE +_isspace = isspace NOSIGFE +isupper NOSIGFE +_isupper = isupper NOSIGFE +iswalnum NOSIGFE +iswalpha NOSIGFE +iswblank NOSIGFE +iswcntrl NOSIGFE +iswctype NOSIGFE +iswdigit NOSIGFE +iswgraph NOSIGFE +iswlower NOSIGFE +iswprint NOSIGFE +iswpunct NOSIGFE +iswspace NOSIGFE +iswupper NOSIGFE +iswxdigit NOSIGFE +isxdigit NOSIGFE +_isxdigit = isxdigit NOSIGFE +j0 NOSIGFE +_j0 = j0 NOSIGFE +j0f NOSIGFE +_j0f = j0f NOSIGFE +j1 NOSIGFE +_j1 = j1 NOSIGFE +j1f NOSIGFE +_j1f = j1f NOSIGFE +jn NOSIGFE +_jn = jn NOSIGFE +jnf NOSIGFE +_jnf = jnf NOSIGFE +jrand48 NOSIGFE +_jrand48 = jrand48 NOSIGFE +kill SIGFE +_kill = kill SIGFE +killpg SIGFE +l64a NOSIGFE +labs NOSIGFE +_labs = labs NOSIGFE +lacl SIGFE +_lacl = lacl SIGFE +lchown SIGFE +_lchown = lchown SIGFE +_lchown32 = lchown32 SIGFE +lcong48 NOSIGFE +_lcong48 = lcong48 NOSIGFE +ldexp NOSIGFE +_ldexp = ldexp NOSIGFE +ldexpf NOSIGFE +_ldexpf = ldexpf NOSIGFE +ldiv NOSIGFE +_ldiv = ldiv NOSIGFE +lgamma NOSIGFE +_lgamma = lgamma NOSIGFE +lgamma_r NOSIGFE +_lgamma_r = lgamma_r NOSIGFE +lgammaf NOSIGFE +_lgammaf = lgammaf NOSIGFE +lgammaf_r NOSIGFE +_lgammaf_r = lgammaf_r NOSIGFE +link SIGFE +_link = link SIGFE +localeconv NOSIGFE +_localeconv = localeconv NOSIGFE +localtime SIGFE +_localtime = localtime SIGFE +localtime_r NOSIGFE +_localtime_r = localtime_r NOSIGFE +log NOSIGFE +_log = log NOSIGFE +log10 NOSIGFE +_log10 = log10 NOSIGFE +log10f NOSIGFE +_log10f = log10f NOSIGFE +log1p NOSIGFE +_log1p = log1p NOSIGFE +log1pf NOSIGFE +_log1pf = log1pf NOSIGFE +logb NOSIGFE +_logb = logb NOSIGFE +logbf NOSIGFE +_logbf = logbf NOSIGFE +logf NOSIGFE +_logf = logf NOSIGFE +login SIGFE +login_tty SIGFE +logout SIGFE +logwtmp SIGFE +updwtmp SIGFE +longjmp NOSIGFE +_longjmp = longjmp NOSIGFE +lrand48 NOSIGFE +_lrand48 = lrand48 NOSIGFE +lrint NOSIGFE +lrintf NOSIGFE +lround NOSIGFE +lroundf NOSIGFE +lseek SIGFE +_lseek = lseek SIGFE +_lseek64 = lseek64 SIGFE +_lstat64 = lstat64 SIGFE +mallinfo SIGFE +malloc SIGFE +_malloc = malloc SIGFE +malloc_stats SIGFE +malloc_trim SIGFE +malloc_usable_size SIGFE +mallopt SIGFE +matherr NOSIGFE +_matherr = matherr NOSIGFE +mblen NOSIGFE +_mblen = mblen NOSIGFE +mbrlen NOSIGFE +mbrtowc NOSIGFE +mbsinit NOSIGFE +mbsrtowcs NOSIGFE +mbstowcs NOSIGFE +_mbstowcs = mbstowcs NOSIGFE +mbtowc NOSIGFE +_mbtowc = mbtowc NOSIGFE +memalign SIGFE +memccpy NOSIGFE +_memccpy = memccpy NOSIGFE +memchr NOSIGFE +_memchr = memchr NOSIGFE +memcmp NOSIGFE +_memcmp = memcmp NOSIGFE +memcpy NOSIGFE +_memcpy = memcpy NOSIGFE +memmove NOSIGFE +_memmove = memmove NOSIGFE +mempcpy NOSIGFE +__mempcpy = mempcpy NOSIGFE +memset NOSIGFE +_memset = memset NOSIGFE +mkdir SIGFE +_mkdir = mkdir SIGFE +mkfifo SIGFE +mknod SIGFE +_mknod = mknod SIGFE +_mknod32 = mknod32 SIGFE +mkstemp SIGFE +_mkstemp = mkstemp SIGFE +mktemp SIGFE +_mktemp = mktemp SIGFE +mktime SIGFE +_mktime = mktime SIGFE +mmap SIGFE +_mmap64 = mmap64 SIGFE +modf NOSIGFE +_modf = modf NOSIGFE +modff NOSIGFE +_modff = modff NOSIGFE +mount SIGFE +_mount = mount SIGFE +mprotect SIGFE +mrand48 NOSIGFE +msgctl SIGFE +msgget SIGFE +msgrcv SIGFE +msgsnd SIGFE +msync SIGFE +munmap SIGFE +nan NOSIGFE +_nan = nan NOSIGFE +nanf NOSIGFE +_nanf = nanf NOSIGFE +nanosleep SIGFE +_nanosleep = nanosleep SIGFE +nearbyint NOSIGFE +nearbyintf NOSIGFE +nextafter NOSIGFE +_nextafter = nextafter NOSIGFE +nextafterf NOSIGFE +_nextafterf = nextafterf NOSIGFE +nice SIGFE +_nice = nice SIGFE +nl_langinfo SIGFE +_nl_langinfo = nl_langinfo SIGFE +nrand48 NOSIGFE +_nrand48 = nrand48 NOSIGFE +ntohl NOSIGFE +_ntohl = ntohl NOSIGFE +ntohs NOSIGFE +_ntohs = ntohs NOSIGFE +on_exit SIGFE +open SIGFE +_open = open SIGFE +_open64 +opendir SIGFE +_opendir = opendir SIGFE +openlog SIGFE +_openlog = openlog SIGFE +openpty SIGFE +pathconf SIGFE +_pathconf = pathconf SIGFE +pause SIGFE +pclose SIGFE +_pclose = pclose SIGFE +perror SIGFE +_perror = perror SIGFE +pipe SIGFE +poll SIGFE +_poll = poll SIGFE +popen SIGFE +_popen = popen SIGFE +posix_regcomp SIGFE +posix_regerror SIGFE +posix_regexec SIGFE +posix_regfree SIGFE +pow NOSIGFE +_pow = pow NOSIGFE +powf NOSIGFE +_powf = powf NOSIGFE +printf SIGFE +_printf = printf SIGFE +pthread_atfork SIGFE +pthread_attr_destroy NOSIGFE +pthread_attr_getdetachstate NOSIGFE +pthread_attr_getinheritsched NOSIGFE +pthread_attr_getschedparam NOSIGFE +pthread_attr_getschedpolicy NOSIGFE +pthread_attr_getscope NOSIGFE +pthread_attr_getstacksize NOSIGFE +pthread_attr_init SIGFE +pthread_attr_setdetachstate NOSIGFE +pthread_attr_setinheritsched NOSIGFE +pthread_attr_setschedparam NOSIGFE +pthread_attr_setschedpolicy NOSIGFE +pthread_attr_setscope NOSIGFE +pthread_attr_setstacksize NOSIGFE +pthread_cancel NOSIGFE +pthread_cond_broadcast SIGFE +pthread_cond_destroy NOSIGFE +pthread_cond_init SIGFE +pthread_cond_signal SIGFE +pthread_cond_timedwait SIGFE +pthread_cond_wait SIGFE +pthread_condattr_destroy NOSIGFE +pthread_condattr_getpshared NOSIGFE +pthread_condattr_init SIGFE +pthread_condattr_setpshared NOSIGFE +pthread_continue SIGFE +pthread_create SIGFE +pthread_detach SIGFE +pthread_equal NOSIGFE +pthread_exit NOSIGFE +pthread_getconcurrency NOSIGFE +pthread_getschedparam NOSIGFE +pthread_getsequence_np NOSIGFE +pthread_getspecific NOSIGFE +pthread_join SIGFE +pthread_key_create SIGFE +pthread_key_delete NOSIGFE +pthread_kill SIGFE +pthread_mutex_destroy NOSIGFE +pthread_mutex_getprioceiling SIGFE +pthread_mutex_init SIGFE +pthread_mutex_lock SIGFE +pthread_mutex_setprioceiling SIGFE +pthread_mutex_trylock SIGFE +pthread_mutex_unlock SIGFE +pthread_mutexattr_destroy NOSIGFE +pthread_mutexattr_getprioceiling NOSIGFE +pthread_mutexattr_getprotocol NOSIGFE +pthread_mutexattr_getpshared NOSIGFE +pthread_mutexattr_gettype NOSIGFE +pthread_mutexattr_init SIGFE +pthread_mutexattr_setprioceiling NOSIGFE +pthread_mutexattr_setprotocol NOSIGFE +pthread_mutexattr_setpshared NOSIGFE +pthread_mutexattr_settype NOSIGFE +pthread_once SIGFE +pthread_rwlock_destroy NOSIGFE +pthread_rwlock_init SIGFE +pthread_rwlock_rdlock SIGFE +pthread_rwlock_tryrdlock SIGFE +pthread_rwlock_wrlock SIGFE +pthread_rwlock_trywrlock SIGFE +pthread_rwlock_unlock SIGFE +pthread_rwlockattr_init SIGFE +pthread_rwlockattr_getpshared NOSIGFE +pthread_rwlockattr_setpshared NOSIGFE +pthread_rwlockattr_destroy NOSIGFE +pthread_self NOSIGFE +pthread_setcancelstate NOSIGFE +pthread_setcanceltype NOSIGFE +pthread_setconcurrency NOSIGFE +pthread_setschedparam SIGFE +pthread_setspecific NOSIGFE +pthread_sigmask SIGFE +pthread_suspend SIGFE +pthread_testcancel NOSIGFE +ptsname SIGFE +putc SIGFE +_putc = putc SIGFE +putc_unlocked SIGFE +_putc_unlocked = putc_unlocked SIGFE +putchar NOSIGFE +_putchar = putchar NOSIGFE +putchar_unlocked NOSIGFE +_putchar_unlocked = putchar_unlocked NOSIGFE +putenv SIGFE +_putenv = putenv SIGFE +puts SIGFE +_puts = puts SIGFE +pututline SIGFE +_pututline = pututline SIGFE +putw SIGFE +_putw = putw SIGFE +qsort NOSIGFE +_qsort = qsort NOSIGFE +raise SIGFE +_raise = raise SIGFE +rand NOSIGFE +_rand = rand NOSIGFE +random NOSIGFE +read SIGFE +_read = read SIGFE +readdir SIGFE +_readdir = readdir SIGFE +readlink SIGFE +_readlink = readlink SIGFE +readv SIGFE +_readv = readv SIGFE +realloc SIGFE +_realloc = realloc SIGFE +realpath SIGFE +remainder NOSIGFE +_remainder = remainder NOSIGFE +remainderf NOSIGFE +_remainderf = remainderf NOSIGFE +remove SIGFE +_remove = remove SIGFE +remquo NOSIGFE +remquof NOSIGFE +rename SIGFE +_rename = rename SIGFE +revoke SIGFE +rewind SIGFE +_rewind = rewind SIGFE +rewinddir SIGFE +_rewinddir = rewinddir SIGFE +rindex NOSIGFE +_rindex = rindex NOSIGFE +rint NOSIGFE +_rint = rint NOSIGFE +rintf NOSIGFE +_rintf = rintf NOSIGFE +rmdir SIGFE +_rmdir = rmdir SIGFE +round NOSIGFE +roundf NOSIGFE +sbrk SIGFE +_sbrk = sbrk SIGFE +scalb NOSIGFE +_scalb = scalb NOSIGFE +scalbf NOSIGFE +_scalbf = scalbf NOSIGFE +scalbln NOSIGFE +scalblnf NOSIGFE +scalbn NOSIGFE +_scalbn = scalbn NOSIGFE +scalbnf NOSIGFE +_scalbnf = scalbnf NOSIGFE +scandir SIGFE +_scandir = scandir SIGFE +scanf SIGFE +_scanf = scanf SIGFE +sched_get_priority_max SIGFE +sched_get_priority_min SIGFE +sched_getparam SIGFE +sched_getscheduler NOSIGFE +sched_rr_get_interval SIGFE +sched_setparam SIGFE +sched_setscheduler SIGFE +sched_yield SIGFE +seed48 NOSIGFE +_seed48 = seed48 NOSIGFE +seekdir SIGFE +_seekdir = seekdir SIGFE +_seekdir64 = seekdir64 SIGFE +sem_close SIGFE +sem_destroy NOSIGFE +sem_getvalue SIGFE +sem_init SIGFE +sem_open SIGFE +sem_post SIGFE +sem_timedwait SIGFE +sem_trywait SIGFE +sem_wait SIGFE +semctl SIGFE +semget SIGFE +semop SIGFE +setbuf SIGFE +_setbuf = setbuf SIGFE +setbuffer SIGFE +setdtablesize SIGFE +_setdtablesize = setdtablesize SIGFE +setegid SIGFE +_setegid = setegid SIGFE +_setegid32 = setegid32 SIGFE +setenv SIGFE +_setenv = setenv SIGFE +seteuid SIGFE +_seteuid = seteuid SIGFE +_seteuid32 = seteuid32 SIGFE +setgid SIGFE +_setgid = setgid SIGFE +_setgid32 = setgid32 SIGFE +setgrent NOSIGFE +_setgrent = setgrent NOSIGFE +setgroups SIGFE +_setgroups = setgroups SIGFE +_setgroups32 = setgroups32 SIGFE +sethostent NOSIGFE +setitimer SIGFE +setjmp NOSIGFE +_setjmp = setjmp NOSIGFE +setlinebuf SIGFE +setlocale NOSIGFE +_setlocale = setlocale NOSIGFE +setlogmask NOSIGFE +setmntent SIGFE +_setmntent = setmntent SIGFE +setmode SIGFE +_setmode = setmode SIGFE +setpassent NOSIGFE +_setpassent = setpassent NOSIGFE +setpgid SIGFE +_setpgid = setpgid SIGFE +setpgrp SIGFE +_setpgrp = setpgrp SIGFE +setpwent NOSIGFE +_setpwent = setpwent NOSIGFE +setregid SIGFE +_setregid = setregid SIGFE +setregid32 SIGFE +_setregid32 = setregid32 SIGFE +setreuid SIGFE +_setreuid = setreuid SIGFE +setreuid32 SIGFE +_setreuid32 = setreuid32 SIGFE +setrlimit SIGFE +_setrlimit = setrlimit SIGFE +setsid SIGFE +_setsid = setsid SIGFE +setstate NOSIGFE +settimeofday SIGFE +_settimeofday = settimeofday SIGFE +setuid SIGFE +_setuid = setuid SIGFE +_setuid32 = setuid32 SIGFE +setutent SIGFE +_setutent = setutent SIGFE +setvbuf SIGFE +_setvbuf = setvbuf SIGFE +sexecl = sexecve_is_bad SIGFE +sexecle = sexecve_is_bad SIGFE +sexeclp = sexecve_is_bad SIGFE +sexeclpe = sexecve_is_bad SIGFE +sexecp = sexecve_is_bad SIGFE +sexecv = sexecve_is_bad SIGFE +sexecve = sexecve_is_bad SIGFE +sexecvpe = sexecve_is_bad SIGFE +shmat SIGFE +shmctl SIGFE +shmdt SIGFE +shmget SIGFE +sigaction SIGFE +sigaddset SIGFE +sigdelset SIGFE +sigemptyset NOSIGFE +sigfillset NOSIGFE +siginterrupt SIGFE +sigismember SIGFE +signal SIGFE +significand NOSIGFE +significandf NOSIGFE +sigpause SIGFE +sigpending SIGFE +sigprocmask SIGFE +sigsuspend SIGFE +sigwait SIGFE +sin NOSIGFE +_sin = sin NOSIGFE +sincos NOSIGFE +sincosf NOSIGFE +sinf NOSIGFE +_sinf = sinf NOSIGFE +sinh NOSIGFE +_sinh = sinh NOSIGFE +sinhf NOSIGFE +_sinhf = sinhf NOSIGFE +siprintf SIGFE +_siprintf = siprintf SIGFE +sleep SIGFE +_sleep = sleep SIGFE +snprintf SIGFE +_snprintf = snprintf SIGFE +socketpair SIGFE +spawnl SIGFE +_spawnl = spawnl SIGFE +spawnle SIGFE +_spawnle = spawnle SIGFE +spawnlp SIGFE +_spawnlp = spawnlp SIGFE +spawnlpe SIGFE +_spawnlpe = spawnlpe SIGFE +spawnv SIGFE +_spawnv = spawnv SIGFE +spawnve SIGFE +_spawnve = spawnve SIGFE +spawnvp SIGFE +_spawnvp = spawnvp SIGFE +spawnvpe SIGFE +_spawnvpe = spawnvpe SIGFE +sprintf SIGFE +_sprintf = sprintf SIGFE +sqrt NOSIGFE +_sqrt = sqrt NOSIGFE +sqrtf NOSIGFE +_sqrtf = sqrtf NOSIGFE +srand NOSIGFE +_srand = srand NOSIGFE +srand48 NOSIGFE +_srand48 = srand48 NOSIGFE +srandom NOSIGFE +sscanf SIGFE +_sscanf = sscanf SIGFE +_stat64 = stat64 SIGFE +statfs SIGFE +_statfs = statfs SIGFE +strcasecmp NOSIGFE +_strcasecmp = strcasecmp NOSIGFE +strcat NOSIGFE +_strcat = strcat NOSIGFE +strchr NOSIGFE +_strchr = strchr NOSIGFE +strcmp NOSIGFE +_strcmp = strcmp NOSIGFE +strcoll NOSIGFE +_strcoll = strcoll NOSIGFE +strcpy NOSIGFE +_strcpy = strcpy NOSIGFE +strcspn NOSIGFE +_strcspn = strcspn NOSIGFE +strdup SIGFE +_strdup = strdup SIGFE +strerror NOSIGFE +_strerror = strerror NOSIGFE +strerror_r NOSIGFE +_strerror_r = strerror_r NOSIGFE +strftime SIGFE +_strftime = strftime SIGFE +strlcat NOSIGFE +_strlcat = strlcat NOSIGFE +strlcpy NOSIGFE +_strlcpy = strlcpy NOSIGFE +strlen NOSIGFE +_strlen = strlen NOSIGFE +strlwr NOSIGFE +_strlwr = strlwr NOSIGFE +strncasecmp NOSIGFE +_strncasecmp = strncasecmp NOSIGFE +strncat NOSIGFE +_strncat = strncat NOSIGFE +strncmp NOSIGFE +_strncmp = strncmp NOSIGFE +strncpy NOSIGFE +_strncpy = strncpy NOSIGFE +strndup SIGFE +strnlen NOSIGFE +strpbrk NOSIGFE +_strpbrk = strpbrk NOSIGFE +strptime SIGFE +_strptime = strptime SIGFE +strrchr NOSIGFE +_strrchr = strrchr NOSIGFE +strsep NOSIGFE +_strsep = strsep NOSIGFE +strsignal SIGFE +strspn NOSIGFE +_strspn = strspn NOSIGFE +strstr NOSIGFE +_strstr = strstr NOSIGFE +strtod SIGFE +_strtod = strtod SIGFE +strtof SIGFE +_strtodf = strtof SIGFE +strtodf = strtof SIGFE +strtok NOSIGFE +_strtok = strtok NOSIGFE +strtok_r NOSIGFE +_strtok_r = strtok_r NOSIGFE +strtol NOSIGFE +_strtol = strtol NOSIGFE +strtoll NOSIGFE +_strtoll = strtoll NOSIGFE +strtosigno SIGFE +strtoul NOSIGFE +_strtoul = strtoul NOSIGFE +strtoull NOSIGFE +_strtoull = strtoull NOSIGFE +strupr NOSIGFE +_strupr = strupr NOSIGFE +strxfrm NOSIGFE +_strxfrm = strxfrm NOSIGFE +swab NOSIGFE +_swab = swab NOSIGFE +symlink SIGFE +_symlink = symlink SIGFE +sync NOSIGFE +_sync = sync NOSIGFE +sysconf SIGFE +_sysconf = sysconf SIGFE +syslog SIGFE +_syslog = syslog SIGFE +vsyslog SIGFE +system SIGFE +_system = system SIGFE +tan NOSIGFE +_tan = tan NOSIGFE +tanf NOSIGFE +_tanf = tanf NOSIGFE +tanh NOSIGFE +_tanh = tanh NOSIGFE +tanhf NOSIGFE +_tanhf = tanhf NOSIGFE +tcdrain SIGFE +_tcdrain = tcdrain SIGFE +tcflow SIGFE +_tcflow = tcflow SIGFE +tcflush SIGFE +_tcflush = tcflush SIGFE +tcgetattr SIGFE +_tcgetattr = tcgetattr SIGFE +tcgetpgrp SIGFE +_tcgetpgrp = tcgetpgrp SIGFE +tcsendbreak SIGFE +_tcsendbreak = tcsendbreak SIGFE +tcsetattr SIGFE +_tcsetattr = tcsetattr SIGFE +tcsetpgrp SIGFE +_tcsetpgrp = tcsetpgrp SIGFE +tdelete SIGFE +tdestroy NOSIGFE +telldir SIGFE +_telldir = telldir SIGFE +_telldir64 = telldir64 SIGFE +tempnam SIGFE +_tempnam = tempnam SIGFE +tfind NOSIGFE +tgamma NOSIGFE +tgammaf NOSIGFE +time SIGFE +_time = time SIGFE +times SIGFE +_times = times SIGFE +timezone SIGFE +tmpfile SIGFE +_tmpfile = tmpfile SIGFE +_tmpfile64 = tmpfile64 SIGFE +tmpnam SIGFE +_tmpnam = tmpnam SIGFE +toascii NOSIGFE +_toascii = toascii NOSIGFE +tolower NOSIGFE +_tolower = tolower NOSIGFE +toupper NOSIGFE +_toupper = toupper NOSIGFE +towctrans NOSIGFE +towlower NOSIGFE +towupper NOSIGFE +truncate SIGFE +_truncate = truncate SIGFE +_truncate64 = truncate64 SIGFE +truncf NOSIGFE +tsearch SIGFE +ttyname SIGFE +_ttyname = ttyname SIGFE +ttyslot NOSIGFE +twalk NOSIGFE +tzset SIGFE +_tzset = tzset SIGFE +ualarm SIGFE +_ualarm = ualarm SIGFE +umask NOSIGFE +_umask = umask NOSIGFE +umount SIGFE +_umount = umount SIGFE +uname SIGFE +_uname = uname SIGFE +ungetc SIGFE +_ungetc = ungetc SIGFE +unlink SIGFE +_unlink = unlink SIGFE +unlockpt NOSIGFE +unsetenv NOSIGFE +_unsetenv = unsetenv NOSIGFE +usleep SIGFE +_usleep = usleep SIGFE +utime SIGFE +_utime = utime SIGFE +utimes SIGFE +_utimes = utimes SIGFE +utmpname SIGFE +_utmpname = utmpname SIGFE +valloc SIGFE +vasprintf SIGFE +_vasprintf = vasprintf SIGFE +verr SIGFE +verrx SIGFE +vwarn SIGFE +vwarnx SIGFE +vfiprintf SIGFE +_vfiprintf = vfiprintf SIGFE +vfork SIGFE +_vfork = vfork SIGFE +vfprintf SIGFE +_vfprintf = vfprintf SIGFE +vfscanf SIGFE +_vfscanf = vfscanf SIGFE +vhangup SIGFE +_vhangup = vhangup SIGFE +vprintf SIGFE +_vprintf = vprintf SIGFE +vscanf SIGFE +_vscanf = vscanf SIGFE +vsnprintf SIGFE +_vsnprintf = vsnprintf SIGFE +vsprintf SIGFE +_vsprintf = vsprintf SIGFE +vsscanf SIGFE +_vsscanf = vsscanf SIGFE +wait SIGFE +_wait = wait SIGFE +wait3 SIGFE +wait4 SIGFE +waitpid SIGFE +_waitpid = waitpid SIGFE +warn SIGFE +warnx SIGFE +wcrtomb NOSIGFE +wcscat NOSIGFE +wcschr NOSIGFE +wcscmp NOSIGFE +_wcscmp = wcscmp NOSIGFE +wcscoll NOSIGFE +wcscpy NOSIGFE +wcscspn NOSIGFE +wcslcat NOSIGFE +wcslcpy NOSIGFE +wcslen NOSIGFE +_wcslen = wcslen NOSIGFE +wcsncat NOSIGFE +wcsncmp NOSIGFE +wcsncpy NOSIGFE +wcspbrk NOSIGFE +wcsrchr NOSIGFE +wcsrtombs NOSIGFE +wcsspn NOSIGFE +wcsstr NOSIGFE +wcstombs NOSIGFE +_wcstombs = wcstombs NOSIGFE +wcswidth NOSIGFE +wctob NOSIGFE +wctomb NOSIGFE +_wctomb = wctomb NOSIGFE +wctrans NOSIGFE +wctype NOSIGFE +wcwidth NOSIGFE +wmemchr NOSIGFE +wmemcmp NOSIGFE +wmemcpy NOSIGFE +wmemmove NOSIGFE +wmemset NOSIGFE +wprintf SIGFE +_wprintf = wprintf SIGFE +write SIGFE +_write = write SIGFE +writev SIGFE +_writev = writev SIGFE +y0 NOSIGFE +y0f NOSIGFE +y1 NOSIGFE +y1f NOSIGFE +yn NOSIGFE +ynf NOSIGFE diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 71ae1847c01..746b5f5bf18 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -93,7 +93,7 @@ extern "C" char ***main_environ; /* __progname used in getopt error message */ char *__progname; - static struct _reent reent_data; + struct _reent reent_data; struct per_process __cygwin_user_data = {/* initial_sp */ 0, /* magic_biscuit */ 0, /* dll_major */ CYGWIN_VERSION_DLL_MAJOR, diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc new file mode 100644 index 00000000000..e2877edcfa6 --- /dev/null +++ b/winsup/cygwin/exceptions.cc @@ -0,0 +1,1115 @@ +/* exceptions.cc + + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#include "winsup.h" +#include +#include +#include +#include + +#include "exceptions.h" +#include "sync.h" +#include "pinfo.h" +#include "cygtls.h" +#include "sigproc.h" +#include "cygerrno.h" +#define NEED_VFORK +#include "perthread.h" +#include "shared_info.h" +#include "perprocess.h" +#include "security.h" +#include "cygthread.h" + +#define CALL_HANDLER_RETRY 20 + +char debugger_command[2 * CYG_MAX_PATH + 20]; + +extern "C" { +static int handle_exceptions (EXCEPTION_RECORD *, void *, CONTEXT *, void *); +extern void sigdelayed (); +}; + +extern DWORD sigtid; + +extern HANDLE hExeced; +extern DWORD dwExeced; + +static BOOL WINAPI ctrl_c_handler (DWORD); +static void signal_exit (int) __attribute__ ((noreturn)); +static char windows_system_directory[1024]; +static size_t windows_system_directory_length; + +/* This is set to indicate that we have already exited. */ + +static NO_COPY int exit_already = 0; +static NO_COPY muto *mask_sync = NULL; + +NO_COPY static struct +{ + unsigned int code; + const char *name; +} status_info[] = +{ +#define X(s) s, #s + { X (STATUS_ABANDONED_WAIT_0) }, + { X (STATUS_ACCESS_VIOLATION) }, + { X (STATUS_ARRAY_BOUNDS_EXCEEDED) }, + { X (STATUS_BREAKPOINT) }, + { X (STATUS_CONTROL_C_EXIT) }, + { X (STATUS_DATATYPE_MISALIGNMENT) }, + { X (STATUS_FLOAT_DENORMAL_OPERAND) }, + { X (STATUS_FLOAT_DIVIDE_BY_ZERO) }, + { X (STATUS_FLOAT_INEXACT_RESULT) }, + { X (STATUS_FLOAT_INVALID_OPERATION) }, + { X (STATUS_FLOAT_OVERFLOW) }, + { X (STATUS_FLOAT_STACK_CHECK) }, + { X (STATUS_FLOAT_UNDERFLOW) }, + { X (STATUS_GUARD_PAGE_VIOLATION) }, + { X (STATUS_ILLEGAL_INSTRUCTION) }, + { X (STATUS_INTEGER_DIVIDE_BY_ZERO) }, + { X (STATUS_INTEGER_OVERFLOW) }, + { X (STATUS_INVALID_DISPOSITION) }, + { X (STATUS_IN_PAGE_ERROR) }, + { X (STATUS_NONCONTINUABLE_EXCEPTION) }, + { X (STATUS_NO_MEMORY) }, + { X (STATUS_PENDING) }, + { X (STATUS_PRIVILEGED_INSTRUCTION) }, + { X (STATUS_SINGLE_STEP) }, + { X (STATUS_STACK_OVERFLOW) }, + { X (STATUS_TIMEOUT) }, + { X (STATUS_USER_APC) }, + { X (STATUS_WAIT_0) }, + { 0, 0 } +#undef X +}; + +/* Initialization code. */ + +// Set up the exception handler for the current thread. The PowerPC & Mips +// use compiler generated tables to set up the exception handlers for each +// region of code, and the kernel walks the call list until it finds a region +// of code that handles exceptions. The x86 on the other hand uses segment +// register fs, offset 0 to point to the current exception handler. + +extern exception_list *_except_list asm ("%fs:0"); + +void +init_exception_handler (exception_list *el, exception_handler *eh) +{ + el->handler = eh; + el->prev = _except_list; + _except_list = el; +} + +extern "C" void +init_exceptions (exception_list *el) +{ + init_exception_handler (el, handle_exceptions); +} + +void +init_console_handler () +{ + (void) SetConsoleCtrlHandler (ctrl_c_handler, FALSE); + if (!SetConsoleCtrlHandler (ctrl_c_handler, TRUE)) + system_printf ("SetConsoleCtrlHandler failed, %E"); +} + +extern "C" void +error_start_init (const char *buf) +{ + if (!buf || !*buf) + { + debugger_command[0] = '\0'; + return; + } + + char pgm[CYG_MAX_PATH + 1]; + if (!GetModuleFileName (NULL, pgm, CYG_MAX_PATH)) + strcpy (pgm, "cygwin1.dll"); + for (char *p = strchr (pgm, '\\'); p; p = strchr (p, '\\')) + *p = '/'; + + __small_sprintf (debugger_command, "%s \"%s\"", buf, pgm); +} + +static void +open_stackdumpfile () +{ + if (myself->progname[0]) + { + const char *p; + /* write to progname.stackdump if possible */ + if (!myself->progname[0]) + p = "unknown"; + else if ((p = strrchr (myself->progname, '\\'))) + p++; + else + p = myself->progname; + char corefile[strlen (p) + sizeof (".stackdump")]; + __small_sprintf (corefile, "%s.stackdump", p); + HANDLE h = CreateFile (corefile, GENERIC_WRITE, 0, &sec_none_nih, + CREATE_ALWAYS, 0, 0); + if (h != INVALID_HANDLE_VALUE) + { + if (!myself->ppid_handle) + system_printf ("Dumping stack trace to %s", corefile); + else + debug_printf ("Dumping stack trace to %s", corefile); + SetStdHandle (STD_ERROR_HANDLE, h); + } + } +} + +/* Utilities for dumping the stack, etc. */ + +static void +exception (EXCEPTION_RECORD *e, CONTEXT *in) +{ + const char *exception_name = NULL; + + if (e) + { + for (int i = 0; status_info[i].name; i++) + { + if (status_info[i].code == e->ExceptionCode) + { + exception_name = status_info[i].name; + break; + } + } + } + +#ifdef __i386__ +#define HAVE_STATUS + if (exception_name) + small_printf ("Exception: %s at eip=%08x\r\n", exception_name, in->Eip); + else + small_printf ("Exception %d at eip=%08x\r\n", e->ExceptionCode, in->Eip); + small_printf ("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\r\n", + in->Eax, in->Ebx, in->Ecx, in->Edx, in->Esi, in->Edi); + small_printf ("ebp=%08x esp=%08x program=%s\r\n", + in->Ebp, in->Esp, myself->progname); + small_printf ("cs=%04x ds=%04x es=%04x fs=%04x gs=%04x ss=%04x\r\n", + in->SegCs, in->SegDs, in->SegEs, in->SegFs, in->SegGs, in->SegSs); +#endif + +#ifndef HAVE_STATUS + system_printf ("Had an exception"); +#endif +} + +#ifdef __i386__ +/* Print a stack backtrace. */ + +#define HAVE_STACK_TRACE + +/* A class for manipulating the stack. */ +class stack_info +{ + int walk (); /* Uses the "old" method */ + char *next_offset () {return *((char **) sf.AddrFrame.Offset);} + bool needargs; + DWORD dummy_frame; +public: + STACKFRAME sf; /* For storing the stack information */ + void init (DWORD, bool, bool); /* Called the first time that stack info is needed */ + + /* Postfix ++ iterates over the stack, returning zero when nothing is left. */ + int operator ++(int) { return walk (); } +}; + +/* The number of parameters used in STACKFRAME */ +#define NPARAMS (sizeof (thestack.sf.Params) / sizeof (thestack.sf.Params[0])) + +/* This is the main stack frame info for this process. */ +static NO_COPY stack_info thestack; + +/* Initialize everything needed to start iterating. */ +void +stack_info::init (DWORD ebp, bool wantargs, bool goodframe) +{ +# define debp ((DWORD *) ebp) + memset (&sf, 0, sizeof (sf)); + if (!goodframe) + sf.AddrFrame.Offset = ebp; + else + { + dummy_frame = ebp; + sf.AddrFrame.Offset = (DWORD) &dummy_frame; + } + sf.AddrReturn.Offset = debp[1]; + sf.AddrFrame.Mode = AddrModeFlat; + needargs = wantargs; +# undef debp +} + +/* Walk the stack by looking at successive stored 'bp' frames. + This is not foolproof. */ +int +stack_info::walk () +{ + char **ebp; + if ((ebp = (char **) next_offset ()) == NULL) + return 0; + + sf.AddrFrame.Offset = (DWORD) ebp; + sf.AddrPC.Offset = sf.AddrReturn.Offset; + + if (!sf.AddrPC.Offset) + return 0; /* stack frames are exhausted */ + + /* The return address always follows the stack pointer */ + sf.AddrReturn.Offset = (DWORD) *++ebp; + + if (needargs) + /* The arguments follow the return address */ + for (unsigned i = 0; i < NPARAMS; i++) + sf.Params[i] = (DWORD) *++ebp; + + return 1; +} + +static void +stackdump (DWORD ebp, int open_file, bool isexception) +{ + extern unsigned long rlim_core; + + if (rlim_core == 0UL) + return; + + if (open_file) + open_stackdumpfile (); + + int i; + + thestack.init (ebp, 1, !isexception); /* Initialize from the input CONTEXT */ + small_printf ("Stack trace:\r\nFrame Function Args\r\n"); + for (i = 0; i < 16 && thestack++; i++) + { + small_printf ("%08x %08x ", thestack.sf.AddrFrame.Offset, + thestack.sf.AddrPC.Offset); + for (unsigned j = 0; j < NPARAMS; j++) + small_printf ("%s%08x", j == 0 ? " (" : ", ", thestack.sf.Params[j]); + small_printf (")\r\n"); + } + small_printf ("End of stack trace%s", + i == 16 ? " (more stack frames may be present)" : ""); +} + +/* Temporary (?) function for external callers to get a stack dump */ +extern "C" void +cygwin_stackdump () +{ + CONTEXT c; + c.ContextFlags = CONTEXT_FULL; + GetThreadContext (GetCurrentThread (), &c); + stackdump (c.Ebp, 0, 0); +} + +#define TIME_TO_WAIT_FOR_DEBUGGER 10000 + +extern "C" int +try_to_debug (bool waitloop) +{ + debug_printf ("debugger_command '%s'", debugger_command); + if (*debugger_command == '\0' || being_debugged ()) + return 0; + + __small_sprintf (strchr (debugger_command, '\0'), " %u", GetCurrentProcessId ()); + + LONG prio = GetThreadPriority (GetCurrentThread ()); + SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST); + PROCESS_INFORMATION pi = {NULL, 0, 0, 0}; + + STARTUPINFO si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL}; + si.lpReserved = NULL; + si.lpDesktop = NULL; + si.dwFlags = 0; + si.cb = sizeof (si); + + /* FIXME: need to know handles of all running threads to + suspend_all_threads_except (current_thread_id); + */ + + /* if any of these mutexes is owned, we will fail to start any cygwin app + until trapped app exits */ + + ReleaseMutex (title_mutex); + + /* prevent recursive exception handling */ + char* rawenv = GetEnvironmentStrings () ; + for (char* p = rawenv; *p != '\0'; p = strchr (p, '\0') + 1) + { + if (strncmp (p, "CYGWIN=", strlen ("CYGWIN=")) == 0) + { + char* q = strstr (p, "error_start") ; + /* replace 'error_start=...' with '_rror_start=...' */ + if (q) + { + *q = '_' ; + SetEnvironmentVariable ("CYGWIN", p + strlen ("CYGWIN=")) ; + } + break ; + } + } + + small_printf ("*** starting debugger for pid %u\n", + cygwin_pid (GetCurrentProcessId ())); + BOOL dbg; + dbg = CreateProcess (NULL, + debugger_command, + NULL, + NULL, + FALSE, + CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP, + NULL, + NULL, + &si, + &pi); + + if (!dbg) + system_printf ("Failed to start debugger: %E"); + else + { + if (!waitloop) + return 1; + SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE); + while (!being_debugged ()) + low_priority_sleep (0); + small_printf ("*** continuing pid %u from debugger call\n", + cygwin_pid (GetCurrentProcessId ())); + } + + SetThreadPriority (GetCurrentThread (), prio); + return 0; +} + +/* Main exception handler. */ + +extern "C" DWORD __stdcall RtlUnwind (void *, void *, void *, DWORD); +static int +handle_exceptions (EXCEPTION_RECORD *e0, void *frame, CONTEXT *in0, void *) +{ + static bool NO_COPY debugging = false; + static int NO_COPY recursed = 0; + + if (debugging && ++debugging < 500000) + { + SetThreadPriority (hMainThread, THREAD_PRIORITY_NORMAL); + return 0; + } + + /* If we've already exited, don't do anything here. Returning 1 + tells Windows to keep looking for an exception handler. */ + if (exit_already) + return 1; + + EXCEPTION_RECORD e = *e0; + CONTEXT in = *in0; + + extern DWORD ret_here[]; + RtlUnwind (frame, ret_here, e0, 0); + __asm__ volatile (".equ _ret_here,."); + + int sig; + /* Coerce win32 value to posix value. */ + switch (e.ExceptionCode) + { + case STATUS_FLOAT_DENORMAL_OPERAND: + case STATUS_FLOAT_DIVIDE_BY_ZERO: + case STATUS_FLOAT_INEXACT_RESULT: + case STATUS_FLOAT_INVALID_OPERATION: + case STATUS_FLOAT_OVERFLOW: + case STATUS_FLOAT_STACK_CHECK: + case STATUS_FLOAT_UNDERFLOW: + case STATUS_INTEGER_DIVIDE_BY_ZERO: + case STATUS_INTEGER_OVERFLOW: + sig = SIGFPE; + break; + + case STATUS_ILLEGAL_INSTRUCTION: + case STATUS_PRIVILEGED_INSTRUCTION: + case STATUS_NONCONTINUABLE_EXCEPTION: + sig = SIGILL; + break; + + case STATUS_TIMEOUT: + sig = SIGALRM; + break; + + case STATUS_ACCESS_VIOLATION: + case STATUS_DATATYPE_MISALIGNMENT: + case STATUS_ARRAY_BOUNDS_EXCEEDED: + case STATUS_GUARD_PAGE_VIOLATION: + case STATUS_IN_PAGE_ERROR: + case STATUS_NO_MEMORY: + case STATUS_INVALID_DISPOSITION: + case STATUS_STACK_OVERFLOW: + sig = SIGSEGV; + break; + + case STATUS_CONTROL_C_EXIT: + sig = SIGINT; + break; + + case STATUS_INVALID_HANDLE: + /* CloseHandle will throw this exception if it is given an + invalid handle. We don't care about the exception; we just + want CloseHandle to return an error. This can be revisited + if gcc ever supports Windows style structured exception + handling. */ + return 0; + + default: + /* If we don't recognize the exception, we have to assume that + we are doing structured exception handling, and we let + something else handle it. */ + return 1; + } + + debug_printf ("In cygwin_except_handler exc %p at %p sp %p", e.ExceptionCode, in.Eip, in.Esp); + debug_printf ("In cygwin_except_handler sig = %d at %p", sig, in.Eip); + + if (global_sigs[sig].sa_mask & SIGTOMASK (sig)) + syscall_printf ("signal %d, masked %p", sig, global_sigs[sig].sa_mask); + + debug_printf ("In cygwin_except_handler calling %p", + global_sigs[sig].sa_handler); + + DWORD *ebp = (DWORD *)in.Esp; + for (DWORD *bpend = (DWORD *) __builtin_frame_address (0); ebp > bpend; ebp--) + if (*ebp == in.SegCs && ebp[-1] == in.Eip) + { + ebp -= 2; + break; + } + + if (!myself->progname[0] + || GetCurrentThreadId () == sigtid + || (void *) global_sigs[sig].sa_handler == (void *) SIG_DFL + || (void *) global_sigs[sig].sa_handler == (void *) SIG_IGN + || (void *) global_sigs[sig].sa_handler == (void *) SIG_ERR) + { + /* Print the exception to the console */ + if (1) + { + for (int i = 0; status_info[i].name; i++) + { + if (status_info[i].code == e.ExceptionCode) + { + if (!myself->ppid_handle) + system_printf ("Exception: %s", status_info[i].name); + break; + } + } + } + + /* Another exception could happen while tracing or while exiting. + Only do this once. */ + if (recursed++) + system_printf ("Error while dumping state (probably corrupted stack)"); + else + { + if (try_to_debug (0)) + { + debugging = true; + return 0; + } + + open_stackdumpfile (); + exception (&e, &in); + stackdump ((DWORD) ebp, 0, 1); + } + + signal_exit (0x80 | sig); // Flag signal + core dump + } + + _my_tls.push ((__stack_t) ebp, true); + sig_send (NULL, sig, &_my_tls); // Signal myself + return 1; +} +#endif /* __i386__ */ + +#ifndef HAVE_STACK_TRACE +void +stack (void) +{ + system_printf ("Stack trace not yet supported on this machine."); +} +#endif + +/* Utilities to call a user supplied exception handler. */ + +#define SIG_NONMASKABLE (SIGTOMASK (SIGKILL) | SIGTOMASK (SIGSTOP)) + +#ifdef __i386__ +#define HAVE_CALL_HANDLER + +/* Non-raceable sigsuspend + * Note: This implementation is based on the Single UNIX Specification + * man page. This indicates that sigsuspend always returns -1 and that + * attempts to block unblockable signals will be silently ignored. + * This is counter to what appears to be documented in some UNIX + * man pages, e.g. Linux. + */ +int __stdcall +handle_sigsuspend (sigset_t tempmask) +{ + sig_dispatch_pending (); + sigset_t oldmask = myself->getsigmask (); // Remember for restoration + + set_signal_mask (tempmask &= ~SIG_NONMASKABLE, oldmask);// Let signals we're + // interested in through. + sigproc_printf ("oldmask %p, newmask %p", oldmask, tempmask); + + pthread_testcancel (); + pthread::cancelable_wait (signal_arrived, INFINITE); + + set_sig_errno (EINTR); // Per POSIX + + /* A signal dispatch function will have been added to our stack and will + be hit eventually. Set the old mask to be restored when the signal + handler returns. */ + + _my_tls.oldmask = oldmask; // Will be restored by signal handler + return -1; +} + +extern DWORD exec_exit; // Possible exit value for exec + +extern "C" { +static void +sig_handle_tty_stop (int sig) +{ + /* Silently ignore attempts to suspend if there is no accomodating + cygwin parent to deal with this behavior. */ + if (!myself->ppid_handle) + { + myself->process_state &= ~PID_STOPPED; + return; + } + + myself->stopsig = sig; + /* See if we have a living parent. If so, send it a special signal. + It will figure out exactly which pid has stopped by scanning + its list of subprocesses. */ + if (my_parent_is_alive ()) + { + pinfo parent (myself->ppid); + if (ISSTATE (parent, PID_NOCLDSTOP)) + sig_send (parent, SIGCHLD); + } + sigproc_printf ("process %d stopped by signal %d, myself->ppid_handle %p", + myself->pid, sig, myself->ppid_handle); + if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0) + api_fatal ("WaitSingleObject failed, %E"); + return; +} +} + +bool +interruptible (DWORD pc) +{ + int res; + MEMORY_BASIC_INFORMATION m; + + memset (&m, 0, sizeof m); + if (!VirtualQuery ((LPCVOID) pc, &m, sizeof m)) + sigproc_printf ("couldn't get memory info, pc %p, %E", pc); + + char *checkdir = (char *) alloca (windows_system_directory_length + 4); + memset (checkdir, 0, sizeof (checkdir)); + +# define h ((HMODULE) m.AllocationBase) + /* Apparently Windows 95 can sometimes return bogus addresses from + GetThreadContext. These resolve to a strange allocation base. + These should *never* be treated as interruptible. */ + if (!h || m.State != MEM_COMMIT) + res = false; + else if (h == user_data->hmodule) + res = true; + else if (!GetModuleFileName (h, checkdir, windows_system_directory_length + 2)) + res = false; + else + res = !strncasematch (windows_system_directory, checkdir, + windows_system_directory_length); + sigproc_printf ("pc %p, h %p, interruptible %d", pc, h, res); +# undef h + return res; +} +void __stdcall +_threadinfo::interrupt_setup (int sig, void *handler, + struct sigaction& siga, __stack_t retaddr) +{ + __stack_t *retaddr_in_tls = stackptr - 1; + push ((__stack_t) sigdelayed); + oldmask = myself->getsigmask (); + newmask = oldmask | siga.sa_mask | SIGTOMASK (sig); + sa_flags = siga.sa_flags; + func = (void (*) (int)) handler; + saved_errno = -1; // Flag: no errno to save + if (handler == sig_handle_tty_stop) + { + myself->stopsig = 0; + myself->process_state |= PID_STOPPED; + } + this->sig = sig; // Should ALWAYS be second to last setting set to avoid a race + *retaddr_in_tls = retaddr; + /* Clear any waiting threads prior to dispatching to handler function */ + int res = SetEvent (signal_arrived); // For an EINTR case + proc_subproc (PROC_CLEARWAIT, 1); + sigproc_printf ("armed signal_arrived %p, sig %d, res %d", signal_arrived, + sig, res); +} + +bool +_threadinfo::interrupt_now (CONTEXT *ctx, int sig, void *handler, + struct sigaction& siga) +{ + push (0); + interrupt_setup (sig, handler, siga, (__stack_t) ctx->Eip); + ctx->Eip = pop (); + SetThreadContext (*this, ctx); /* Restart the thread in a new location */ + return 1; +} + +void __stdcall +signal_fixup_after_fork () +{ + if (_my_tls.sig) + { + _my_tls.sig = 0; + _my_tls.stackptr = _my_tls.stack + 1; // FIXME? + set_signal_mask (_my_tls.oldmask); + } + sigproc_init (); +} + +extern "C" void __stdcall +set_sig_errno (int e) +{ + *_my_tls.errno_addr = e; + _my_tls.saved_errno = e; + // sigproc_printf ("errno %d", e); +} + +static int setup_handler (int, void *, struct sigaction&, _threadinfo *tls) + __attribute__((regparm(3))); +static int +setup_handler (int sig, void *handler, struct sigaction& siga, _threadinfo *tls) +{ + CONTEXT cx; + bool interrupted = false; + + if (tls->sig) + { + sigproc_printf ("trying to send sig %d but signal %d already armed", + sig, tls->sig); + goto out; + } + + for (int i = 0; i < CALL_HANDLER_RETRY; i++) + { + __stack_t *retaddr_on_stack = tls->stackptr - 1; + if (retaddr_on_stack >= tls->stack) + { + __stack_t retaddr = InterlockedExchange ((LONG *) retaddr_on_stack, 0); + if (!retaddr) + continue; + tls->reset_exception (); + tls->interrupt_setup (sig, handler, siga, retaddr); + sigproc_printf ("interrupted known cygwin routine"); + interrupted = true; + break; + } + + DWORD res; + HANDLE hth = (HANDLE) *tls; + + /* Suspend the thread which will receive the signal. But first ensure that + this thread doesn't have any mutos. (FIXME: Someday we should just grab + all of the mutos rather than checking for them) + For Windows 95, we also have to ensure that the addresses returned by GetThreadContext + are valid. + If one of these conditions is not true we loop for a fixed number of times + since we don't want to stall the signal handler. FIXME: Will this result in + noticeable delays? + If the thread is already suspended (which can occur when a program has called + SuspendThread on itself then just queue the signal. */ + +#ifndef DEBUGGING + sigproc_printf ("suspending mainthread"); +#else + cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; + if (!GetThreadContext (hth, &cx)) + memset (&cx, 0, sizeof cx); + sigproc_printf ("suspending mainthread PC %p", cx.Eip); +#endif + res = SuspendThread (hth); + /* Just release the lock now since we hav suspended the main thread and it + definitely can't be grabbing it now. This will have to change, of course, + if/when we can send signals to other than the main thread. */ + + /* Just set pending if thread is already suspended */ + if (res) + { + (void) ResumeThread (hth); + break; + } + + // FIXME - add check for reentering of DLL here + + cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; + if (!GetThreadContext (hth, &cx)) + system_printf ("couldn't get context of main thread, %E"); + else if (interruptible (cx.Eip)) + interrupted = tls->interrupt_now (&cx, sig, handler, siga); + + res = ResumeThread (hth); + if (interrupted) + break; + + sigproc_printf ("couldn't interrupt. trying again."); + low_priority_sleep (0); + } + +out: + sigproc_printf ("signal %d %sdelivered", sig, interrupted ? "" : "not "); + return interrupted; +} +#endif /* i386 */ + +#ifndef HAVE_CALL_HANDLER +#error "Need to supply machine dependent setup_handler" +#endif + +/* Keyboard interrupt handler. */ +static BOOL WINAPI +ctrl_c_handler (DWORD type) +{ + static bool saw_close; + _my_tls.remove (INFINITE); + + /* Return FALSE to prevent an "End task" dialog box from appearing + for each Cygwin process window that's open when the computer + is shut down or console window is closed. */ + + if (type == CTRL_SHUTDOWN_EVENT) + { +#if 0 + /* Don't send a signal. Only NT service applications and their child + processes will receive this event and the services typically already + handle the shutdown action when getting the SERVICE_CONTROL_SHUTDOWN + control message. */ + sig_send (NULL, SIGTERM); +#endif + return FALSE; + } + + if (myself->ctty != -1) + { + if (type == CTRL_CLOSE_EVENT) + { + saw_close = true; + sig_send (NULL, SIGHUP); + return FALSE; + } + if (!saw_close && type == CTRL_LOGOFF_EVENT) + { + /* Check if the process is actually associated with a visible + window station, one which actually represents a visible desktop. + If not, the CTRL_LOGOFF_EVENT doesn't concern this process. */ + if (has_visible_window_station ()) + sig_send (myself_nowait, SIGHUP); + return FALSE; + } + } + + /* If we are a stub and the new process has a pinfo structure, let it + handle this signal. */ + if (dwExeced && pinfo (dwExeced)) + return TRUE; + + /* We're only the process group leader when we have a valid pinfo structure. + If we don't have one, then the parent "stub" will handle the signal. */ + if (!pinfo (cygwin_pid (GetCurrentProcessId ()))) + return TRUE; + + tty_min *t = cygwin_shared->tty.get_tty (myself->ctty); + /* Ignore this if we're not the process group leader since it should be handled + *by* the process group leader. */ + if (myself->ctty != -1 && t->getpgid () == myself->pid && + (GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP) + /* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate + that we have handled the signal). At this point, type should be + a CTRL_C_EVENT or CTRL_BREAK_EVENT. */ + { + t->last_ctrl_c = GetTickCount (); + kill (-myself->pid, SIGINT); + t->last_ctrl_c = GetTickCount (); + return TRUE; + } + + return TRUE; +} + +/* Function used by low level sig wrappers. */ +extern "C" void __stdcall +set_process_mask (sigset_t newmask) +{ + set_signal_mask (newmask); +} + +/* Set the signal mask for this process. + Note that some signals are unmaskable, as in UNIX. */ +extern "C" void __stdcall +set_signal_mask (sigset_t newmask, sigset_t oldmask) +{ + mask_sync->acquire (INFINITE); + newmask &= ~SIG_NONMASKABLE; + sigset_t mask_bits = oldmask & ~newmask; + sigproc_printf ("oldmask %p, newmask %p, mask_bits %p", oldmask, newmask, + mask_bits); + myself->setsigmask (newmask); // Set a new mask + mask_sync->release (); + if (mask_bits) + sig_dispatch_pending (); + else + sigproc_printf ("not calling sig_dispatch_pending"); + return; +} + +int __stdcall +sig_handle (int sig, sigset_t mask, int pid, _threadinfo *tls) +{ + if (sig == SIGCONT) + { + DWORD stopped = myself->process_state & PID_STOPPED; + myself->stopsig = 0; + myself->process_state &= ~PID_STOPPED; + /* Clear pending stop signals */ + sig_clear (SIGSTOP); + sig_clear (SIGTSTP); + sig_clear (SIGTTIN); + sig_clear (SIGTTOU); + if (stopped) + SetEvent (sigCONT); + } + + int rc = 1; + bool insigwait_mask = tls ? sigismember (&tls->sigwait_mask, sig) : false; + bool special_case = ISSTATE (myself, PID_STOPPED) || main_vfork->pid; + bool masked = sigismember (&mask, sig); + if (sig != SIGKILL && sig != SIGSTOP + && (special_case || main_vfork->pid || masked || insigwait_mask + || (tls && sigismember (&tls->sigmask, sig)))) + { + sigproc_printf ("signal %d blocked", sig); + if ((!special_case && !masked) + && (insigwait_mask || (tls = _threadinfo::find_tls (sig)) != NULL)) + goto thread_specific; + rc = -1; + goto done; + } + + /* Clear pending SIGCONT on stop signals */ + if (sig == SIGSTOP || sig == SIGTSTP || sig == SIGTTIN || sig == SIGTTOU) + sig_clear (SIGCONT); + + sigproc_printf ("signal %d processing", sig); + struct sigaction thissig = global_sigs[sig]; + void *handler; + handler = (void *) thissig.sa_handler; + + myself->rusage_self.ru_nsignals++; + + if (sig == SIGKILL) + goto exit_sig; + + if (sig == SIGSTOP) + goto stop; + +#if 0 + char sigmsg[24]; + __small_sprintf (sigmsg, "cygwin: signal %d\n", sig); + OutputDebugString (sigmsg); +#endif + + if (handler == (void *) SIG_DFL) + { + if (insigwait_mask) + goto thread_specific; + if (sig == SIGCHLD || sig == SIGIO || sig == SIGCONT || sig == SIGWINCH + || sig == SIGURG) + { + sigproc_printf ("default signal %d ignored", sig); + goto done; + } + + if (sig == SIGTSTP || sig == SIGTTIN || sig == SIGTTOU) + goto stop; + + goto exit_sig; + } + + if (handler == (void *) SIG_IGN) + { + sigproc_printf ("signal %d ignored", sig); + goto done; + } + + if (handler == (void *) SIG_ERR) + goto exit_sig; + + goto dosig; + +stop: + /* Eat multiple attempts to STOP */ + if (ISSTATE (myself, PID_STOPPED)) + goto done; + handler = (void *) sig_handle_tty_stop; + thissig = global_sigs[SIGSTOP]; + +dosig: + /* Dispatch to the appropriate function. */ + sigproc_printf ("signal %d, about to call %p", sig, handler); + rc = setup_handler (sig, handler, thissig, tls ?: _main_tls); + +done: + sigproc_printf ("returning %d", rc); + return rc; + +thread_specific: + tls->sig = sig; + sigproc_printf ("releasing sigwait for thread"); + SetEvent (tls->event); + goto done; + +exit_sig: + if (sig == SIGQUIT || sig == SIGABRT) + { + CONTEXT c; + c.ContextFlags = CONTEXT_FULL; + GetThreadContext (hMainThread, &c); + if (!try_to_debug ()) + stackdump (c.Ebp, 1, 1); + sig |= 0x80; + } + sigproc_printf ("signal %d, about to call do_exit", sig); + signal_exit (sig); + /* Never returns */ +} + +CRITICAL_SECTION NO_COPY exit_lock; + +/* Cover function to `do_exit' to handle exiting even in presence of more + exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit + routines to run. */ +static void +signal_exit (int rc) +{ + EnterCriticalSection (&exit_lock); + rc = EXIT_SIGNAL | (rc << 8); + if (exit_already++) + myself->exit (rc); + + /* We'd like to stop the main thread from executing but when we do that it + causes random, inexplicable hangs. So, instead, we set up the priority + of this thread really high so that it should do its thing and then exit. */ + (void) SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE); + (void) SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL); + + user_data->resourcelocks->Delete (); + user_data->resourcelocks->Init (); + + if (hExeced) + { + sigproc_printf ("terminating captive process"); + TerminateProcess (hExeced, rc); + } + + sigproc_printf ("about to call do_exit (%x)", rc); + (void) SetEvent (signal_arrived); + do_exit (rc); +} + +HANDLE NO_COPY title_mutex = NULL; + +void +events_init (void) +{ + char *name; + char mutex_name[CYG_MAX_PATH]; + /* title_mutex protects modification of console title. It's necessary + while finding console window handle */ + + if (!(title_mutex = CreateMutex (&sec_all_nih, FALSE, + name = shared_name (mutex_name, + "title_mutex", 0)))) + api_fatal ("can't create title mutex '%s', %E", name); + + ProtectHandle (title_mutex); + new_muto (mask_sync); + windows_system_directory[0] = '\0'; + (void) GetSystemDirectory (windows_system_directory, sizeof (windows_system_directory) - 2); + char *end = strchr (windows_system_directory, '\0'); + if (end == windows_system_directory) + api_fatal ("can't find windows system directory"); + if (end[-1] != '\\') + { + *end++ = '\\'; + *end = '\0'; + } + windows_system_directory_length = end - windows_system_directory; + debug_printf ("windows_system_directory '%s', windows_system_directory_length %d", + windows_system_directory, windows_system_directory_length); + InitializeCriticalSection (&exit_lock); +} + +void +events_terminate (void) +{ + exit_already = 1; +} + +extern "C" { +int __stdcall +call_signal_handler_now () +{ + int sa_flags = 0; + while (_my_tls.sig && _my_tls.stackptr > _my_tls.stack) + { + sa_flags = _my_tls.sa_flags; + int sig = _my_tls.sig; + void (*sigfunc) (int) = _my_tls.func; + + (void) _my_tls.pop (); + reset_signal_arrived (); + sigset_t oldmask = _my_tls.oldmask; + int this_errno = _my_tls.saved_errno; + set_process_mask (_my_tls.newmask); + _my_tls.sig = 0; + sigfunc (sig); + set_process_mask (oldmask); + if (this_errno >= 0) + set_errno (this_errno); + } + + return sa_flags & SA_RESTART; +} + +void __stdcall +reset_signal_arrived () +{ + (void) ResetEvent (signal_arrived); + sigproc_printf ("reset signal_arrived"); +} +} diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h new file mode 100644 index 00000000000..98c43fa738a --- /dev/null +++ b/winsup/cygwin/include/cygwin/version.h @@ -0,0 +1,308 @@ +/* version.h -- Cygwin version numbers and accompanying documentation. + + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +/* Cygwin versioning is relatively complicated because of its status + as a shared library. Let's start with how versioning used to be done. + + Historical versioning in Cygwin 16.0 to 19.5: + + In the olden days of Cygwin, we had a dll major and minor version + and a registry version. The major number started at 16 because the + "b15" GNU-Win32 release of the compiler tools was out when this + scheme was started. We incremented the DLL name frequently (for + every official release) and towards the end of this period every + release used a different shared memory area to prevent DLLs from + interfering with each other (embedding a build timestamp into the + name of the shared memory area). This turned out to be a Bad Idea + (tm) because people needed to mingle separate releases and have + them work together more than we thought they would. This was + especially problematic when tty info needed to be retained when an + old Cygwin executable executed a newer one. + + In the old scheme, we incremented the major number whenever a + change to the dll invalidated existing executables. This can + happen for a number of reasons, including when functions are + removed from the export list of the dll. The minor number was + incremented when a change was made that we wanted to record, but + that didn't invalidate existing executables. Both numbers were + recorded in the executable and in the dll. + + In October 1998 (starting with Cygwin 19.6), we started a new method + of Cygwin versioning: */ + + /* The DLL major and minor numbers correspond to the "version of + the Cygwin shared library". This version is used to track important + changes to the DLL and is mainly informative in nature. */ + +#define CYGWIN_VERSION_DLL_MAJOR 1005 +#define CYGWIN_VERSION_DLL_MINOR 6 + + /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are + incompatible. */ + +#define CYGWIN_VERSION_DLL_EPOCH 19 + + /* CYGWIN_VERSION_DLL_COMBINED gives us a single number + representing the combined DLL major and minor numbers. */ + + /* WATCH OUT FOR OCTAL! Don't use, say, "00020" for 0.20 */ + +#define CYGWIN_VERSION_DLL_MAKE_COMBINED(maj, min) (((maj) * 1000) + min) +#define CYGWIN_VERSION_DLL_COMBINED \ + CYGWIN_VERSION_DLL_MAKE_COMBINED (CYGWIN_VERSION_DLL_MAJOR, CYGWIN_VERSION_DLL_MINOR) + + /* Every version of cygwin <= this uses an old, incorrect method + to determine signal masks. */ + +#define CYGWIN_VERSION_DLL_BAD_SIGNAL_MASK 19005 + + /* API versions <= this had a termios structure whose members were + too small to accomodate modern settings. */ +#define CYGWIN_VERSION_DLL_OLD_TERMIOS 5 +#define CYGWIN_VERSION_DLL_IS_OLD_TERMIOS \ + (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) <= \ + CYGWIN_VERSION_DLL_OLD_TERMIOS) + +#define CYGWIN_VERSION_DLL_MALLOC_ENV 28 + /* Old APIs had getc/putc macros that conflict with new CR/LF + handling in the stdio buffers */ +#define CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING \ + (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) <= \ + 20) + +#define CYGWIN_VERSION_CHECK_FOR_S_IEXEC \ + (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) >= \ + 36) + +#define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK \ + (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) <= \ + 28) + +#define CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES \ + (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) >= \ + 79) + /* We used to use the DLL major/minor to track + non-backward-compatible interface changes to the API. Now we + use an API major/minor number for this purpose. */ + + /* API_MAJOR 0.0: Initial version. API_MINOR changes: + 1: Export cygwin32_ calls as cygwin_ as well. + 2: Export j1, jn, y1, yn. + 3: Export dll_noncygwin_dllcrt0. + 4: New socket ioctls, revamped ifconf support. + 5: Thread support/exports. + 6: Change in termios handling. + 7: Export scandir and alphasort. + 8: Export _ctype_, _sys_errlist, _sys_nerr. + 9: Mount-related changes, new cygwin_umount export. + Raw device support (tape, floppies). + 10: Fast math routine support added. + 11: Export seekdir, telldir. + 12: Export pthread_join, pthread_detach. + 13: Export math funcs gamma and friends, also _j0, _j1, etc. + 14: Export snprintf and vnsprintf. + 15: Export glob + 16: Export cygwin_stackdump + 17: Export fast math stuff + 18: Stop exporting _strace_wm + 19: Export fchown, lchown, lacl + 20: regsub, inet_network + 21: incompatible change to stdio cr/lf and buffering + 22: Export cygwin_logon_user, cygwin_set_impersonation_token. + geteuid, getegid return effective uid/gid. + getuid, getgid return real uid/gid. + seteuid, setegid set only effective uid/gid. + setuid, setgid set effective and real uid/gid. + 23: Export new dll_crt0 interface and cygwin_user_data for use + with crt0 startup code. + 24: Export poll and _poll. + 25: Export getmode and _getmode. + 26: CW_GET_CYGDRIVE_PREFIXES addition to external.cc + 27: CW_GETPINFO_FULL addition to external.cc + 28: Accidentally bumped by cgf + 29: Export hstrerror + 30: CW_GET_CYGDRIVE_INFO addition to external.cc + 31: Export inet_aton + 32: Export getrlimit/setrlimit + 33: Export setlogmask + 34: Separated out mount table + 35: Export drand48, erand48, jrand48, lcong48, lrand48, + mrand48, nrand48, seed48, and srand48. + 36: Added _cygwin_S_IEXEC, et al + 37: [f]pathconv support _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY + 38: vscanf, vscanf_r, and random pthread functions + 39: asctime_r, ctime_r, gmtime_r, localtime_r + 40: fchdir + 41: __signgam + 42: sys_errlist, sys_nerr + 43: sigsetjmp, siglongjmp fixed + 44: Export dirfd + 45: perprocess change, gamma_r, gammaf_r, lgamma_r, lgammaf_r + 46: Remove cygwin_getshared + 47: Report EOTWarningZoneSize in struct mtget. + 48: Export "posix" regex functions + 49: Export setutent, endutent, utmpname, getutent, getutid, getutline. + 50: Export fnmatch. + 51: Export recvmsg, sendmsg. + 52: Export strptime + 53: Export strlcat, strlcpy. + 54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf. + 55: Export fcloseall, fcloseall_r. + 56: Make ntsec on by default. + 57: Export setgroups. + 58: Export memalign, valloc, malloc_trim, malloc_usable_size, mallopt, + malloc_stats + 59: getsid + 60: MSG_NOSIGNAL + 61: Export getc_unlocked, getchar_unlocked, putc_unlocked, + putchar_unlocked + 62: Erroneously bumped + 63: Export pututline + 64: Export fseeko, ftello + 65: Export siginterrupt + 66: Export nl_langinfo + 67: Export pthread_getsequence_np + 68: Export netdb stuff + 69: Export strtof + 70: Export asprintf, _asprintf_r, vasprintf, _vasprintf_r + 71: Export strerror_r + 72: Export nanosleep + 73: Export setreuid32, setreuid, setregid32, setregid + 74: Export _strtold a64l hcreate hcreate_r hdestroy hdestroy_r hsearch + hsearch_r isblank iswalnum iswalpha iswblank iswcntrl iswctype + iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper + iswxdigit l64a mbrlen mbrtowc mbsinit mbsrtowcs mempcpy + on_exit setbuffer setlinebuf strndup strnlen tdelete tdestroy + tfind towctrans towlower towupper tsearch twalk wcrtomb wcscat + wcschr wcscpy wcscspn wcslcat wcslcpy wcsncat wcsncmp wcsncpy + wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wctob wctob wctrans + wctype wmemchr wmemcmp wmemcpy wmemmove wmemset + 75: Export exp2 exp2f fdim fdimf fma fmaf fmax fmaxf fmin fminf lrint + lrintf lround lroundf nearbyint nearbyintf remquo remquof + round roundf scalbln scalblnf sincos sincosf tgamma tgammaf + truncf + 76: mallinfo + 77: thread-safe exit/at_exit + 78: Use stat and fstat rather than _stat, and _fstat. + Export btowc and trunc. + 79: Export acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32 + aclsort32 acltomode32 acltopbits32 acltotext32 facl32 + fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64 + _open64 _lseek64 _fstat64 _stat64 mknod32 + 80: Export pthread_rwlock stuff + 81: CW_CHECK_NTSEC addition to external.cc + 82: Export wcscoll wcswidth wcwidth + 83: Export gethostid + 84: Pty open allocates invisible console. 64 bit interface + 85: Export new 32/64 functions from API 0.79 only with leading + underscore. No problems with backward compatibility since no + official release has been made so far. This change removes + exported symbols like fopen64, which might confuse configure. + 86: Export ftok + 87: Export vsyslog + 88: Export _getreent + 89: Export __mempcpy + 90: Export _fopen64 + 91: Export argz_add argz_add_sep argz_append argz_count argz_create + argz_create_sep argz_delete argz_extract argz_insert + argz_next argz_replace argz_stringify envz_add envz_entry + envz_get envz_merge envz_remove envz_strip + 92: Export getusershell, setusershell, endusershell + 93: Export daemon, forkpty, openpty, iruserok, ruserok, login_tty, + openpty, forkpty, revoke, logwtmp, updwtmp + 94: Export getopt, getopt_long, optarg, opterr, optind, optopt, + optreset, __check_rhosts_file, __rcmd_errstr. + 95: Export shmat, shmctl, shmdt, shmget. + 96: CW_GET_ERRNO_FROM_WINERROR addition to external.cc + 97: Export sem_open, sem_close, sem_timedwait, sem_getvalue. + 98: Export _tmpfile64. + 99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc. + 100: CW_GET_SHMLBA addition to external.cc. + 101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx. + 102: CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID addition to external.cc. + 103: Export getprogname, setprogname. + 104: Export msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop. + 105: Export sigwait. + 106: Export flock. + 107: Export fcntl64. + 108: Remove unused (hopefully) reent_data export. + 109: Oh well. Someone uses reent_data. + */ + + /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ + +#define CYGWIN_VERSION_API_MAJOR 0 +#define CYGWIN_VERSION_API_MINOR 109 + + /* There is also a compatibity version number associated with the + shared memory regions. It is incremented when incompatible + changes are made to the shared memory region *or* to any named + shared mutexes, semaphores, etc. The arbitrary starting + version was 0 (cygwin release 98r2). */ + +#define CYGWIN_VERSION_SHARED_DATA 3 + + /* An identifier used in the names used to create shared objects. + The full names include the CYGWIN_VERSION_SHARED_DATA version + as well as this identifier. */ + +#define CYGWIN_VERSION_DLL_IDENTIFIER "cygwin1" + + /* The Cygwin mount table interface in the Win32 registry also + has a version number associated with it in case that is + changed in a non-backwards compatible fashion. Increment this + version number whenever incompatible changes in mount table + registry usage are made. + + 1: Original number version. + 2: New mount registry layout, system-wide mount accessibility. + */ + +#define CYGWIN_VERSION_MOUNT_REGISTRY 2 + + /* Identifiers used in the Win32 registry. */ + +#define CYGWIN_INFO_CYGNUS_REGISTRY_NAME "Cygnus Solutions" +#define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin" +#define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options" +#define CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME "mounts v2" +#define CYGWIN_INFO_CYGDRIVE_FLAGS "cygdrive flags" +#define CYGWIN_INFO_CYGDRIVE_PREFIX "cygdrive prefix" +#define CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/cygdrive" + + /* In addition to the above version number strings, the build + process adds some strings that may be useful in + debugging/identifying a particular Cygwin DLL: + + The mkvers.sh script at the top level produces a .cc file + which initializes a cygwin_version structure based on the + above version information and creates a string table for + grepping via "fgrep '%%%' cygwinwhatever.dll" if you are + using GNU grep. Otherwise you may want to do a + "strings cygwinwhatever.dll | fgrep '%%%'" instead. + + This will produce output such as: + + %%% Cygwin dll_identifier: cygwin + %%% Cygwin api_major: 0 + %%% Cygwin api_minor: 0 + %%% Cygwin dll_major: 19 + %%% Cygwin dll_minor: 6 + %%% Cygwin shared_data: 1 + %%% Cygwin registry: b15 + %%% Cygwin build date: Wed Oct 14 16:26:51 EDT 1998 + %%% Cygwin shared id: cygwinS1 + + This information can also be obtained through a call to + cygwin_internal (CW_GETVERSIONINFO). + */ + +#define CYGWIN_VERSION_MAGIC(a, b) ((unsigned) ((((unsigned short) a) << 16) | (unsigned short) b)) +#define CYGWIN_VERSION_MAGIC_VERSION(a) ((unsigned) ((unsigned)a & 0xffff)) diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 942373460f1..4ecadda4e94 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -133,9 +133,6 @@ HANDLE NO_COPY signal_arrived; // Event signaled when a signal has Static DWORD proc_loop_wait = 1000; // Wait for subprocesses to exit -Static HANDLE sigcomplete_main; // Event signaled when a signal has - // finished processing for the main - // thread HANDLE NO_COPY sigCONT; // Used to "STOP" a process Static cygthread *hwait_sig; // Handle of wait_sig thread Static cygthread *hwait_subproc; // Handle of sig_subproc thread @@ -665,7 +662,6 @@ sigproc_terminate (void) { sigproc_printf ("entering"); // finished with anything it is doing - ForceCloseHandle (sigcomplete_main); if (!hExeced) { HANDLE sendsig = myself->sendsig; @@ -691,8 +687,8 @@ sig_send (_pinfo *p, int sig, void *tls) HANDLE sendsig; sigpacket pack; + pack.wakeup = NULL; bool wait_for_completion; - // FIXMENOW: Avoid using main thread's completion event! if (!(its_me = (p == NULL || p == myself || p == myself_nowait))) wait_for_completion = false; else @@ -720,11 +716,7 @@ sig_send (_pinfo *p, int sig, void *tls) } if (its_me) - { - sendsig = myself->sendsig; - if (wait_for_completion) - pack.wakeup = sigcomplete_main; - } + sendsig = myself->sendsig; else { HANDLE hp = OpenProcess (PROCESS_DUP_HANDLE, false, p->dwProcessId); @@ -763,11 +755,18 @@ sig_send (_pinfo *p, int sig, void *tls) pack.sig = sig; pack.pid = myself->pid; pack.tls = (_threadinfo *) tls; + if (wait_for_completion) + { + pack.wakeup = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + sigproc_printf ("wakeup %p", pack.wakeup); + ProtectHandle (pack.wakeup); + } + DWORD nb; if (!WriteFile (sendsig, &pack, sizeof (pack), &nb, NULL) || nb != sizeof (pack)) { /* Couldn't send to the pipe. This probably means that the - process is exiting. */ + process is exiting. */ if (!its_me) { sigproc_printf ("WriteFile for pipe %p failed, %E", sendsig); @@ -820,6 +819,9 @@ sig_send (_pinfo *p, int sig, void *tls) call_signal_handler_now (); out: + if (pack.wakeup) + ForceCloseHandle (pack.wakeup); + if (sig != __SIGPENDING) /* nothing */; else if (!rc) @@ -1082,12 +1084,8 @@ wait_sig (VOID *self) /* Initialization */ (void) SetThreadPriority (GetCurrentThread (), WAIT_SIG_PRIORITY); - /* sigcomplete_main - event used to signal main thread on signal - completion */ if (!CreatePipe (&readsig, &myself->sendsig, sec_user_nih (sa_buf), 0)) api_fatal ("couldn't create signal pipe, %E"); - sigcomplete_main = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); - sigproc_printf ("sigcomplete_main %p", sigcomplete_main); sigCONT = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); /* Setting dwProcessId flags that this process is now capable of receiving @@ -1098,8 +1096,6 @@ wait_sig (VOID *self) myself->process_state |= PID_ACTIVE; myself->process_state &= ~PID_INITIALIZING; - ProtectHandle (sigcomplete_main); - /* If we've been execed, then there is still a stub left in the previous windows process waiting to see if it's started a cygwin process or not. Signalling subproc_ready indicates that we are a cygwin process. */ @@ -1199,7 +1195,10 @@ wait_sig (VOID *self) break; } if (pack.wakeup) - SetEvent (pack.wakeup); + { + SetEvent (pack.wakeup); + sigproc_printf ("signalled %p", pack.wakeup); + } } sigproc_printf ("done"); -- cgit v1.2.1