1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\" 1993 Michael Haardt, Ian Jackson.
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Modified Sat Jul 24 13:35:59 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith <faith@cs.unc.edu>
28 .\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt
29 .\" <michael@cantor.informatik.rwth-aachen.de>
30 .\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
31 .\" 中文版版权所有 byeyear AND www.linuxforum.net 2002
33 .TH WRITE 2 "13 January 1996" "Linux 2.0.32" "Linux Programmer's Manual"
35 write \-在一个文件描述符上执行写操作
37 .B #include <unistd.h>
39 .BI "ssize_t write(int " fd ", const void *" buf ", size_t " count );
50 POSIX规定,当使用了\fBwrite()\fP之后再使用
51 \fBread()\fP,那么读取到的应该是更新后的数据.
55 成功时返回所写入的字节数(若为零则表示没有写入数据).
56 错误时返回\-1,并置\fIerrno\fP为相应值.
57 若\fIcount\fP为零,对于普通文件无任何影响,但对特殊文件
63 不是一个合法的文件描述符或者没有以写方式打开.
75 连接到一个管道,或者套接字的读方向一端已关闭.此时写进程
78 信号;如果此信号被捕获,阻塞或忽略,那么将返回错误
100 SVr4, SVID, POSIX, X/OPEN, 4.3BSD.
102 EDEADLK, EFBIG, ENOLCK, ENOLNK, ENOSR,
103 ENXIO, EPIPE,或者ERANGE.
104 对于SVr4有可能在写入部分数据时发生中断并返回EINTR.
117 .B byeyear <love_my_love@263.net >
120 .SH "《中国linux论坛man手册页翻译计划》:"
121 .BI http://cmpp.linuxforum.net