.\" -*- coding: UTF-8 -*- .\" Copyright (C) 1999 Joseph Samuel Myers. .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH pread 2 "30 Marzo 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE pread, pwrite \- leen o escriben en una determinada posición de un descriptor de archivo .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBssize_t pread(int \fP\fIfd\fP\fB, void \fP\fIbuf\fP\fB[.\fP\fIcount\fP\fB], size_t \fP\fIcount\fP\fB,\fP \fB off_t \fP\fIoffset\fP\fB);\fP \fBssize_t pwrite(int \fP\fIfd\fP\fB, const void \fP\fIbuf\fP\fB[.\fP\fIcount\fP\fB], size_t \fP\fIcount\fP\fB,\fP \fB off_t \fP\fIoffset\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBpread\fP(), \fBpwrite\fP(): .nf _XOPEN_SOURCE >= 500 || /* Desde glibc 2.12: */ _POSIX_C_SOURCE >= 200809L .fi .SH DESCRIPCIÓN \fBpread\fP() lee hasta \fIcount\fP bytes del descriptor de fichero \fIfd\fP a partir de la posición \fIoffset\fP (desde el principio del fichero) en el área temporal que empieza en \fIbuf\fP. La posición del puntero de L/E del fichero no cambia. .PP \fBpwrite\fP() escribe hasta \fIcount\fP bytes desde el buffer que empieza en \fIbuf\fP al descriptor de fichero \fIfd\fP a partir de la posición \fIoffset\fP. La posición del puntero del fichero no cambia. .PP Debe ser posible realizar búsquedas sobre el fichero referenciado por \fIfd\fP. .SH "VALOR DEVUELTO" On success, \fBpread\fP() returns the number of bytes read (a return of zero indicates end of file) and \fBpwrite\fP() returns the number of bytes written. .PP Note that it is not an error for a successful call to transfer fewer bytes than requested (see \fBread\fP(2) and \fBwrite\fP(2)). .PP En caso de error se devuelve \-1, y \fIerrno\fP se define con el valor correspondiente. .SH ERRORES \fBpread\fP() puede fallar y asignar a \fIerrno\fP cualquier error especificado por \fBread\fP(2) o \fBlseek\fP(2). \fBpwrite\fP() puede fallar y asignar a \fIerrno\fP cualquier error especificado por \fBwrite\fP(2) o \fBlseek\fP(2). .SH ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001. .PP Added in Linux 2.1.60; the entries in the i386 system call table were added in Linux 2.1.69. C library support (including emulation using \fBlseek\fP(2) on older kernels without the system calls) was added in glibc 2.1. .SS "Diferencias núcleo / biblioteca C" On Linux, the underlying system calls were renamed in Linux 2.6: \fBpread\fP() became \fBpread64\fP(), and \fBpwrite\fP() became \fBpwrite64\fP(). The system call numbers remained the same. The glibc \fBpread\fP() and \fBpwrite\fP() wrapper functions transparently deal with the change. .PP On some 32\-bit architectures, the calling signature for these system calls differ, for the reasons described in \fBsyscall\fP(2). .SH NOTAS The \fBpread\fP() and \fBpwrite\fP() system calls are especially useful in multithreaded applications. They allow multiple threads to perform I/O on the same file descriptor without being affected by changes to the file offset by other threads. .SH ERRORES .\" FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=43178 POSIX requires that opening a file with the \fBO_APPEND\fP flag should have no effect on the location at which \fBpwrite\fP() writes data. However, on Linux, if a file is opened with \fBO_APPEND\fP, \fBpwrite\fP() appends data to the end of the file, regardless of the value of \fIoffset\fP. .SH "VÉASE TAMBIÉN" \fBlseek\fP(2), \fBread\fP(2), \fBreadv\fP(2), \fBwrite\fP(2) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Juan Piernas y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .