File: sol_procfs.h

package info (click to toggle)
dtrace 2.0.5-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 24,408 kB
  • sloc: ansic: 61,247; sh: 17,997; asm: 1,717; lex: 947; awk: 754; yacc: 695; perl: 37; sed: 17; makefile: 15
file content (62 lines) | stat: -rw-r--r-- 1,924 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Oracle Linux DTrace.
 * Copyright (c) 2006, 2026, Oracle and/or its affiliates. All rights reserved.
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */

#ifndef _SYS_PROCFS_SOLARIS_H
#define	_SYS_PROCFS_SOLARIS_H

#include <sys/procfs.h>

#ifdef	__cplusplus
extern "C" {
#endif

#include <sys/types.h>
#include <sys/dtrace_types.h>
#include <sys/procfs_isa.h>
#include <link.h>

/*
 * The prmap_file points to all mappings corresponding to a single file, sorted
 * by address.  prmap_files are hashed by name (including the terminating \0,
 * so anonymous maps are all hashed together) and by dev/inode number.
 */
struct prmap;
typedef struct prmap_file {
	struct prmap_file *prf_name_next; /* next in filename hash chain */
	struct prmap_file *prf_inum_next; /* next in inode hash chain */
	char	*prf_mapname;		/* name in /proc/<pid>/maps */
	struct prmap **prf_mappings;	/* sorted by address */
	size_t prf_num_mappings;	/* number of mappings */
	struct prmap *prf_text_map;	/* primary text mapping, if known */
	struct prmap *first_segment;	/* mapping of first segment */
} prmap_file_t;

/*
 * A single mapping.
 */
typedef struct prmap {
	uintptr_t pr_vaddr;	/* virtual address of mapping */
	char	*pr_mapaddrname; /* address text from /proc/<pid>/maps */
	size_t	pr_size;	/* size of mapping in bytes */
	int	pr_mflags;	/* protection and attribute flags (see below) */
	dev_t	pr_dev;		/* device number */
	ino_t	pr_inum;	/* inode number */
	prmap_file_t *pr_file;	/* backpointer to corresponding file mapping */
} prmap_t;


/* Protection and attribute flags */
#define	MA_PIC		0x08	/* position independent code */
#define	MA_READ		0x04	/* readable by the traced process */
#define	MA_WRITE	0x02	/* writable by the traced process */
#define	MA_EXEC		0x01	/* executable by the traced process */

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_PROCFS_H */