8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Portions Copyright 2007 Chad Mynhier
27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 * Copyright 2015, Joyent, Inc.
29 * Copyright (c) 2013 by Delphix. All rights reserved.
30 */
31
32 /*
33 * Interfaces available from the process control library, libproc.
34 */
35
36 #ifndef _LIBPROC_H
37 #define _LIBPROC_H
38
39 #include <stdlib.h>
40 #include <unistd.h>
41 #include <fcntl.h>
42 #include <nlist.h>
43 #include <door.h>
44 #include <gelf.h>
45 #include <proc_service.h>
46 #include <rtld_db.h>
47 #include <procfs.h>
48 #include <ucred.h>
419
420 #if defined(__sparc)
421
422 extern int Plwp_getxregs(struct ps_prochandle *, lwpid_t, prxregset_t *);
423 extern int Plwp_setxregs(struct ps_prochandle *, lwpid_t, const prxregset_t *);
424
425 extern int Plwp_getgwindows(struct ps_prochandle *, lwpid_t, gwindows_t *);
426
427 #if defined(__sparcv9)
428 extern int Plwp_getasrs(struct ps_prochandle *, lwpid_t, asrset_t);
429 extern int Plwp_setasrs(struct ps_prochandle *, lwpid_t, const asrset_t);
430 #endif /* __sparcv9 */
431
432 #endif /* __sparc */
433
434 #if defined(__i386) || defined(__amd64)
435 extern int Pldt(struct ps_prochandle *, struct ssd *, int);
436 extern int proc_get_ldt(pid_t, struct ssd *, int);
437 #endif /* __i386 || __amd64 */
438
439 extern int Plwp_getpsinfo(struct ps_prochandle *, lwpid_t, lwpsinfo_t *);
440 extern int Plwp_getspymaster(struct ps_prochandle *, lwpid_t, psinfo_t *);
441
442 extern int Plwp_stack(struct ps_prochandle *, lwpid_t, stack_t *);
443 extern int Plwp_main_stack(struct ps_prochandle *, lwpid_t, stack_t *);
444 extern int Plwp_alt_stack(struct ps_prochandle *, lwpid_t, stack_t *);
445
446 /*
447 * LWP iteration interface; iterate over all active LWPs.
448 */
449 typedef int proc_lwp_f(void *, const lwpstatus_t *);
450 extern int Plwp_iter(struct ps_prochandle *, proc_lwp_f *, void *);
451
452 /*
453 * LWP iteration interface; iterate over all LWPs, active and zombie.
454 */
455 typedef int proc_lwp_all_f(void *, const lwpstatus_t *, const lwpsinfo_t *);
456 extern int Plwp_iter_all(struct ps_prochandle *, proc_lwp_all_f *, void *);
457
458 /*
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 *
26 * Portions Copyright 2007 Chad Mynhier
27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 * Copyright 2018, Joyent, Inc.
29 * Copyright (c) 2013 by Delphix. All rights reserved.
30 */
31
32 /*
33 * Interfaces available from the process control library, libproc.
34 */
35
36 #ifndef _LIBPROC_H
37 #define _LIBPROC_H
38
39 #include <stdlib.h>
40 #include <unistd.h>
41 #include <fcntl.h>
42 #include <nlist.h>
43 #include <door.h>
44 #include <gelf.h>
45 #include <proc_service.h>
46 #include <rtld_db.h>
47 #include <procfs.h>
48 #include <ucred.h>
419
420 #if defined(__sparc)
421
422 extern int Plwp_getxregs(struct ps_prochandle *, lwpid_t, prxregset_t *);
423 extern int Plwp_setxregs(struct ps_prochandle *, lwpid_t, const prxregset_t *);
424
425 extern int Plwp_getgwindows(struct ps_prochandle *, lwpid_t, gwindows_t *);
426
427 #if defined(__sparcv9)
428 extern int Plwp_getasrs(struct ps_prochandle *, lwpid_t, asrset_t);
429 extern int Plwp_setasrs(struct ps_prochandle *, lwpid_t, const asrset_t);
430 #endif /* __sparcv9 */
431
432 #endif /* __sparc */
433
434 #if defined(__i386) || defined(__amd64)
435 extern int Pldt(struct ps_prochandle *, struct ssd *, int);
436 extern int proc_get_ldt(pid_t, struct ssd *, int);
437 #endif /* __i386 || __amd64 */
438
439 extern int Plwp_getname(struct ps_prochandle *, lwpid_t, char *, size_t);
440 extern int Plwp_getpsinfo(struct ps_prochandle *, lwpid_t, lwpsinfo_t *);
441 extern int Plwp_getspymaster(struct ps_prochandle *, lwpid_t, psinfo_t *);
442
443 extern int Plwp_stack(struct ps_prochandle *, lwpid_t, stack_t *);
444 extern int Plwp_main_stack(struct ps_prochandle *, lwpid_t, stack_t *);
445 extern int Plwp_alt_stack(struct ps_prochandle *, lwpid_t, stack_t *);
446
447 /*
448 * LWP iteration interface; iterate over all active LWPs.
449 */
450 typedef int proc_lwp_f(void *, const lwpstatus_t *);
451 extern int Plwp_iter(struct ps_prochandle *, proc_lwp_f *, void *);
452
453 /*
454 * LWP iteration interface; iterate over all LWPs, active and zombie.
455 */
456 typedef int proc_lwp_all_f(void *, const lwpstatus_t *, const lwpsinfo_t *);
457 extern int Plwp_iter_all(struct ps_prochandle *, proc_lwp_all_f *, void *);
458
459 /*
|