home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
emacs-19.28-src.tgz
/
tar.out
/
fsf
/
emacs
/
unixlib
/
src
/
read.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-28
|
412b
|
25 lines
#include "amiga.h"
#include "files.h"
#include <fcntl.h>
#undef read
int __read(int fd, void *buffer, unsigned int length)
{
struct fileinfo *fi;
chkabort();
if (fi = _find_fd(fd))
{
if (fi->flags & FI_READ) return fi->read(fi->userinfo, buffer, length);
errno = EACCES;
}
return -1;
}
int read(int fd, void *buffer, unsigned int length)
{
return __read(fd, buffer, length);
}