File: write.2

package info (click to toggle)
manpages-es 0.4a-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 3,592 kB
  • ctags: 3
  • sloc: sh: 59; makefile: 42
file content (110 lines) | stat: -rw-r--r-- 4,179 bytes parent folder | download
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
.\"                               1993 Michael Haardt, Ian Jackson.
.\"
.\" 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.
.\"
.\" Modified Sat Jul 24 13:35:59 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt
.\"   <michael@cantor.informatik.rwth-aachen.de>
.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
.\" Translated  into Spanish Mon Feb 9 1998 by Gerardo Aburruzaga
.\" Garca <gerardo.aburruzaga@uca.es>
.\"
.TH WRITE 2 "9 Febrero 1998" "Linux" "Llamadas al sistema"
.SH NOMBRE
write \- escribe a un descriptor de fichero
.SH SINOPSIS
.B #include <unistd.h>
.sp
.BI "ssize_t write(int " fd ", const void *" buf ", size_t " num );
.SH DESCRIPCIN
.B write
escribe hasta
.I num
bytes en el fichero referenciado por el descriptor de fichero
.I fd
desde el bfer que comienza en
.I buf.
POSIX requiere que un \fBread()\fP que pueda demostrarse que ocurra
despus que un
\fBwrite()\fP haya regresado, devuelva los nuevos datos. Observe que
no todos los sistemas de ficheros son conformes con POSIX.
.SH "VALOR DEVUELTO"
En caso de xito, se devuelve el nmero de bytes escritos (cero indica
pues que no se ha escrito nada). En caso de error, se devuelve \-1 y
se pone un valor apropiado en \fIerrno\fP. Si \fInum\fP es cero y el
descriptor de fichero se refiere a un fichero regular, se devolver 0
sin que se cause ningn otro efecto. Para un fichero especial, los
resultados no son transportables. 
.SH ERRORES
.IP \fBEBADF\fP
.I fd
no es un descriptor vlido de fichero o no est abierto para escritura.
.IP \fBEINVAL\fP
.I fd
est asociado a un objeto que no es adecuado para la escritura.
.IP \fBEFAULT\fP
.I buf
est afuera del espacio de direcciones accesible.
.IP \fBEPIPE\fP
.I fd
est conectado a una tubera o zcalo cuyo extremo de lectura est
cerrado. Cuando esto ocurre el proceso de escritura recibir una seal 
.BR SIGPIPE ;
si la captura, bloquea o no tiene en cuenta, se devuelve el error
.BR EPIPE .
.IP \fBEAGAIN\fP
Se ha seleccionado E/S no bloqueante empleando
.B O_NONBLOCK
y no haba sitio en la tubera o zcalo conectado a
.I fd
para escribir los datos inmediatamente.
.IP \fBEINTR\fP
La llamada ha sido interrumpida por una seal antes de que se haya
escrito ningn dato.
.IP \fBENOSPC\fP
El dispositivo que contiene al fichero referenciado por
.I fd
no tiene sitio para los datos.
.IP \fBEIO\fP
Ha ocurrido un error de E/S de bajo nivel mientras se estaba
modificando el nodo-.
.PP
Pueden ocurrir otros errores, dependiendo del objeto conectado a
.IR fd .
.SH "CONFORME CON"
SVr4, SVID, POSIX, X/OPEN, 4.3BSD.  SVr4 documenta condiciones de error
adicionales EDEADLK, EFBIG, ENOLCK, ENOLNK, ENOSR, ENXIO, EPIPE, o ERANGE.
En SVr4 una escritura puede ser interrumpida y devolver EINTR en
cualquier momento, no slo justo antes de que se escriba algn dato.
.SH "VASE TAMBIN"
.BR open (2),
.BR read (2),
.BR fcntl (2),
.BR close (2),
.BR lseek (2),
.BR select (2),
.BR ioctl (2),
.BR fsync (2),
.BR fwrite (3).