aboutsummaryrefslogtreecommitdiff
path: root/man/man3/mach.html
blob: d69e592934cc1ecf4d4797151039d325da8ec0b8 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<head>
<title>mach(3) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>MACH(3)</b><td align=right><b>MACH(3)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    machbytype, machbyname &ndash; machine-independent access to executables
    and programs<br>
    
</table>
<p><font size=+1><b>SYNOPSIS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>#include &lt;u.h&gt;<br>
    #include &lt;libc.h&gt;<br>
    #include &lt;mach.h&gt; 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <tt><font size=+1>void machbytype(int type) 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    <tt><font size=+1>int machbyname(char *name) 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    <tt><font size=+1>extern Mach *mach;<br>
    </font></tt>
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <i>Libmach</i> provides an interface for accessing the executable files
    and executing images of various architectures and operating systems.
    The interface is machine-independent, meaning that, for example,
    Mac OS X core dumps may be inspected using an x86 Linux machine
    and vice versa. In its current form, the library is
    mainly useful for writing debuggers of one sort or another. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    An architecture is described primarily by a <tt><font size=+1>Mach</font></tt> structure, which
    contains data structures and parameters describing the particular
    architecture. Most library functions assume that the global variable
    <i>mach</i> points at the structure for the architecture being debugged.
    It is set implicitly by <i>crackhdr</i> (see <a href="../man3/mach-file.html"><i>mach-file</i>(3)</a>) and
    can be set explicitly by calling <i>machbyname</i> or <i>machbytype</i>. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    There is no operating system-specific structure akin to <i>mach</i>.
    Typically the choice of operating system on a particular architecture
    affects only the executable and core dump formats; the various
    file parsers deduce the operating system from information in the
    binary files themselves and adjust accordingly. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The supported architectures are <tt><font size=+1>386</font></tt> (Intel 32-bit x86) 386 and
    later) and <tt><font size=+1>power</font></tt> (IBM PowerPC, typically running Mac OS X). 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    Other manual pages describe the library functions in detail. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-cmd.html"><i>Mach-cmd</i>(3)</a> describes some convenience routines for attaching
    to processes and core files. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-file.html"><i>Mach-file</i>(3)</a> describes the manipulation of binary files. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-map.html"><i>Mach-map</i>(3)</a> describes the interface to address spaces and register
    sets in executable files and executing programs. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-stack.html"><i>Mach-stack</i>(3)</a> describes support for unwinding the stack. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-swap.html"><i>Mach-swap</i>(3)</a> describes helper functions for accessing data in
    a particular byte order. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <a href="../man3/Mach-symbol.html"><i>Mach-symbol</i>(3)</a> describes the interface to debugging symbol information.<br>
    
</table>
<p><font size=+1><b>SOURCE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/usr/local/plan9/src/libmach<br>
    </font></tt>
</table>
<p><font size=+1><b>SEE ALSO     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man3/mach-file.html"><i>mach-file</i>(3)</a>, <a href="../man3/mach-map.html"><i>mach-map</i>(3)</a>, <a href="../man3/mach-stack.html"><i>mach-stack</i>(3)</a>, <a href="../man3/mach-swap.html"><i>mach-swap</i>(3)</a>, <a href="../man3/mach-symbol.html"><i>mach-symbol</i>(3)</a><br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>