*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> readv (3)              
Title
Content
Arch
Section
 

READV(3)

Contents


NAME    [Toc]    [Back]

       readv, writev - read or write data into multiple buffers

SYNOPSIS    [Toc]    [Back]

       #include <sys/uio.h>

       int readv(int filedes, const struct iovec *vector,
		 size_t count);

       int writev(int filedes, const struct iovec *vector,
		 size_t count);

DESCRIPTION    [Toc]    [Back]

       The  readv()  function reads count blocks from the file associated with
       the file descriptor filedes into the multiple buffers described by vec-
       tor.

       The  writev()  function writes at most count blocks described by vector
       to the file associated with the file descriptor filedes.

       The pointer vector points to a struct iovec defined in <sys/uio.h> as

	  struct iovec {
	      void *iov_base;	/* Starting address */
	      size_t iov_len;	/* Number of bytes */
	  };

       Buffers are processed in  the  order  vector[0],  vector[1],  ...  vec-
       tor[count].

       The  readv()  function  works  just  like  read(2) except that multiple
       buffers are filled.

       The writev() function works just like  write(2)	except	that  multiple
       buffers are written out.

RETURN VALUE    [Toc]    [Back]

       The  readv()  function  returns the number of bytes or -1 on error; the
       writev() function returns the number of bytes written.

ERRORS    [Toc]    [Back]

       The readv() and writev() functions can fail and set errno to  the  following
 values:

       EBADF  fd is not a valid file descriptor.

       EINVAL fd  is  unsuitable  for  reading	(for  readv()) or writing (for
	      writev()).

       EFAULT buf is outside the processes' address space.

       EAGAIN Non-blocking I/O had been selected in the open() call, and reading
 or writing could not be done immediately.

       EINTR  Reading  or  writing  was interrupted before any data was transferred.

CONFORMING TO    [Toc]    [Back]

       unknown

BUGS    [Toc]    [Back]

       It is not advisable to mix calls to functions like readv() or writev(),
       which  operate  on  file descriptors, with the functions from the stdio
       library; the results will be undefined and probably not what you  want.

SEE ALSO    [Toc]    [Back]

      
      
       read(2), write(2)



GNU				  1993-04-25			      READV(3)
[ Back ]
 Similar pages
Name OS Title
AFreadmisc IRIX read from / write to / move logical read/write pointer for data in a miscellaneous chunk in an audio file
tis_write_unlock Tru64 Unlocks the specified read-write lock that was acquired for write access
tis_read_unlock Tru64 Unlocks a read-write lock that was acquired for read access
tis_write_lock Tru64 Acquires the specified read-write lock for write access
pthread_rwlock_wrlock Tru64 Acquires a read-write lock for write access
pthread_rwlock_rdlock Tru64 Acquires a read-write lock for read access
tis_read_lock Tru64 Acquires a read-write lock for read access
tis_read_trylock Tru64 Attempts to acquire a read-write lock for read access and does not wait if the lock cannot be immedi...
set IRIX Read and write variables
readv Linux read or write a vector
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service