diff --git a/reactos/include/libc/file.h b/reactos/include/libc/file.h index 53fa157b6ae..c27d89c71af 100644 --- a/reactos/include/libc/file.h +++ b/reactos/include/libc/file.h @@ -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); diff --git a/reactos/lib/crtdll/process/_cwait.c b/reactos/lib/crtdll/process/_cwait.c new file mode 100644 index 00000000000..e7fdb2268a3 --- /dev/null +++ b/reactos/lib/crtdll/process/_cwait.c @@ -0,0 +1,20 @@ +#include +#include + +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 +} diff --git a/reactos/lib/crtdll/process/_system.c b/reactos/lib/crtdll/process/_system.c new file mode 100644 index 00000000000..f8c9bada2fa --- /dev/null +++ b/reactos/lib/crtdll/process/_system.c @@ -0,0 +1,16 @@ +#include +#include + +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; +}