143051d27SRobert Mustacchi.\" 243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the 343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0. 443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version 543051d27SRobert Mustacchi.\" 1.0 of the CDDL. 643051d27SRobert Mustacchi.\" 743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this 843051d27SRobert Mustacchi.\" source. A copy of the CDDL is also available via the Internet at 943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL. 1043051d27SRobert Mustacchi.\" 1143051d27SRobert Mustacchi.\" 1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc. 1343051d27SRobert Mustacchi.\" 14*a7d7cafeSRobert Mustacchi.Dd November 27, 2023 1543051d27SRobert Mustacchi.Dt PR_GETRLIMIT 3PROC 1643051d27SRobert Mustacchi.Os 1743051d27SRobert Mustacchi.Sh NAME 1843051d27SRobert Mustacchi.Nm pr_getrlimit , 1943051d27SRobert Mustacchi.Nm pr_getrlimit64 2043051d27SRobert Mustacchi.Nd inject getrlimit system call into victim process 21*a7d7cafeSRobert Mustacchi.Sh LIBRARY 2243051d27SRobert Mustacchi.Lb libproc 23*a7d7cafeSRobert Mustacchi.Sh SYNOPSIS 2443051d27SRobert Mustacchi.In libproc.h 2543051d27SRobert Mustacchi.Ft int 2643051d27SRobert Mustacchi.Fo pr_getrlimit 2743051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 2843051d27SRobert Mustacchi.Fa "int resource" 2943051d27SRobert Mustacchi.Fa "struct rlimit *rlp" 3043051d27SRobert Mustacchi.Fc 3143051d27SRobert Mustacchi.Ft int 3243051d27SRobert Mustacchi.Fo pr_getrlimit64 3343051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 3443051d27SRobert Mustacchi.Fa "int resource" 3543051d27SRobert Mustacchi.Fa "struct rlimit64 *rlp" 3643051d27SRobert Mustacchi.Fc 3743051d27SRobert Mustacchi.Sh DESCRIPTION 3843051d27SRobert MustacchiThe 3943051d27SRobert Mustacchi.Fn pr_getrlimit 4043051d27SRobert Mustacchifunction injects the 4143051d27SRobert Mustacchi.Xr getrlimit 2 4243051d27SRobert Mustacchisystem call into the target process 4343051d27SRobert Mustacchi.Fa P 4443051d27SRobert Mustacchiby means of the agent LWP. 4543051d27SRobert MustacchiIf the process handle 4643051d27SRobert Mustacchi.Fa P 4743051d27SRobert Mustacchiis the value 4843051d27SRobert Mustacchi.Dv NULL 4943051d27SRobert Mustacchithen this will be equivalent to calling 5043051d27SRobert Mustacchi.Xr getrlimit 2 5143051d27SRobert Mustacchion the currently running process. 5243051d27SRobert Mustacchi.Pp 5343051d27SRobert MustacchiThe arguments 5443051d27SRobert Mustacchi.Fa resource 5543051d27SRobert Mustacchiand 5643051d27SRobert Mustacchi.Fa rlp 5743051d27SRobert Mustacchihave the same meaning as in 5843051d27SRobert Mustacchi.Xr getrlimit 2 . 5943051d27SRobert MustacchiSee 6043051d27SRobert Mustacchi.Xr getrlimit 2 6143051d27SRobert Mustacchifor the full description and purpose of the 6243051d27SRobert Mustacchi.Sy getrlimit 6343051d27SRobert Mustacchisystem call and its arguments. 6443051d27SRobert Mustacchi.Pp 6543051d27SRobert MustacchiThe 6643051d27SRobert Mustacchi.Fn pr_getrlimit 6772d3dbb9SYuri Pankovfunction only works on active processes. 6872d3dbb9SYuri PankovProcess handles that correspond to core files, zombie processes, or ELF objects 6972d3dbb9SYuri Pankovdo not support system call injection. 7043051d27SRobert Mustacchi.Pp 7143051d27SRobert MustacchiThe 7243051d27SRobert Mustacchi.Fn pr_getrlimit64 7343051d27SRobert Mustacchifunction is equivalent to 7443051d27SRobert Mustacchi.Fn pr_getrlimit ; 7572d3dbb9SYuri Pankovhowever, rather than having the rlimit information be subject to the data model 7672d3dbb9SYuri Pankovof the target process, they always provide 64-bit rlimit information. 7772d3dbb9SYuri PankovSee 78bbf21555SRichard Lowe.Xr lf64 7 7943051d27SRobert Mustacchifor more information. 8043051d27SRobert Mustacchi.Sh RETURN VALUES 8143051d27SRobert MustacchiUpon successful completion, the 8243051d27SRobert Mustacchi.Fn pr_getrlimit 8343051d27SRobert Mustacchifunction's return value is that described in 8443051d27SRobert Mustacchi.Xr getrlimit 2 . 8543051d27SRobert MustacchiOtherwise, 8643051d27SRobert Mustacchi.Sy -1 8743051d27SRobert Mustacchiis returned and 8843051d27SRobert Mustacchi.Sy errno 8943051d27SRobert Mustacchiis set to 9043051d27SRobert Mustacchi.Er ENOSYS 9143051d27SRobert Mustacchito indicate that the system call could not be injected. 9243051d27SRobert Mustacchi.Sh ERRORS 9343051d27SRobert MustacchiFor the full list of errors see the 9443051d27SRobert Mustacchi.Sy ERRORS 9543051d27SRobert Mustacchisection in 9643051d27SRobert Mustacchi.Xr getrlimit 2 . 9743051d27SRobert Mustacchi.Pp 9843051d27SRobert MustacchiThe 9943051d27SRobert Mustacchi.Fn pr_getrlimit 10043051d27SRobert Mustacchifunction will fail if: 10143051d27SRobert Mustacchi.Bl -tag -width Er 10243051d27SRobert Mustacchi.It Er ENOSYS 10343051d27SRobert MustacchiAn error occurred while trying to invoke the agent LWP and inject a 10443051d27SRobert Mustacchisystem call in the process handle 10543051d27SRobert Mustacchi.Fa P 10643051d27SRobert Mustacchior the process handle 10743051d27SRobert Mustacchi.Fa P 10843051d27SRobert Mustacchidoes not support system call injection. 10943051d27SRobert Mustacchi.El 11043051d27SRobert Mustacchi.Sh INTERFACE STABILITY 11143051d27SRobert Mustacchi.Sy Uncommitted 11243051d27SRobert Mustacchi.Sh MT-LEVEL 11343051d27SRobert MustacchiSee 11443051d27SRobert Mustacchi.Sy LOCKING 11543051d27SRobert Mustacchiin 11643051d27SRobert Mustacchi.Xr libproc 3LIB . 11743051d27SRobert Mustacchi.Sh SEE ALSO 11843051d27SRobert Mustacchi.Xr getrlimit 2 , 11943051d27SRobert Mustacchi.Xr libproc 3LIB , 120bbf21555SRichard Lowe.Xr proc 5 , 121bbf21555SRichard Lowe.Xr lf64 7 122