1 PWRITE(3PROC) Process Control Library Functions PWRITE(3PROC) 2 3 NAME 4 Pwrite - write data to the address space of a process 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 ssize_t 13 Pwrite(struct ps_prochandle *P, const void *buf, size_t nbyte, 14 uintptr_t address); 15 16 DESCRIPTION 17 The Pwrite() function writes data from buf to the process handle P 18 starting at the address address. It writes at most nbyte of data. The 19 Pwrite() function is logically analogous to the pwrite(2) function. 20 21 For live processes, this function is equivalent to writing to the /proc 22 file system as file for the process. For core files, it writes to the 23 logical address space of what was once the process and not the 24 corresponding offset in the on-disk file. ELF objects grabbed through 25 Pgrab_file(3PROC) do not support being written to. 26 27 The Pwrite() function cannot be used to extend the size of a mapping; 28 writing to an unmapped region generates an error. 29 30 RETURN VALUES 31 Upon successful completion, the Pwrite() function returns the number of 32 bytes successfully written to P. This number is never greater than 33 nbyte. Otherwise, it returns -1 and errno is set to indicate an error. 34 For the full list of errors see the DIAGNOSTICS section in proc(4) and 35 the ERRORS section in pwrite(2). 36 37 In addition, the Pwrite() function will fail if: 38 39 EIO P refers to an ELF object and not a core file or 40 active process. 41 42 INTERFACE STABILITY 43 Uncommitted 44 45 MT-LEVEL 46 See LOCKING in libproc(3LIB). 47 48 SEE ALSO 49 pwrite(2), libproc(3LIB), proc(4) 50 51 illumos May 11, 2016 illumos