4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/unistd/read.c
7 * PURPOSE: Read from a file
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
13 #include <ddk/ntddk.h>
15 #include <sys/types.h>
17 ssize_t
read(int fildes
, void *buf
, size_t nbyte
)
21 ssize_t
pread(int fildes
, void *buf
, size_t nbyte
, off_t offset
)
25 IO_STATUS_BLOCK isbStatus
;
27 /* get the file handle for the specified file descriptor */
28 if(fcntl(fildes
, F_GETFH
, &hFile
) == -1)
31 /* read data from file */
41 (PLARGE_INTEGER
)&off_t
,
45 return ((ssize_t
)isbStatus
.Information
);