xref: /titanic_51/usr/src/cmd/prstat/prfile.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #define	MAX_PROCFS_PATH	40
39 #define	NUM_RESERVED_FD	10
40 
41 typedef struct fd {
42 	int	fd_fd;
43 	int	fd_flags;
44 	char	fd_name[MAX_PROCFS_PATH];
45 } fd_t;
46 
47 typedef struct fds {
48 	pid_t	fds_pid;
49 	fd_t	*fds_psinfo;
50 	fd_t	*fds_usage;
51 	fd_t	*fds_lpsinfo;
52 	fd_t	*fds_lusage;
53 	struct fds *fds_next;
54 } fds_t;
55 
56 extern void fd_init(int);
57 extern void fd_exit();
58 extern fd_t *fd_open(char *, int, fd_t *);
59 extern int fd_getfd(fd_t *);
60 extern void fd_close(fd_t *);
61 extern void fd_closeall();
62 extern void fd_update();
63 extern fds_t *fds_get(pid_t);
64 extern void fds_rm(pid_t);
65 
66 #ifdef	__cplusplus
67 }
68 #endif
69 
70 #endif	/* _PRFILE_H */
71