This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Write into a file without changing the file pointer
#include <unistd.h> ssize_t pwrite( int filedes, const void* buff, size_t nbytes, off_t offset ); ssize_t pwrite64( int filedes, const void* buff, size_t nbytes, off64_t offset );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pwrite() function performs the same action as write(), except that it writes into a given position without changing the file pointer.
The pwrite64() function is a 64-bit version of pwrite().
The number of bytes actually written, or -1 if an error occurred (errno is set).
pwrite() is POSIX 1003.1 XSI; pwrite64() is Large-file support
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
close(), creat(), dup(), dup2(), errno, fcntl(), lseek(), open(), pipe(), pread(), read(), readv(), select(), write(), writev()