1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
.\" Copyright (C) 1999 Joseph Samuel Myers.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Traduction 12/11/1999 Christophe BLAESS (ccb@club-internet.fr)
.\" LDP man-pages 1.24
.\" MJ 18/07/2003 LDP man-pages 1.56
.TH PREAD 2 "18 juillet 2003" LDP "Manuel du programmeur Linux"
.SH NOM
pread, pwrite \- Lire ou crire une position donne d'un descripteur de fichier.
.SH SYNOPSIS
.B #define _XOPEN_SOURCE 500
.sp
.B #include <unistd.h>
.sp
.BI "ssize_t pread(int " fd ", void *" buf ", size_t " nombre ", off_t " position );
.sp
.BI "ssize_t pwrite(int " fd ", const void *" buf ", size_t " nombre ", off_t " position );
.fi
.SH DESCRIPTION
.B pread()
lit au maximum le
.I nombre
indiqu d'octets depuis le descripteur
.IR fd ,
la
.I position
mesure depuis le dbut du fichier, et les place dans la zone commenant l'adresse
.IR buf .
La position de la tte de lecture du fichier n'est pas modifie par cet appel-systme.
.PP
.B pwrite()
lit au maximum le
.I nombre
indiqu d'octets dans la zone mmoire pointe par
.IR buf ,
et les crit la
.I position
(mesure depuis le dbut du fichier)
dans le descripteur
.IR fd .
La position de la tte d'criture du fichier n'est pas modifie.
.PP
Dans les deux cas, le fichier dcrit par
.I fd
doit permettre le positionnement.
.SH VALEUR RENVOYE
S'ils russissent, ces appels systmes renvoient le nombre d'octets lus
ou crits (0 indiquant que rien n'a t crit dans le cas de \fBpwrite\fR, ou
la fin du fichier dans le cas de \fBpread\fR).
En cas d'chec, ils renvoient \-1, et remplissent la variable globale
.I errno
en consquence.
.SH ERREURS
.B pread
peut chouer et fournir dans
.I errno
n'importe quelle erreur indique par \fBread\fR(2) ou \fBlseek\fR(2).
.B pwrite
peut chouer et fournir dans
.I errno
n'importe quelle erreur indique par \fBwrite\fR(2) ou \fBlseek\fR(2).
.SH "CONFORMIT"
Unix98
.SH HISTORIQUE
Les appels systmes \fBpread\fR et \fBpwrite\fR ont t ajouts dans le
noyau Linux 2.1.60. Les points d'entre dans la table des appels i386
furent instaurs dans la version 2.1.69. Le support par la bibliothque C,
y compris l'mulation sur les anciens noyaux sans ces appels systmes, fut
ajout dans la GlibC 2.1.
.SH "VOIR AUSSI"
.BR read (2),
.BR write (2),
.BR lseek (2)
.SH TRADUCTION
Christophe Blaess, 1996-2003.
|