branch update for HEAD-2003021201
[reactos.git] / lib / crtdll / io / write.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/crtdll/io/write.c
5  * PURPOSE:     Writes to a file
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              28/12/98: Created
9  */
10 #include <windows.h>
11 #include <msvcrt/io.h>
12
13
14
15 size_t _write(int _fd, const void *_buf, size_t _nbyte)
16 {
17    DWORD _wbyte;
18    
19    if ( !WriteFile(_get_osfhandle(_fd),_buf,_nbyte,&_wbyte,NULL) )
20    {
21       return -1;
22    }
23    return (size_t)_wbyte;
24 }