BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
kread - read input from a transport descriptor
LIBRARY CALL
ssize_t kread(
int id,
kaddr buf,
size_t nbytes)
INPUT
- id - the file id to be read which was opened earlier
with kopen().
- buf - the buffer to read the data into
- nbytes - the number of bytes to be read
OUTPUT
none
RETURN VALUE
the number of bytes read, 0 when end
of file is encountered, or -1 when an error
is encountered.
DESCRIPTION
This function is a replacement for the system "read"
call. The only difference is that kread() supports
more than just files, it supports other data transports
as well, such as shared memory, pipes, files, etc.
The routine will read nbytes into the character array
"buf". If not all nbytes can be read then the kread()
routine returns the number of bytes actually read.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/ktransport.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.