.\" -*- nroof -*- .\" 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. .\" .TH PREAD 2 "21/01/1999" "Linux 2.2.0-pre9" "Manual do Programador Linux" .SH NOME pread, pwrite \- lê a partir de ou escreve para um descritor de arquivo em um dado offset .SH SINOPSE .B #define _XOPEN_SOURCE 500 .sp .B #include .sp .BI "ssize_t pread(int " fd ", void *" buf ", size_t " count ", off_t " offset ); .sp .BI "ssize_t pwrite(int " fd ", const void *" buf ", size_t " count ", off_t " offset ); .fi .SH DESCRIÇÃO .B pread() faz a leitura dos bytes .I count a partir do descritor de arquivos .I fd em offset .I offset (a partir do início do arquivo) para o interior do buffer iniciando em .IR buf . O arquivo offset não é alterado. .PP .B pwrite() faz a escrita dos bytes .I count bytes from the buffer starting at .I buf a partir do descritor de arquivos .I fd em offset .IR offset . O arquivo offset não é alterado. .PP O arquivo referenciado por .I fd deve ser capaz de ser procurado. .SH "VALORES RETORNADOS" Em caso de sucesso, o número de bytes lidos ou escritos é retornado (zero indica que nada for escrito, no caso de \fBpwrite\fR, ou final de arquivo, no caso de \fBpread\fR), ou \-1 em caso de erro, em cada caso .I errno é selecionada para indicar o erro. .SH ERROS .B pread pode falhar e selecionar .I errno para qualquer erro especificado por \fBread\fR(2) ou \fBlseek\fR(2). .B pwrite pode falhar e selecionar .I errno para qualquer erro especificado por \fBwrite\fR(2) ou \fBlseek\fR(2). .SH "DE ACORDO DE" Unix98 .SH HISTÓRIA As chamadas de sistema \fBpread\fR e \fBpwrite\fR foram adicionadas no Linux na versão 2.1.60; as entradas nas tabelas das chamadas de sistemas i386 foram adicionadas na versão 2.1.69. O suporte na libc support (incluindo emulaçao para kerneis antigos sem chamadas de sistema) foram adicionadas na glibc 2.1. .SH "VEJA TAMBÉM" .BR read (2), .BR write (2), .BR lseek (2) .SH TRADUZIDO POR LDP-BR em 21/08/2000. \&\fR\&\f(CWAndré L. Fassone Canova (tradução)\fR \&\fR\&\f(CWxxxxxxxxxxxxxxxxxxxxxxxxx (revisão)\fR