home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / write.txh < prev   
Encoding:
Text File  |  1995-07-10  |  803 b   |  33 lines

  1. @node write, io
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <unistd.h>
  6.  
  7. int write(int file, const void *buffer, unsigned count);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function writes @var{count} bytes from @var{buffer} to
  13. @var{file}.  It returns the number of bytes actually written.  It will
  14. return zero if the disk is full, and may return less than @var{count}
  15. even under valid conditions.
  16.  
  17. Note that if @var{file} is a text file, @code{write} may write more
  18. bytes than it reports. 
  19.  
  20. If @var{count} is zero, the function does nothing and returns zero.
  21. Use _write if you want to actually ask dos to write zero bytes.
  22.  
  23. @subheading Return Value
  24.  
  25. The number of bytes written, zero at EOF, or -1 on error.
  26.  
  27. @subheading Example
  28.  
  29. @example
  30. write(fd, "hello", 5);
  31. @end example
  32.  
  33.