Specifications
Include
<unistd.h>
Description
The write() function writes a block of data to a file or device. write() is wrapper function that passes
control directly to the write() function registered for the device driver associated with the file descriptor
fd. The input argument ptr is the data to write and len is the length of the data in bytes.
Calls to write() are thread-safe only if the implementation of write() provided by the driver that is
manipulated is thread-safe.
Valid values for the fd parameter are: stdout, stdin, and stderr, or any value returned from a call to
open().
Return
The return argument is the number of bytes written, which might be less than the requested length.
The return value is –1 upon an error. In the event of an error, errno is set to indicate the cause.
Related Information
• fcntl() on page 14-57
• fstat() on page 14-55
• ioctl() on page 14-73
• isatty() on page 14-74
• lseek() on page 14-64
• open() on page 14-66
• read() on page 14-68
• stat() on page 14-60
• newlib Library Documentation
usleep()
Prototype
int usleep (unsigned int us)
Commonly Called By
C/C++ programs
Device drivers
Thread-safe
Yes.
Available from ISR
No.
14-70
usleep()
NII5V2
2015.05.14
Altera Corporation
HAL API Reference
Send Feedback