Bash-Linux.com : Le SHELL pour les nuls

  Actuellement 50 lignes de commande et 1472 man disponibles
login as: root
root@213.186.33.18's password:
Last login: Wed May 30 15:32:54 2012 from 38.107.179.226
[root@bash-linux ~] # echo "Bienvenue sur Bash-Linux.com"_
 Manuel des commandes UNIX (man) Version anglaise

Indiquez la fonction :

Man Writev en anglais

READV(2) Linux Programmer's Manual READV(2)
 
NAME


readv, writev - read or write data into multiple buffers
 
SYNOPSIS


#include ssize_t readv(int fd, const struct iovec *iov, int iovcnt); ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 
DESCRIPTION


The readv() function reads iovcnt buffers from the file associated with the file descriptor fd into the buffers described by iov ("scatter input"). The writev() function writes iovcnt buffers of data described by iov to the file associated with the file descriptor fd ("gather output"). The pointer iov points to an array of iovec structures, defined in as: struct iovec { void *iov_base; /* Starting address */ size_t iov_len; /* Number of bytes to transfer */ }; 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. Buffers are processed in array order. This means that readv() com- pletely fills iov[0] before proceeding to iov[1], and so on. (If there is insufficient data, then not all buffers pointed to by iov may be filled.) Similarly, writev() writes out the entire contents of iov[0] before proceeding to iov[1], and so on. The data transfers performed by readv() and writev() are atomic: the data written by writev() is written as a single block that is not intermingled with output from writes in other processes (but see pipe(7) for an exception); analogously, readv() is guaranteed to read a contiguous block of data from the file, regardless of read operations performed in other threads or processes that have file descriptors referring to the same open file description (see open(2)).
 
RETURN VALUE


On success, the readv() function returns the number of bytes read; the writev() function returns the number of bytes written. On error, -1 is returned, and errno is set appropriately.
 
ERRORS


The errors are as given for read(2) and write(2). Additionally the following error is defined: EINVAL The sum of the iov_len values overflows an ssize_t value. Or, the vector count iovcnt is less than zero or greater than the permitted maximum.
 
CONFORMING TO


4.4BSD (the readv() and writev() functions first appeared in 4.2BSD), POSIX.1-2001. Linux libc5 used size_t as the type of the iovcnt argument, and int as return type for these functions.
 
NOTES


Linux Notes POSIX.1-2001 allows an implementation to place a limit on the number of items that can be passed in iov. An implementation can advertise its limit by defining IOV_MAX in or at run time via the return value from sysconf(_SC_IOV_MAX). On Linux, the limit advertised by these mechanisms is 1024, which is the true kernel limit. However, the glibc wrapper functions do some extra work if they detect that the underlying kernel system call failed because this limit was exceeded. In the case of readv() the wrapper function allocates a temporary buffer large enough for all of the items specified by iov, passes that buffer in a call to read(2), copies data from the buffer to the loca- tions specified by the iov_base fields of the elements of iov, and then frees the buffer. The wrapper function for writev() performs the anal- ogous task using a temporary buffer and a call to write(2).
 
BUGS


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.
 
EXAMPLE


The following code sample demonstrates the use of writev(): char *str0 = "hello "; char *str1 = "world\n"; struct iovec iov[2]; ssize_t nwritten; iov[0].iov_base = str0; iov[0].iov_len = strlen(str0); iov[1].iov_base = str1; iov[1].iov_len = strlen(str1); nwritten = writev(STDOUT_FILENO, iov, 2);
 
SEE ALSO


read(2), write(2)
 
COLOPHON


This page is part of release 3.05 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2002-10-17 READV(2)


 Dernières recherches
Man  en anglais Man writev en anglaisMan  en français Man writev en français
Man  en anglais Man wmemset en anglaisMan  en français Man wmemset en français
Man  en anglais Man wmemmove en anglaisMan  en français Man wmemmove en français
Man  en anglais Man wmemcpy en anglaisMan  en français Man wmemcpy en français
Man  en anglais Man wmemcmp en anglaisMan  en français Man wmemcmp en français
Man  en anglais Man wmemchr en anglaisMan  en français Man wmemchr en français
Man  en anglais Man whois en anglaisMan  en français Man whois en français
Man  en anglais Man whoami en anglaisMan  en français Man whoami en français
Man  en anglais Man who en anglaisMan  en français Man who en français
Man  en anglais Man which en anglaisMan  en français Man which en français
Man  en anglais Man whereis en anglaisMan  en français Man whereis en français
Man  en anglais Man wget en anglaisMan  en français Man wget en français
Man  en anglais Man wcwidth en anglaisMan  en français Man wcwidth en français
Man  en anglais Man wctype en anglaisMan  en français Man wctype en français
Man  en anglais Man wctrans en anglaisMan  en français Man wctrans en français

 Recherche

Dans ce moteur de recherche, vous pouvez taper directement votre besoin, en une phrase normale, humaine.
Exemple : vous cherchez comment remplacer un mot par un autre dans tous les fichiers d'un certain dossier. Vous pouvez écrire "Comment remplacer un mot par un autre dans tous les fichiers d'un dossier". Le moteur vous ramenera les résultats en fonction de leur pertinence.
Vous pouvez bien sûr ne chercher qu'un seul mot-clé, par exemple "find".
 Toutes les lignes de code
Par popularité
Par fonction
Recherche avancée
 Les logiciels SHELL/SSH
Putty
Astuces Bash
Faire du SHELL avec PHP!
 La doc officielle
Les man Linux en français
Les man Linux en anglais
 Proposer vos bash
Partagez vos lignes!
 Les requêtes
Déposer une requête
Voir/répondre à une requête
 Quelques sites interessants
Bons sites pour apprendre
 Rechercher