Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sc8-pr-cvs1:/tmp/cvs-serv13103/cygwin Modified Files: ChangeLog.MSYS Makefile.in autoload.cc fhandler_socket.cc heap.cc net.cc pinfo.cc shared.cc tty.cc tty.h winsup.h Log Message: * Makefile.in: Add -lnetapi32 to the DLL build command. * autoload.cc: Copy verbatum from current Cygwin CVS. * fhandler_socket.cc: Move include of unistd.h after winsock2.h for protection of gethostname declaration. * net.cc: Ditto. * heap.cc: Move a FIXME declaration into the procedure instead of global space. * pinfo.cc: Use NtQuerySystemInformation instead of the Zw version. * shared.cc (shared_name): Use hash_path_name for uniqueness. * tty.cc: Incorporate current Cygwin CVS changes. Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ChangeLog.MSYS 23 Mar 2003 17:22:46 -0000 1.41 --- ChangeLog.MSYS 23 Mar 2003 22:58:23 -0000 1.42 *************** *** 3,6 **** --- 3,16 ---- * uinfo.cc (internal_getlogin): Move check for USERNAME variable to global space instead of iswinnt filter. + * Makefile.in: Add -lnetapi32 to the DLL build command. + * autoload.cc: Copy verbatum from current Cygwin CVS. + * fhandler_socket.cc: Move include of unistd.h after winsock2.h for + protection of gethostname declaration. + * net.cc: Ditto. + * heap.cc: Move a FIXME declaration into the procedure instead of + global space. + * pinfo.cc: Use NtQuerySystemInformation instead of the Zw version. + * shared.cc (shared_name): Use hash_path_name for uniqueness. + * tty.cc: Incorporate current Cygwin CVS changes. 2003-02-17 Earnie Boyd <ea...@us...> Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 3 Dec 2002 13:24:24 -0000 1.5 --- Makefile.in 23 Mar 2003 22:58:23 -0000 1.6 *************** *** 200,204 **** -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \ $(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \ ! -lstdc++ -lgcc -lshell32 -luuid -lkernel32 dll_ofiles: $(DLL_OFILES) --- 200,204 ---- -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \ $(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \ ! -lstdc++ -lgcc -lshell32 -luuid -lkernel32 -lnetapi32 dll_ofiles: $(DLL_OFILES) Index: autoload.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/autoload.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** autoload.cc 15 Oct 2001 22:22:32 -0000 1.2 --- autoload.cc 23 Mar 2003 22:58:23 -0000 1.3 *************** *** 1,5 **** /* autoload.cc: all dynamic load stuff. ! Copyright 2000, 2001 Red Hat, Inc. This file is part of Cygwin. --- 1,5 ---- /* autoload.cc: all dynamic load stuff. ! Copyright 2000, 2001, 2002, 2003 Red Hat, Inc. This file is part of Cygwin. *************** *** 73,79 **** found. */ #define LoadDLLfunc(name, n, dllname) LoadDLLfuncEx (name, n, dllname, 0) /* Main DLL setup stuff. */ ! #define LoadDLLfuncEx(name, n, dllname, notimp) \ LoadDLLprime (dllname, dll_func_load) \ __asm__ (" \n\ --- 73,80 ---- found. */ #define LoadDLLfunc(name, n, dllname) LoadDLLfuncEx (name, n, dllname, 0) + #define LoadDLLfuncEx(name, n, dllname, notimp) LoadDLLfuncEx2(name, n, dllname, notimp, 0) /* Main DLL setup stuff. */ ! #define LoadDLLfuncEx2(name, n, dllname, notimp, err) \ LoadDLLprime (dllname, dll_func_load) \ __asm__ (" \n\ *************** *** 84,91 **** _" mangle (name, n) ": \n\ _win32_" mangle (name, n) ": \n\ ! movl (1f),%eax \n\ call *(%eax) \n\ ! 1:.long ." #dllname "_info \n\ ! .long " #n "+" #notimp " \n\ .asciz \"" #name "\" \n\ .text \n\ --- 85,94 ---- _" mangle (name, n) ": \n\ _win32_" mangle (name, n) ": \n\ ! .byte 0xe9 \n\ ! .long -4 + 1f - . \n\ ! 1:movl (2f),%eax \n\ call *(%eax) \n\ ! 2:.long ." #dllname "_info \n\ ! .long (" #n "+" #notimp ") | " #err "<<16 \n\ .asciz \"" #name "\" \n\ .text \n\ *************** *** 123,130 **** popl %edx # Caller's caller \n\ addl %eax,%esp # Pop off bytes \n\ movl $127,%eax # ERROR_PROC_NOT_FOUND \n\ pushl %eax # First argument \n\ call _SetLastError@4 # Set it \n\ ! xor %eax,%eax # Zero functional return \n\ jmp *%edx # Return \n\ 1: \n\ --- 126,137 ---- popl %edx # Caller's caller \n\ addl %eax,%esp # Pop off bytes \n\ + andl $0xffff0000,%eax# upper word \n\ + subl %eax,%esp # adjust for possible return value \n\ + pushl %eax # Save for later \n\ movl $127,%eax # ERROR_PROC_NOT_FOUND \n\ pushl %eax # First argument \n\ call _SetLastError@4 # Set it \n\ ! popl %eax # Get back argument \n\ ! shrl $16,%eax # return value in high order word \n\ jmp *%edx # Return \n\ 1: \n\ *************** *** 149,158 **** jmp noload # Issue an error or return \n\ gotit: \n\ ! popl %ecx # Pointer to 'return address' \n\ ! movb $0xe9,-7(%ecx) # Turn preceding call to a jmp *%eax \n\ ! movl %eax,%edx # Save \n\ ! subl %ecx,%eax # Make it relative \n\ ! addl $2,%eax # Tweak \n\ ! movl %eax,-6(%ecx) # Move relative address after jump \n\ jmp *%edx # Jump to actual function \n\ \n\ --- 156,164 ---- jmp noload # Issue an error or return \n\ gotit: \n\ ! popl %edx # Pointer to 'return address' \n\ ! subl %edx,%eax # Make it relative \n\ ! addl $7,%eax # Tweak \n\ ! subl $12,%edx # Point to jmp \n\ ! movl %eax,1(%edx) # Move relative address after jump \n\ jmp *%edx # Jump to actual function \n\ \n\ *************** *** 242,249 **** { static LONG NO_COPY here = -1L; - extern WSADATA wsadata; struct func_info *func = (struct func_info *) __builtin_return_address (0); struct dll_info *dll = func->dll; - retchain ret; __asm__ (" \n\ --- 248,253 ---- *************** *** 263,267 **** } ! if (!wsock_started && (wsock32_handle || ws2_32_handle)) { /* Don't use autoload to load WSAStartup to eliminate recursion. */ --- 267,271 ---- } ! if (!wsock_started && (winsock_active || winsock2_active)) { /* Don't use autoload to load WSAStartup to eliminate recursion. */ *************** *** 294,297 **** --- 298,302 ---- "); + volatile retchain ret; /* Set "arguments for dll_chain1. */ ret.low = (long) dll_func_load; *************** *** 303,306 **** --- 308,312 ---- LoadDLLprime (ws2_32, wsock_init) + LoadDLLfunc (AccessCheck, 32, advapi32) LoadDLLfunc (AddAccessAllowedAce, 16, advapi32) LoadDLLfunc (AddAccessDeniedAce, 16, advapi32) *************** *** 314,325 **** --- 320,334 ---- LoadDLLfuncEx (CryptReleaseContext, 8, advapi32, 1) LoadDLLfunc (DeregisterEventSource, 4, advapi32) + LoadDLLfunc (DuplicateToken, 12, advapi32) LoadDLLfuncEx (DuplicateTokenEx, 24, advapi32, 1) LoadDLLfunc (EqualSid, 8, advapi32) LoadDLLfunc (GetAce, 12, advapi32) LoadDLLfunc (GetFileSecurityA, 20, advapi32) + LoadDLLfunc (GetKernelObjectSecurity, 20, advapi32) LoadDLLfunc (GetLengthSid, 4, advapi32) LoadDLLfunc (GetSecurityDescriptorDacl, 16, advapi32) LoadDLLfunc (GetSecurityDescriptorGroup, 12, advapi32) LoadDLLfunc (GetSecurityDescriptorOwner, 12, advapi32) + LoadDLLfunc (GetSecurityInfo, 32, advapi32) LoadDLLfunc (GetSidIdentifierAuthority, 4, advapi32) LoadDLLfunc (GetSidSubAuthority, 8, advapi32) *************** *** 328,331 **** --- 337,341 ---- LoadDLLfunc (GetUserNameA, 8, advapi32) LoadDLLfunc (ImpersonateLoggedOnUser, 4, advapi32) + LoadDLLfunc (ImpersonateNamedPipeClient, 4, advapi32) LoadDLLfunc (InitializeAcl, 12, advapi32) LoadDLLfunc (InitializeSecurityDescriptor, 8, advapi32) *************** *** 345,348 **** --- 355,359 ---- LoadDLLfunc (MakeSelfRelativeSD, 12, advapi32) LoadDLLfunc (OpenProcessToken, 12, advapi32) + LoadDLLfunc (OpenThreadToken, 16, advapi32) LoadDLLfunc (RegCloseKey, 4, advapi32) LoadDLLfunc (RegCreateKeyExA, 36, advapi32) *************** *** 353,356 **** --- 364,368 ---- LoadDLLfunc (RegEnumValueA, 32, advapi32) LoadDLLfunc (RegOpenKeyExA, 20, advapi32) + LoadDLLfunc (RegQueryInfoKeyA, 48, advapi32) LoadDLLfunc (RegQueryValueExA, 24, advapi32) LoadDLLfunc (RegSetValueExA, 24, advapi32) *************** *** 366,372 **** LoadDLLfunc (NetApiBufferFree, 4, netapi32) LoadDLLfunc (NetLocalGroupEnum, 28, netapi32) LoadDLLfunc (NetLocalGroupGetMembers, 32, netapi32) - LoadDLLfunc (NetServerEnum, 36, netapi32) LoadDLLfunc (NetUserGetGroups, 28, netapi32) LoadDLLfunc (NetUserGetInfo, 16, netapi32) --- 378,384 ---- LoadDLLfunc (NetApiBufferFree, 4, netapi32) + LoadDLLfuncEx (NetGetDCName, 12, netapi32, 1) LoadDLLfunc (NetLocalGroupEnum, 28, netapi32) LoadDLLfunc (NetLocalGroupGetMembers, 32, netapi32) LoadDLLfunc (NetUserGetGroups, 28, netapi32) LoadDLLfunc (NetUserGetInfo, 16, netapi32) *************** *** 375,384 **** LoadDLLfuncEx (NtCreateToken, 52, ntdll, 1) LoadDLLfuncEx (NtMapViewOfSection, 40, ntdll, 1) LoadDLLfuncEx (NtOpenSection, 12, ntdll, 1) LoadDLLfuncEx (NtQuerySystemInformation, 16, ntdll, 1) LoadDLLfuncEx (NtUnmapViewOfSection, 8, ntdll, 1) LoadDLLfuncEx (RtlInitUnicodeString, 8, ntdll, 1) LoadDLLfuncEx (RtlNtStatusToDosError, 4, ntdll, 1) ! LoadDLLfuncEx (ZwQuerySystemInformation, 16, ntdll, 1) LoadDLLfuncEx (LsaDeregisterLogonProcess, 4, secur32, 1) --- 387,402 ---- LoadDLLfuncEx (NtCreateToken, 52, ntdll, 1) LoadDLLfuncEx (NtMapViewOfSection, 40, ntdll, 1) + LoadDLLfuncEx (NtOpenFile, 24, ntdll, 1) LoadDLLfuncEx (NtOpenSection, 12, ntdll, 1) + LoadDLLfuncEx (NtQueryInformationFile, 20, ntdll, 1) + LoadDLLfuncEx (NtQueryInformationProcess, 20, ntdll, 1) + LoadDLLfuncEx2 (NtQueryObject, 20, ntdll, 1, 1) LoadDLLfuncEx (NtQuerySystemInformation, 16, ntdll, 1) + LoadDLLfuncEx (NtQueryVirtualMemory, 24, ntdll, 1) LoadDLLfuncEx (NtUnmapViewOfSection, 8, ntdll, 1) LoadDLLfuncEx (RtlInitUnicodeString, 8, ntdll, 1) LoadDLLfuncEx (RtlNtStatusToDosError, 4, ntdll, 1) ! ! LoadDLLfuncEx (GetProcessMemoryInfo, 12, psapi, 1) LoadDLLfuncEx (LsaDeregisterLogonProcess, 4, secur32, 1) *************** *** 404,407 **** --- 422,426 ---- LoadDLLfunc (GetUserObjectInformationA, 20, user32) LoadDLLfunc (KillTimer, 8, user32) + LoadDLLfunc (MessageBeep, 4, user32) LoadDLLfunc (MessageBoxA, 16, user32) LoadDLLfunc (MsgWaitForMultipleObjects, 20, user32) *************** *** 418,426 **** LoadDLLfunc (SetUserObjectSecurity, 12, user32) LoadDLLfunc (WSAAsyncSelect, 16, wsock32) LoadDLLfunc (WSACleanup, 0, wsock32) LoadDLLfunc (WSAGetLastError, 0, wsock32) LoadDLLfunc (WSASetLastError, 4, wsock32) ! LoadDLLfunc (WSAStartup, 8, wsock32) LoadDLLfunc (__WSAFDIsSet, 8, wsock32) LoadDLLfunc (accept, 12, wsock32) --- 437,446 ---- LoadDLLfunc (SetUserObjectSecurity, 12, user32) + LoadDLLfuncEx (load_wsock32, 0, wsock32, 1) // non-existent function forces wsock32 load LoadDLLfunc (WSAAsyncSelect, 16, wsock32) LoadDLLfunc (WSACleanup, 0, wsock32) LoadDLLfunc (WSAGetLastError, 0, wsock32) LoadDLLfunc (WSASetLastError, 4, wsock32) ! // LoadDLLfunc (WSAStartup, 8, wsock32) LoadDLLfunc (__WSAFDIsSet, 8, wsock32) LoadDLLfunc (accept, 12, wsock32) *************** *** 430,434 **** LoadDLLfunc (gethostbyaddr, 12, wsock32) LoadDLLfunc (gethostbyname, 4, wsock32) ! LoadDLLfunc (gethostname, 8, wsock32) LoadDLLfunc (getpeername, 12, wsock32) LoadDLLfunc (getprotobyname, 4, wsock32) --- 450,454 ---- LoadDLLfunc (gethostbyaddr, 12, wsock32) LoadDLLfunc (gethostbyname, 4, wsock32) ! LoadDLLfuncEx2 (gethostname, 8, wsock32, 1, 1) LoadDLLfunc (getpeername, 12, wsock32) LoadDLLfunc (getprotobyname, 4, wsock32) *************** *** 466,471 **** --- 486,494 ---- LoadDLLfuncEx (WSASocketA, 24, ws2_32, 1) LoadDLLfuncEx (WSAWaitForMultipleEvents, 20, ws2_32, 1) + LoadDLLfuncEx (WSAEventSelect, 12, ws2_32, 1) + LoadDLLfuncEx (WSAEnumNetworkEvents, 12, ws2_32, 1) LoadDLLfuncEx (GetIfTable, 12, iphlpapi, 1) + LoadDLLfuncEx (GetIfEntry, 4, iphlpapi, 1) LoadDLLfuncEx (GetIpAddrTable, 12, iphlpapi, 1) *************** *** 474,482 **** LoadDLLfunc (CoCreateInstance, 20, ole32) - LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1) LoadDLLfuncEx (CancelIo, 4, kernel32, 1) LoadDLLfuncEx (Process32First, 8, kernel32, 1) LoadDLLfuncEx (Process32Next, 8, kernel32, 1) ! LoadDLLfuncEx (CreateToolhelp32Snapshot, 8, kernel32, 1) LoadDLLfunc (TryEnterCriticalSection, 4, kernel32) --- 497,511 ---- LoadDLLfunc (CoCreateInstance, 20, ole32) LoadDLLfuncEx (CancelIo, 4, kernel32, 1) + LoadDLLfuncEx (CreateHardLinkA, 12, kernel32, 1) + LoadDLLfuncEx (CreateToolhelp32Snapshot, 8, kernel32, 1) + LoadDLLfuncEx2 (GetCompressedFileSizeA, 8, kernel32, 1, 0xffffffff) + LoadDLLfuncEx (GetConsoleWindow, 0, kernel32, 1) + LoadDLLfuncEx (GetSystemTimes, 12, kernel32, 1) + LoadDLLfuncEx2 (IsDebuggerPresent, 0, kernel32, 1, 1) + LoadDLLfunc (IsProcessorFeaturePresent, 4, kernel32); LoadDLLfuncEx (Process32First, 8, kernel32, 1) LoadDLLfuncEx (Process32Next, 8, kernel32, 1) ! LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1) LoadDLLfunc (TryEnterCriticalSection, 4, kernel32) *************** *** 490,492 **** --- 519,525 ---- LoadDLLfuncEx (waveOutPrepareHeader, 12, winmm, 1) LoadDLLfuncEx (waveOutWrite, 12, winmm, 1) + LoadDLLfuncEx (timeGetDevCaps, 8, winmm, 1) + LoadDLLfuncEx (timeGetTime, 0, winmm, 1) + LoadDLLfuncEx (timeBeginPeriod, 4, winmm, 1) + LoadDLLfuncEx (timeEndPeriod, 4, winmm, 1) } Index: fhandler_socket.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/fhandler_socket.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fhandler_socket.cc 15 Oct 2001 22:22:33 -0000 1.2 --- fhandler_socket.cc 23 Mar 2003 22:58:23 -0000 1.3 *************** *** 19,26 **** #include <stdlib.h> - #include <unistd.h> #include <fcntl.h> #define USE_SYS_TYPES_FD_SET #include <winsock2.h> #include "cygerrno.h" #include "security.h" --- 19,26 ---- #include <stdlib.h> #include <fcntl.h> #define USE_SYS_TYPES_FD_SET #include <winsock2.h> + #include <unistd.h> #include "cygerrno.h" #include "security.h" Index: heap.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/heap.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** heap.cc 17 Feb 2003 21:05:55 -0000 1.3 --- heap.cc 23 Mar 2003 22:58:23 -0000 1.4 *************** *** 84,88 **** #define pround(n) (((size_t)(n) + page_const) & ~page_const) - FIXME; /* FIXME: This function no longer handles "split heaps". */ --- 84,87 ---- *************** *** 90,93 **** --- 89,93 ---- _sbrk(int n) { + FIXME; sigframe thisframe (mainthread); char *newtop, *newbrk; Index: net.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/net.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** net.cc 15 Oct 2001 22:22:33 -0000 1.2 --- net.cc 23 Mar 2003 22:58:23 -0000 1.3 *************** *** 20,28 **** #include <stdlib.h> - #include <unistd.h> #include <netdb.h> #include <fcntl.h> #define USE_SYS_TYPES_FD_SET #include <winsock2.h> #include "cygerrno.h" #include "security.h" --- 20,28 ---- #include <stdlib.h> #include <netdb.h> #include <fcntl.h> #define USE_SYS_TYPES_FD_SET #include <winsock2.h> + #include <unistd.h> #include "cygerrno.h" #include "security.h" Index: pinfo.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/pinfo.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pinfo.cc 9 Oct 2002 19:15:21 -0000 1.6 --- pinfo.cc 23 Mar 2003 22:58:23 -0000 1.7 *************** *** 337,341 **** for (;;) { ! res = ZwQuerySystemInformation (SystemProcessesAndThreadsInformation, procs, szprocs, NULL); if (res == 0) --- 337,341 ---- for (;;) { ! res = NtQuerySystemInformation (SystemProcessesAndThreadsInformation, procs, szprocs, NULL); if (res == 0) Index: shared.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/shared.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shared.cc 9 Oct 2002 19:15:21 -0000 1.7 --- shared.cc 23 Mar 2003 22:58:23 -0000 1.8 *************** *** 48,63 **** static NO_COPY char buf2[MAX_PATH] = {0}; extern bool _cygwin_testing; ! char *tptr; - //FIXME: This should be based on where the DLL actually is located. AbsDllPath("msys-1.0.dll", buf2, sizeof (buf2)); ! debug_printf("buf2 = %s", buf2); ! strcpy(buf2, &buf2[3]); ! tptr = strchr(buf2, '\\'); ! if (tptr) ! *tptr = '\0'; ! debug_printf("buf2 = %s", buf2); ! debug_printf("shared_id = %s", cygwin_version.shared_id); ! __small_sprintf (buf, "%s.%s.%s.%d", buf2, cygwin_version.shared_id, str, num); /* This code was removed because cygwin_version.dll_build_date is invalid. * This should be put back into service once we discover the culprit. --- 48,57 ---- static NO_COPY char buf2[MAX_PATH] = {0}; extern bool _cygwin_testing; ! static unsigned long ulModuleHash; AbsDllPath("msys-1.0.dll", buf2, sizeof (buf2)); ! ulModuleHash = hash_path_name(ulModuleHash, buf2); ! debug_printf("%d.%s.%s.%d", ulModuleHash, cygwin_version.shared_id, str, num); ! __small_sprintf (buf, "%d.%s.%s.%d", ulModuleHash, cygwin_version.shared_id, str, num); /* This code was removed because cygwin_version.dll_build_date is invalid. * This should be put back into service once we discover the culprit. Index: tty.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/tty.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tty.cc 17 Jul 2002 13:06:56 -0000 1.3 --- tty.cc 23 Mar 2003 22:58:23 -0000 1.4 *************** *** 20,26 **** #include "security.h" #include "fhandler.h" #include "dtable.h" #include "cygheap.h" - #include "sync.h" #include "sigproc.h" #include "pinfo.h" --- 20,26 ---- #include "security.h" #include "fhandler.h" + #include "path.h" #include "dtable.h" #include "cygheap.h" #include "sigproc.h" #include "pinfo.h" *************** *** 29,34 **** extern fhandler_tty_master *tty_master; ! extern "C" ! int grantpt (int fd) { --- 29,33 ---- extern fhandler_tty_master *tty_master; ! extern "C" int grantpt (int fd) { *************** *** 37,42 **** } ! extern "C" ! int unlockpt (int fd) { --- 36,40 ---- } ! extern "C" int unlockpt (int fd) { *************** *** 45,50 **** } ! extern "C" ! int ttyslot (void) { --- 43,47 ---- } ! extern "C" int ttyslot (void) { *************** *** 59,62 **** --- 56,65 ---- { TRACE_IN; + #if 0 + # FIXME: Is this needed?? New Cygwin code. + if (!myself->ppid_handle && NOTSTATE (myself, PID_CYGPARENT)) + cygheap->fdtab.get_debugger_info (); + #endif + if (NOTSTATE (myself, PID_USETTY)) return; *************** *** 76,80 **** { TRACE_IN; ! tty_master = (fhandler_tty_master *) cygheap->fdtab.build_fhandler (-1, FH_TTYM, "/dev/ttym", ttynum); if (tty_master->init (ttynum)) api_fatal ("Can't create master tty"); --- 79,84 ---- { TRACE_IN; ! tty_master = (fhandler_tty_master *) ! cygheap->fdtab.build_fhandler (-1, FH_TTYM, "/dev/ttym", ttynum); if (tty_master->init (ttynum)) api_fatal ("Can't create master tty"); *************** *** 83,93 **** /* Log utmp entry */ struct utmp our_utmp; bzero ((char *) &our_utmp, sizeof (utmp)); (void) time (&our_utmp.ut_time); strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name)); ! cygwin_gethostname (our_utmp.ut_host, sizeof (our_utmp.ut_host)); ! __small_sprintf (our_utmp.ut_line, "tty%d", ttynum); our_utmp.ut_type = USER_PROCESS; myself->ctty = ttynum; login (&our_utmp); --- 87,104 ---- /* Log utmp entry */ struct utmp our_utmp; + DWORD len = sizeof our_utmp.ut_host; bzero ((char *) &our_utmp, sizeof (utmp)); (void) time (&our_utmp.ut_time); strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name)); ! GetComputerName (our_utmp.ut_host, &len); ! __small_sprintf (our_utmp.ut_line, "tty%d", ttynum); ! if ((len = strlen (our_utmp.ut_line)) >= UT_IDLEN) ! len -= UT_IDLEN; ! else ! len = 0; ! //strncpy (our_utmp.ut_id, our_utmp.ut_line + len, UT_IDLEN); our_utmp.ut_type = USER_PROCESS; + our_utmp.ut_pid = myself->pid; myself->ctty = ttynum; login (&our_utmp); *************** *** 149,153 **** ForceCloseHandle1 (t->from_slave, from_pty); CloseHandle (tty_master->inuse); - WaitForSingleObject (tty_master->hThread, INFINITE); t->init (); --- 160,163 ---- *************** *** 202,206 **** if (!with_console) console = NULL; ! else { #if DO_CPP_NEW --- 212,216 ---- if (!with_console) console = NULL; ! else if (!(console = GetConsoleWindow ())) { #if DO_CPP_NEW *************** *** 228,233 **** __small_sprintf (buf, "cygwin.find.console.%d", myself->pid); SetConsoleTitle (buf); ! Sleep (40); ! console = FindWindow (NULL, buf); SetConsoleTitle (oldtitle); #if DO_CPP_NEW --- 238,247 ---- __small_sprintf (buf, "cygwin.find.console.%d", myself->pid); SetConsoleTitle (buf); ! for (int times = 0; times < 25; times++) ! { ! Sleep (10); ! if ((console = FindWindow (NULL, buf))) ! break; ! } SetConsoleTitle (oldtitle); #if DO_CPP_NEW *************** *** 378,382 **** /* FIXME: should this be sec_none_nih? */ ! if (CreatePipe (&from_master, &to_slave, &sec_all, 0) == FALSE) { termios_printf ("can't create input pipe"); --- 392,396 ---- /* FIXME: should this be sec_none_nih? */ ! if (CreatePipe (&from_master, &to_slave, &sec_all, 128 * 1024) == FALSE) { termios_printf ("can't create input pipe"); *************** *** 385,390 **** } ! ProtectHandle1 (to_slave, to_pty); ! if (CreatePipe (&from_slave, &to_master, &sec_all, 0) == FALSE) { termios_printf ("can't create output pipe"); --- 399,404 ---- } ! //ProtectHandle1NH (to_slave, to_pty); ! if (CreatePipe (&from_slave, &to_master, &sec_all, 128 * 1024) == FALSE) { termios_printf ("can't create output pipe"); *************** *** 392,396 **** return FALSE; } ! ProtectHandle1 (from_slave, from_pty); termios_printf ("tty%d from_slave %p, to_slave %p", ntty, from_slave, to_slave); --- 406,410 ---- return FALSE; } ! //ProtectHandle1NH (from_slave, from_pty); termios_printf ("tty%d from_slave %p, to_slave %p", ntty, from_slave, to_slave); Index: tty.h =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/tty.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tty.h 15 Oct 2001 22:22:33 -0000 1.2 --- tty.h 23 Mar 2003 22:58:23 -0000 1.3 *************** *** 1,5 **** /* tty.h: shared tty info for cygwin ! Copyright 2000, 2001 Red Hat, Inc. This file is part of Cygwin. --- 1,5 ---- /* tty.h: shared tty info for cygwin ! Copyright 2000, 2001, 2002 Red Hat, Inc. This file is part of Cygwin. *************** *** 63,66 **** --- 63,67 ---- void setsid (pid_t tsid) {sid = tsid;} void set_ctty (int ttynum, int flags); + void kill_pgrp (int sig); struct termios ti; struct winsize winsize; Index: winsup.h =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/winsup.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** winsup.h 12 Feb 2003 15:50:29 -0000 1.8 --- winsup.h 23 Mar 2003 22:58:23 -0000 1.9 *************** *** 2,7 **** Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc. ! This file is part of Cygwin. This software is a copyrighted work licensed under the terms of the --- 2,8 ---- Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc. + Copyright 2003 Earnie Boyd <ea...@us...> ! This file is part of MSYS. This software is a copyrighted work licensed under the terms of the *************** *** 61,64 **** --- 62,66 ---- #define WIN32_LEAN_AND_MEAN 1 + #define _WIN32_WINNT 0x0600 #define _WINGDI_H #define _WINUSER_H *************** *** 70,73 **** --- 72,76 ---- #include <wincrypt.h> #include <lmcons.h> + #include <wincon.h> #undef _WINGDI_H #undef _WINUSER_H *************** *** 276,279 **** --- 279,286 ---- extern bool IsMsys (const char *); + + #define winsock2_active (wsadata.wVersion >= 512) + #define winsock_active (wsadata.wVersion <= 512) + extern struct WSAData wsadata; #endif /* defined __cplusplus */ |