PWRITE(3PROC) Process Control Library Functions PWRITE(3PROC)

NAME


Pwrite - write data to the address space of a process

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

ssize_t
Pwrite(struct ps_prochandle *P, const void *buf, size_t nbyte,
uintptr_t address);

DESCRIPTION


The Pwrite() function writes data from buf to the process handle P starting
at the address address. It writes at most nbyte of data. The Pwrite()
function is logically analogous to the pwrite(2) function.

For live processes, this function is equivalent to writing to the /proc
file system as file for the process. For core files, it writes to the
logical address space of what was once the process and not the
corresponding offset in the on-disk file. ELF objects grabbed through
Pgrab_file(3PROC) do not support being written to.

The Pwrite() function cannot be used to extend the size of a mapping;
writing to an unmapped region generates an error.

RETURN VALUES


Upon successful completion, the Pwrite() function returns the number of
bytes successfully written to P. This number is never greater than nbyte.
Otherwise, it returns -1 and errno is set to indicate an error. For the
full list of errors see the DIAGNOSTICS section in proc(5) and the ERRORS
section in pwrite(2).

In addition, the Pwrite() function will fail if:

EIO P refers to an ELF object and not a core file or active
process.

INTERFACE STABILITY


Uncommitted

MT-LEVEL
See LOCKING in libproc(3LIB).

SEE ALSO


pwrite(2), libproc(3LIB), proc(5)

illumos May 11, 2016 illumos