PSTOPSTATUS(3PROC) Process Control Library Functions PSTOPSTATUS(3PROC) NNAAMMEE PPddssttoopp, PPssttooppssttaattuuss, PPssttoopp, PPwwaaiitt, LLddssttoopp, LLssttoopp, LLwwaaiitt - process and thread stop operations LLIIBBRRAARRYY Process Control Library (libproc, -lproc) SSYYNNOOPPSSIISS ##iinncclluuddee <> _i_n_t PPddssttoopp(_s_t_r_u_c_t _p_s___p_r_o_c_h_a_n_d_l_e _*_P); _i_n_t PPssttooppssttaattuuss(_s_t_r_u_c_t _p_s___p_r_o_c_h_a_n_d_l_e _*_P, _l_o_n_g _r_e_q_u_e_s_t, _u_i_n_t___t _m_s_e_c); _i_n_t PPssttoopp(_s_t_r_u_c_t _p_s___p_r_o_c_h_a_n_d_l_e _*_P); _i_n_t PPwwaaiitt(_s_t_r_u_c_t _p_s___p_r_o_c_h_a_n_d_l_e _*_P); _i_n_t LLddssttoopp(_s_t_r_u_c_t _p_s___l_w_p_h_a_n_d_l_e _*_L); _i_n_t LLssttoopp(_s_t_r_u_c_t _p_s___l_w_p_h_a_n_d_l_e _*_L); _i_n_t LLwwaaiitt(_s_t_r_u_c_t _p_s___l_w_p_h_a_n_d_l_e _*_L); DDEESSCCRRIIPPTTIIOONN The PPssttooppssttaattuuss() function allows the caller to stop and optionally wait for the process handle referred to by _P to be stopped. Stopping a process causes all of its threads to stop execution. Where in their execution the threads will halt is not defined. Threads may be resumed with Psetrun(3PROC) and prun(1). The _r_e_q_u_e_s_t argument should be one of the following symbols: PCSTOP Stop the process; wait for completion before returning. PCDSTOP Stop the process; do not wait for completion before returning. That is, the stopping of the process is performed asynchronously in relation to the caller. PCWSTOP Do not direct the process to stop; simply wait for it to stop. PCNULL Do not direct the process to stop; simply refreshes the state of the process. Both the PCSTOP and PCWSTOP requests allow an upper bound on the amount of time to wait for the process to stop. The _m_s_e_c argument indicates the number of milliseconds to wait for the stop to complete. If the value of _m_s_e_c is 00, then it will wait forever. Callers should pass 00 for _m_s_e_c when the request is PCDSTOP or PCNULL. When a non-zero timeout is specified, the process may or may not be stopped upon return. The return value does not reflect the current state of the process. For example, if the timeout expires during a _P_C_W_S_T_O_P request, the return value will be 00 regardless of the actual state of the process. Only active processes may be stopped. Handles that refer to core files, zombie processes, or files cannot be used; unless the value of _r_e_q_u_e_s_t is set to PCNULL. The PPssttoopp() function is is equivalent to calling the PPssttooppssttaattuuss() function with the request set to PCSTOP and an infinite timeout. The PPwwaaiitt() function is is equivalent to calling the PPssttooppssttaattuuss() function with the request set to PCWSTOP and an infinite timeout. The PPddssttoopp() function is is equivalent to calling the PPssttooppssttaattuuss() function with the request set to PCDSTOP. The LLddssttoopp(), LLssttoopp(), and LLwwaaiitt() functions are equivalent to the PPddssttoopp(), PPssttoopp(), and PPwwaaiitt() functions, respectively. Except, rather than operating on a process, they operate on the thread handle _L. A call to LLssttoopp() stops only a single thread; whereas PPssttoopp() stops every thread in the process. RREETTUURRNN VVAALLUUEESS Upon successful completion, the PPddssttoopp(), PPssttooppssttaattuuss(), PPssttoopp(), PPwwaaiitt(), LLddssttoopp(), LLssttoopp(), and LLwwaaiitt() functions return 00. Otherwise, --11 is returned and errno is set to indicate the error that occurred. EERRRROORRSS For a full list of possible errors see the DDIIAAGGNNOOSSTTIICCSS section in proc(4). The PPddssttoopp(), PPssttooppssttaattuuss(), PPssttoopp(), PPwwaaiitt(), LLddssttoopp(), LLssttoopp(), and LLwwaaiitt() functions will fail if: EAGAIN Control over the handle _P was lost. Callers should call Preopen(3PROC). For more information on losing control, see PPRROOGGRRAAMMMMIINNGG NNOOTTEESS in proc(4). ENOENT The request was not PCNULL and the process handle _P does not refer to an active process, but refers to a core file, a zombie process, or a file. EINVAL _r_e_q_u_e_s_t is not valid or the process is in an unknown state. EPROTO A fatal protocol error occurred and the process could not be stopped. IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY UUnnccoommmmiitttteedd MMTT--LLEEVVEELL See LLOOCCKKIINNGG in libproc(3LIB). SSEEEE AALLSSOO libproc(3LIB), Lgrab(3PROC), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC), Pgrab_file(3PROC), proc(4) illumos May 11, 2016 illumos