mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Added __set_errno to file.h
svn path=/trunk/; revision=331
This commit is contained in:
parent
b3c424cd40
commit
150a9789e6
3 changed files with 37 additions and 5 deletions
|
@ -26,11 +26,7 @@ extern "C" {
|
|||
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */
|
||||
#endif
|
||||
|
||||
int _flsbuf(int, FILE*);
|
||||
int _filbuf(FILE *);
|
||||
void _fwalk(void (*)(FILE *));
|
||||
|
||||
|
||||
int __set_errno(int err);
|
||||
|
||||
char __is_text_file(FILE *p);
|
||||
|
||||
|
|
20
reactos/lib/crtdll/process/_cwait.c
Normal file
20
reactos/lib/crtdll/process/_cwait.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <process.h>
|
||||
#include <windows.h>
|
||||
|
||||
int _cwait( int *termstat, int procHandle, int action )
|
||||
{
|
||||
DWORD RetVal;
|
||||
RetVal = WaitForSingleObject((HANDLE)procHandle, INFINITE);
|
||||
if (RetVal == WAIT_FAILED || RetVal == WAIT_ABANDONED) {
|
||||
//errno = ECHILD;
|
||||
return -1;
|
||||
}
|
||||
if ( RetVal == WAIT_OBJECT_0 ) {
|
||||
GetExitCodeProcess((HANDLE)procHandle, termstat);
|
||||
return procHandle;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
// WAIT_TIMEOUT
|
||||
}
|
16
reactos/lib/crtdll/process/_system.c
Normal file
16
reactos/lib/crtdll/process/_system.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include <process.h>
|
||||
#include <windows.h>
|
||||
|
||||
int system(const char *command)
|
||||
{
|
||||
char CmdLine[MAX_PATH];
|
||||
char *comspec = getenv("COMSPEC");
|
||||
if ( comspec == NULL )
|
||||
comspec = "cmd.exe";
|
||||
strcpy(CmdLine,comspec);
|
||||
strcat(CmdLine," /C ");
|
||||
if ( !WinExec(CmdLine,SW_SHOWNORMAL) < 31 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue