1.\" 2.\" This file and its contents are supplied under the terms of the 3.\" Common Development and Distribution License ("CDDL"), version 1.0. 4.\" You may only use this file in accordance with the terms of version 5.\" 1.0 of the CDDL. 6.\" 7.\" A full copy of the text of the CDDL should have accompanied this 8.\" source. A copy of the CDDL is also available via the Internet at 9.\" http://www.illumos.org/license/CDDL. 10.\" 11.\" 12.\" Copyright 2015 Joyent, Inc. 13.\" 14.Dd May 11, 2016 15.Dt PR_SETRLIMIT 3PROC 16.Os 17.Sh NAME 18.Nm pr_setrlimit , 19.Nm pr_setrlimit64 20.Nd inject setrlimit system call into victim process 21.Sh SYNOPSIS 22.Lb libproc 23.In libproc.h 24.Ft int 25.Fo pr_setrlimit 26.Fa "struct ps_prochandle *P" 27.Fa "int resource" 28.Fa "const struct rlimit *rlp" 29.Fc 30.Ft int 31.Fo pr_setrlimit64 32.Fa "struct ps_prochandle *P" 33.Fa "int resource" 34.Fa "struct rlimit64 *rlp" 35.Fc 36.Sh DESCRIPTION 37The 38.Fn pr_setrlimit 39function injects the 40.Xr setrlimit 2 41system call into the target process 42.Fa P 43by means of the agent LWP. 44If the process handle 45.Fa P 46is the value 47.Dv NULL 48then this will be equivalent to calling 49.Xr setrlimit 2 50on the currently running process. 51.Pp 52The arguments 53.Fa resource 54and 55.Fa rlp 56have the same meaning as in 57.Xr setrlimit 2 . 58See 59.Xr setrlimit 2 60for the full description and purpose of the 61.Sy setrlimit 62system call and its arguments. 63.Pp 64The 65.Fn pr_setrlimit 66function only works on active processes. 67Process handles that correspond to core files, zombie processes, or ELF objects 68do not support system call injection. 69.Pp 70The 71.Fn pr_setrlimit64 72function is equivalent to 73.Fn pr_setrlimit ; 74however, rather than having the rlimit information be subject to the data model 75of the target process, they always provide 64-bit rlimit information. 76See 77.Xr lf64 5 78for more information. 79.Sh RETURN VALUES 80Upon successful completion, the 81.Fn pr_setrlimit 82function's return value is that described in 83.Xr setrlimit 2 . 84Otherwise, 85.Sy -1 86is returned and 87.Sy errno 88is set to 89.Er ENOSYS 90to indicate that the system call could not be injected. 91.Sh ERRORS 92For the full list of errors see the 93.Sy ERRORS 94section in 95.Xr setrlimit 2 . 96.Pp 97The 98.Fn pr_setrlimit 99function will fail if: 100.Bl -tag -width Er 101.It Er ENOSYS 102An error occurred while trying to invoke the agent LWP and inject a 103system call in the process handle 104.Fa P 105or the process handle 106.Fa P 107does not support system call injection. 108.El 109.Sh INTERFACE STABILITY 110.Sy Uncommitted 111.Sh MT-LEVEL 112See 113.Sy LOCKING 114in 115.Xr libproc 3LIB . 116.Sh SEE ALSO 117.Xr setrlimit 2 , 118.Xr libproc 3LIB , 119.Xr proc 4 , 120.Xr lf64 5 121