Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
write(2)
Edit
PageHistory
Diff
Info
LikePages
WRITE !!!WRITE NAME SYNOPSIS DESCRIPTION RETURN VALUE ERRORS CONFORMING TO SEE ALSO ---- !!NAME write - write to a file descriptor !!SYNOPSIS __#include __ __ssize_t write(int__ ''fd''__, const void *__''buf''__, size_t__ ''count''__);__ !!DESCRIPTION __write__ writes up to ''count'' bytes to the file referenced by the file descriptor ''fd'' from the buffer starting at ''buf.'' POSIX requires that a __read()__ which can be proved to occur after a __write()__ has returned returns the new data. Note that not all file systems are POSIX conforming. !!RETURN VALUE On success, the number of bytes written are returned (zero indicates nothing was written). On error, -1 is returned, and ''errno'' is set appropriately. If ''count'' is zero and the file descriptor refers to a regular file, 0 will be returned without causing any other effect. For a special file, the results are not portable. !!ERRORS __EBADF__ ''fd'' is not a valid file descriptor or is not open for writing. __EINVAL__ ''fd'' is attached to an object which is unsuitable for writing. __EFAULT__ ''buf'' is outside your accessible address space. __EFBIG__ An attempt was made to write a file that exceeds the implementation-defined maximum file size or the process' file size limit, or to write at a position past than the maximum allowed offset. __EPIPE__ ''fd'' is connected to a pipe or socket whose reading end is closed. When this happens the writing process will receive a __SIGPIPE__ signal; if it catches, blocks or ignores this the error __EPIPE__ is returned. __EAGAIN__ Non-blocking I/O has been selected using __O_NONBLOCK__ and the write would block. __EINTR__ The call was interrupted by a signal before any data was written. __ENOSPC__ The device containing the file referred to by ''fd'' has no room for the data. __EIO__ A low-level I/O error occurred while modifying the inode. Other errors may occur, depending on the object connected to ''fd''. !!CONFORMING TO SVr4, SVID, POSIX, X/OPEN, 4.3BSD. SVr4 documents additional error conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, EPIPE, or ERANGE. Under SVr4 a write may be interrupted and return EINTR at any point, not just before any data is written. !!SEE ALSO open(2), read(2), fcntl(2), close(2), lseek(2), select(2), ioctl(2), fsync(2), fwrite(3) ----
59 pages link to
write(2)
:
ECONNRESET
pread(2)
udp(7)
perlfunc(1)
rmt(8)
Man2w
NetworkFileSystem
_newselect(2)
fcntl(2)
db(3)
dbopen(3)
fclose(3)
fflush(3)
fgetc(3)
fputc(3)
fputs(3)
fread(3)
getc(3)
getchar(3)
gets(3)
hosts_options(5)
mkfifo(3)
socket(2)
mpool(3)
pipe(2)
putc(3)
putchar(3)
puts(3)
readv(3)
sendto(2)
socket(7)
stat(2)
stdio(3)
socketpair(2)
strace(1)
syscalls(2)
ungetc(3)
lstat(2)
writev(3)
close(2)
fdatasync(2)
creat(2)
VirtualMemory
fstat(2)
EBADFD
fgets(3)
mknod(2)
open(2)
read(2)
readv(2)
writev(2)
sendmsg(2)
pselect(2)
fwrite(3)
select(2)
NetworkProgrammingOld
EDESTADDRREQ
PostgreSQLNotes
send(2)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.