:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / crtdll / io / read.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/crtdll/io/read.c
5  * PURPOSE:     Reads a file
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              28/12/98: Created
9  */
10 #include <crtdll/io.h>
11 #include <windows.h>
12
13 size_t  _read(int _fd, void *_buf, size_t _nbyte)
14 {
15    DWORD _rbyte;
16    
17    if (!ReadFile(_get_osfhandle(_fd),_buf,_nbyte,&_rbyte,NULL))
18      {
19         return -1;
20      }
21    return (size_t)_rbyte;
22 }