PWRITE(3PROC) Process Control Library Functions PWRITE(3PROC) NNAAMMEE PPwwrriittee - write data to the address space of a process LLIIBBRRAARRYY Process Control Library (libproc, -lproc) SSYYNNOOPPSSIISS ##iinncclluuddee <> _s_s_i_z_e___t PPwwrriittee(_s_t_r_u_c_t _p_s___p_r_o_c_h_a_n_d_l_e _*_P, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e, _u_i_n_t_p_t_r___t _a_d_d_r_e_s_s); DDEESSCCRRIIPPTTIIOONN The PPwwrriittee() function writes data from _b_u_f to the process handle _P starting at the address _a_d_d_r_e_s_s. It writes at most _n_b_y_t_e of data. The PPwwrriittee() function is logically analogous to the pwrite(2) function. For live processes, this function is equivalent to writing to the /proc file system aass 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 PPwwrriittee() function cannot be used to _e_x_t_e_n_d the size of a mapping; writing to an unmapped region generates an error. RREETTUURRNN VVAALLUUEESS Upon successful completion, the PPwwrriittee() function returns the number of bytes successfully written to _P. This number is never greater than _n_b_y_t_e. Otherwise, it returns --11 and eerrrrnnoo is set to indicate an error. For the full list of errors see the DDIIAAGGNNOOSSTTIICCSS section in proc(4) and the EERRRROORRSS section in pwrite(2). In addition, the PPwwrriittee() function will fail if: EIO _P refers to an ELF object and not a core file or active process. IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY UUnnccoommmmiitttteedd MMTT--LLEEVVEELL See LLOOCCKKIINNGG in libproc(3LIB). SSEEEE AALLSSOO pwrite(2), libproc(3LIB), proc(4) illumos May 11, 2016 illumos