comparison src/ntproc.c @ 239:41f2f0e326e9 r20-5b18

Import from CVS: tag r20-5b18
author cvs
date Mon, 13 Aug 2007 10:15:48 +0200
parents 2c611d1463a6
children 727739f917cb
comparison
equal deleted inserted replaced
238:b5f2e56b938d 239:41f2f0e326e9
38 #undef spawnve 38 #undef spawnve
39 #undef select 39 #undef select
40 #undef kill 40 #undef kill
41 41
42 #include <windows.h> 42 #include <windows.h>
43 #include <sys/socket.h>
43 44
44 #include "lisp.h" 45 #include "lisp.h"
46 #include "sysproc.h"
45 #include "nt.h" 47 #include "nt.h"
46 #include "ntheap.h" /* From 19.34.6 */ 48 #include "ntheap.h" /* From 19.34.6 */
47 #include "systime.h" 49 #include "systime.h"
48 #include "syssignal.h" 50 #include "syssignal.h"
49 #include "syswait.h" 51 #include "syswait.h"
87 are supported on NTFS volumes, this is only relevant on NT. */ 89 are supported on NTFS volumes, this is only relevant on NT. */
88 Lisp_Object Vwin32_get_true_file_attributes; 90 Lisp_Object Vwin32_get_true_file_attributes;
89 91
90 Lisp_Object Qhigh, Qlow; 92 Lisp_Object Qhigh, Qlow;
91 93
92 #ifndef SYS_SIGLIST_DECLARED 94 #ifndef DEBUG_XEMACS
93 extern char *sys_siglist[]; 95 __inline
94 #endif 96 #endif
95
96 #ifdef EMACSDEBUG
97 void _DebPrint (const char *fmt, ...) 97 void _DebPrint (const char *fmt, ...)
98 { 98 {
99 #ifdef DEBUG_XEMACS
99 char buf[1024]; 100 char buf[1024];
100 va_list args; 101 va_list args;
101 102
102 va_start (args, fmt); 103 va_start (args, fmt);
103 vsprintf (buf, fmt, args); 104 vsprintf (buf, fmt, args);
104 va_end (args); 105 va_end (args);
105 OutputDebugString (buf); 106 OutputDebugString (buf);
106 }
107 #endif 107 #endif
108 }
108 109
109 /* sys_signal moved to nt.c. It's now called msw_signal... */ 110 /* sys_signal moved to nt.c. It's now called msw_signal... */
110 111
111 /* Defined in <process.h> which conflicts with the local copy */ 112 /* Defined in <process.h> which conflicts with the local copy */
112 #define _P_NOWAIT 1 113 #define _P_NOWAIT 1
673 } 674 }
674 675
675 /* When a new child process is created we need to register it in our list, 676 /* When a new child process is created we need to register it in our list,
676 so intercept spawn requests. */ 677 so intercept spawn requests. */
677 int 678 int
678 sys_spawnve (int mode, char *cmdname, char **argv, char **envp) 679 sys_spawnve (int mode, CONST char *cmdname,
680 CONST char * CONST *argv, CONST char *CONST *envp)
679 { 681 {
680 Lisp_Object program, full; 682 Lisp_Object program, full;
681 char *cmdline, *env, *parg, **targ; 683 char *cmdline, *env, *parg, **targ;
682 int arglen, numenv; 684 int arglen, numenv;
683 int pid; 685 int pid;
710 UNGCPRO; 712 UNGCPRO;
711 errno = EINVAL; 713 errno = EINVAL;
712 return -1; 714 return -1;
713 } 715 }
714 cmdname = XSTRING_DATA (full); 716 cmdname = XSTRING_DATA (full);
715 argv[0] = cmdname; 717 /* #### KLUDGE */
718 *(char**)(argv[0]) = cmdname;
716 } 719 }
717 UNGCPRO; 720 UNGCPRO;
718 721
719 /* make sure argv[0] and cmdname are both in DOS format */ 722 /* make sure argv[0] and cmdname are both in DOS format */
720 strcpy (cmdname = alloca (strlen (cmdname) + 1), argv[0]); 723 strcpy (cmdname = alloca (strlen (cmdname) + 1), argv[0]);
721 unixtodos_filename (cmdname); 724 unixtodos_filename (cmdname);
722 argv[0] = cmdname; 725 /* #### KLUDGE */
726 *(char**)(argv[0]) = cmdname;
723 727
724 /* Determine whether program is a 16-bit DOS executable, or a Win32 728 /* Determine whether program is a 16-bit DOS executable, or a Win32
725 executable that is implicitly linked to the Cygnus dll (implying it 729 executable that is implicitly linked to the Cygnus dll (implying it
726 was compiled with the Cygnus GNU toolchain and hence relies on 730 was compiled with the Cygnus GNU toolchain and hence relies on
727 cygwin.dll to parse the command line - we use this to decide how to 731 cygwin.dll to parse the command line - we use this to decide how to