2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 POSIX.1-2008 function read().
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
15 /*****************************************************************************
28 Read an amount of bytes from a file descriptor.
31 fd - The file descriptor to read from
32 buf - The buffer to read the bytes into
33 count - Read this many bytes.
36 The number of characters read (may range from 0 when the file
37 descriptor contains no more characters to count) or -1 on error.
46 open(), read(), fread()
50 ******************************************************************************/
53 fdesc
*fdesc
= __getfdesc(fd
);
61 if(fdesc
->fcb
->privflags
& _FCB_ISDIR
)
67 cnt
= Read (fdesc
->fcb
->handle
, buf
, count
);
70 errno
= __stdc_ioerr2errno (IoErr ());