update for HEAD-2003021201
[reactos.git] / lib / crtdll / process / thread.c
1 /* $Id$
2  *
3  */
4 #include <windows.h>
5 #include <msvcrt/errno.h>
6 #include <msvcrt/process.h>
7 #include <msvcrt/internal/file.h>
8
9
10 unsigned long _beginthread(
11     void (*pfuncStart)(void*),
12         unsigned unStackSize,
13     void* pArgList)
14 {
15         DWORD  ThreadId;
16         HANDLE hThread;
17         if (  pfuncStart == NULL )
18                 __set_errno(EINVAL);
19
20         hThread = CreateThread( NULL,unStackSize,(LPTHREAD_START_ROUTINE)pfuncStart,pArgList,0, &ThreadId);
21         if (hThread == NULL ) {
22                 __set_errno(EAGAIN);
23                 return -1;
24         }
25         return (unsigned long)hThread;
26 }
27
28 void    _endthread(void)
29 {
30         //fixme ExitThread
31         //ExitThread(0);
32         for(;;);
33 }