1// Copyright 2009 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Hand Writing
6// - all pointer in ExternProc to uint64
7
8// +build ignore
9
10/*
11Input to cgo -godefs.
12*/
13
14// +godefs map struct_in_addr [4]byte /* in_addr */
15// +godefs map struct_in6_addr [16]byte /* in6_addr */
16// +godefs map struct_ [16]byte /* in6_addr */
17
18package process
19
20/*
21#define __DARWIN_UNIX03 0
22#define KERNEL
23#define _DARWIN_USE_64_BIT_INODE
24#include <stdint.h>
25#include <dirent.h>
26#include <fcntl.h>
27#include <signal.h>
28#include <termios.h>
29#include <unistd.h>
30#include <mach/mach.h>
31#include <mach/message.h>
32#include <sys/event.h>
33#include <sys/mman.h>
34#include <sys/mount.h>
35#include <sys/param.h>
36#include <sys/ptrace.h>
37#include <sys/resource.h>
38#include <sys/select.h>
39#include <sys/signal.h>
40#include <sys/socket.h>
41#include <sys/stat.h>
42#include <sys/time.h>
43#include <sys/types.h>
44#include <sys/uio.h>
45#include <sys/un.h>
46#include <net/bpf.h>
47#include <net/if_dl.h>
48#include <net/if_var.h>
49#include <net/route.h>
50#include <netinet/in.h>
51
52#include <sys/sysctl.h>
53#include <sys/ucred.h>
54#include <sys/proc.h>
55#include <sys/time.h>
56#include <sys/_types/_timeval.h>
57#include <sys/appleapiopts.h>
58#include <sys/cdefs.h>
59#include <sys/param.h>
60#include <bsm/audit.h>
61#include <sys/queue.h>
62
63enum {
64	sizeofPtr = sizeof(void*),
65};
66
67union sockaddr_all {
68	struct sockaddr s1;	// this one gets used for fields
69	struct sockaddr_in s2;	// these pad it out
70	struct sockaddr_in6 s3;
71	struct sockaddr_un s4;
72	struct sockaddr_dl s5;
73};
74
75struct sockaddr_any {
76	struct sockaddr addr;
77	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
78};
79
80struct ucred_queue {
81        struct ucred *tqe_next;
82        struct ucred **tqe_prev;
83        TRACEBUF
84};
85
86*/
87import "C"
88
89// Machine characteristics; for internal use.
90
91const (
92	sizeofPtr      = C.sizeofPtr
93	sizeofShort    = C.sizeof_short
94	sizeofInt      = C.sizeof_int
95	sizeofLong     = C.sizeof_long
96	sizeofLongLong = C.sizeof_longlong
97)
98
99// Basic types
100
101type (
102	_C_short     C.short
103	_C_int       C.int
104	_C_long      C.long
105	_C_long_long C.longlong
106)
107
108// Time
109
110type Timespec C.struct_timespec
111
112type Timeval C.struct_timeval
113
114// Processes
115
116type Rusage C.struct_rusage
117
118type Rlimit C.struct_rlimit
119
120type UGid_t C.gid_t
121
122type KinfoProc C.struct_kinfo_proc
123
124type Eproc C.struct_eproc
125
126type Proc C.struct_proc
127
128type Session C.struct_session
129
130type ucred C.struct_ucred
131
132type Uucred C.struct__ucred
133
134type Upcred C.struct__pcred
135
136type Vmspace C.struct_vmspace
137
138type Sigacts C.struct_sigacts
139
140type ExternProc C.struct_extern_proc
141
142type Itimerval C.struct_itimerval
143
144type Vnode C.struct_vnode
145
146type Pgrp C.struct_pgrp
147
148type UserStruct C.struct_user
149
150type Au_session C.struct_au_session
151
152type Posix_cred C.struct_posix_cred
153
154type Label C.struct_label
155
156type AuditinfoAddr C.struct_auditinfo_addr
157type AuMask C.struct_au_mask
158type AuTidAddr C.struct_au_tid_addr
159
160// TAILQ(ucred)
161type UcredQueue C.struct_ucred_queue
162