Performs a write operation on an open file with arguments passed.
#include <sys/types.h> #include <sys/errno.h> int fp_write (fp, buf, nbytes, ext, seg, countp) struct file * fp; char * buf; ssize_t nbytes, ext_t ext; int seg; ssize_t * countp;
Item | Description |
---|---|
fp | Points to a file structure returned by the fp_open or fp_opendev kernel service. |
buf | Points to the buffer where data to be written to a file is located. |
nbytes | Indicates the number of bytes to be written to the file. |
ext | Specifies an extension argument required by some device drivers. Its content, form, and use are determined by the individual driver. |
seg | Indicates in which part of memory the buffer specified by
the buf parameter is located:
|
countp | Points to the location where count of bytes actually written to the file is to be returned. |
The fp_write kernel service is an internal interface to the function provided by the write subroutine.
The fp_write kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful operation. |
ERRNO | Returns an error number from the /usr/include/sys/errno.h file on failure. |