diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index deef3d063..9d00d22c9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2004-02-24 Christopher Faylor + + * dcrt0.cc (_dll_crt0): Don't check sync_startup if threadfunc_ix is set. + + * external.cc (cygwin_internal): Implement CW_GET_BINMODE. + * include/sys/cygwin.h: Declare CW_GET_BINMODE. + 2004-02-24 Christopher Faylor * dcrt0.cc (_dll_crt0): Add some stern internal errors. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index eba2348be..1848fa8e9 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -910,7 +910,10 @@ extern "C" void __stdcall _dll_crt0 () { extern HANDLE sync_startup; - if (!sync_startup) + extern unsigned threadfunc_ix; + if (threadfunc_ix) + /* nothing to do */; + else if (!sync_startup) system_printf ("internal error: sync_startup not called at start. Expect signal problems."); else { @@ -918,7 +921,6 @@ _dll_crt0 () CloseHandle (sync_startup); } - extern unsigned threadfunc_ix; if (!threadfunc_ix) system_printf ("internal error: couldn't determine location of thread function on stack. Expect signal problems."); diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 332879f8c..b14932426 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -289,6 +289,17 @@ cygwin_internal (cygwin_getinfo_types t, ...) struct __group32 *gr = internal_getgrsid (sid); return gr ? gr->gr_gid : (__gid32_t)-1; } + case CW_GET_BINMODE: + { + const char *path = va_arg (arg, const char *); + path_conv p (path, PC_SYM_FOLLOW | PC_FULL | PC_NULLEMPTY); + if (p.error) + { + set_errno (p.error); + return (unsigned long) -1; + } + return p.binmode (); + } default: return (DWORD) -1; } diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index 10b1b0823..2b4246288 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -77,7 +77,8 @@ typedef enum CW_GET_POSIX_SECURITY_ATTRIBUTE, CW_GET_SHMLBA, CW_GET_UID_FROM_SID, - CW_GET_GID_FROM_SID + CW_GET_GID_FROM_SID, + CW_GET_BINMODE } cygwin_getinfo_types; #define CW_NEXTPID 0x80000000 /* or with pid to get next one */