OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [doc/] [read.html] - Blame information for rev 565

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
<html>
2
<body>
3
<pre>
4
NAME
5
       read - read from a file descriptor
6
 
7
SYNOPSIS
8
       ssize_t read(int fd, void *buf, size_t count);
9
 
10
DESCRIPTION
11
       read()  attempts  to  read  up  to  count  bytes from file
12
       descriptor fd into the buffer starting at buf.
13
 
14
       If count is zero, read() returns zero  and  has  no  other
15
       results.
16
 
17
 
18
RETURN VALUE
19
       On success, the number of bytes  read  is  returned  (zero
20
       indicates  end of file), and the file position is advanced
21
       by this number.  It is not an  error  if  this  number  is
22
       smaller  than the number of bytes requested; this may hap-
23
       pen for example because fewer bytes are actually available
24
       right  now (maybe because we were close to end-of-file, or
25
       because we are reading from a pipe, or from  a  terminal),
26
       or  because read() was interrupted by a signal.  On error,
27
       -1 is returned, and errno is set  appropriately.  In  this
28
       case  it is left unspecified whether the file position (if
29
       any) changes.
30
 
31
ERRORS
32
       EINTR   The call was interrupted by a  signal  before  any
33
               data was read.
34
 
35
       EAGAIN  Non-blocking  I/O  has  been selected using O_NON-
36
               BLOCK and no data was  immediately  available  for
37
               reading.
38
 
39
       EIO     I/O  error.  This will happen for example when the
40
               process is in a background process group, tries to
41
               read  from  its  controlling tty, and either it is
42
               ignoring or blocking SIGTTIN or its process  group
43
               is  orphaned.   It  may also occur when there is a
44
               low-level I/O error while reading from a  disk  or
45
               tape.
46
 
47
       EISDIR  fd refers to a directory.
48
 
49
       EBADF   fd  is  not a valid file descriptor or is not open
50
               for reading.
51
 
52
       EINVAL  fd is attached to an object  which  is  unsuitable
53
               for reading.
54
 
55
       Other  errors may occur, depending on the object connected
56
       to fd.  POSIX allows a  read  that  is  interrupted  after
57
       reading  some  data to return -1 (with errno set to EINTR)
58
       or to return the number of bytes already read.
59
</pre>
60
</body>
61
</html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.