long write (long fileno, const unsigned char *buf, long count) |
Writes data to the file indicated by the first parameter (fileno) from the memory area indicated by the second parameter (buf). The number of bytes to be written is indicated by the third parameter (count). |
If the device (disk, etc.) of the file to be written is full, only a number of bytes fewer than or equal to count bytes can be written. It is recommended that, if the number of bytes actually written is zero a certain number of times in succession, the disk should be judged to be full and an error (-1) should be returned. |
The position for file reading/writing advances by the number of bytes written. If writing is successful, the actual number of bytes written should be returned; if the write operation fails, -1 should be returned. |
Normal: Actual number of bytes written
fileno Number of the file to which data is to be written