Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>write</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
write
=====

Syntax
------

     #include <unistd.h>
     
     int write(int file, const void *buffer, unsigned count);

Description
-----------

This function writes COUNT bytes from BUFFER to FILE.  It returns the
number of bytes actually written.  It will return zero if the disk is
full, and may return less than COUNT even under valid conditions.

Note that if FILE is a text file, `write' may write more bytes than it
reports.

If COUNT is zero, the function does nothing and returns zero.  Use
_write if you want to actually ask dos to write zero bytes.

Return Value
------------

The number of bytes written, zero at EOF, or -1 on error.

Example
-------

     write(fd, "hello", 5);


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson