xref: /illumos-gate/usr/src/cmd/prstat/prfile.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_PRFILE_H
28 #define	_PRFILE_H
29 
30 #include <sys/types.h>
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	MAX_PROCFS_PATH	40
37 #define	NUM_RESERVED_FD	10
38 
39 typedef struct fd {
40 	int	fd_fd;
41 	int	fd_flags;
42 	char	fd_name[MAX_PROCFS_PATH];
43 } fd_t;
44 
45 typedef struct fds {
46 	pid_t	fds_pid;
47 	fd_t	*fds_psinfo;
48 	fd_t	*fds_usage;
49 	fd_t	*fds_lpsinfo;
50 	fd_t	*fds_lusage;
51 	struct fds *fds_next;
52 } fds_t;
53 
54 extern void fd_init(int);
55 extern void fd_exit();
56 extern fd_t *fd_open(char *, int, fd_t *);
57 extern int fd_getfd(fd_t *);
58 extern void fd_close(fd_t *);
59 extern void fd_closeall();
60 extern void fd_update();
61 extern fds_t *fds_get(pid_t);
62 extern void fds_rm(pid_t);
63 
64 #ifdef	__cplusplus
65 }
66 #endif
67 
68 #endif	/* _PRFILE_H */
69