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 <dirent.h>
25#include <fcntl.h>
26#include <signal.h>
27#include <termios.h>
28#include <unistd.h>
29#include <mach/mach.h>
30#include <mach/message.h>
31#include <sys/event.h>
32#include <sys/mman.h>
33#include <sys/mount.h>
34#include <sys/param.h>
35#include <sys/ptrace.h>
36#include <sys/resource.h>
37#include <sys/select.h>
38#include <sys/signal.h>
39#include <sys/socket.h>
40#include <sys/stat.h>
41#include <sys/time.h>
42#include <sys/types.h>
43#include <sys/uio.h>
44#include <sys/un.h>
45#include <net/bpf.h>
46#include <net/if_dl.h>
47#include <net/if_var.h>
48#include <net/route.h>
49#include <netinet/in.h>
50
51#include <sys/sysctl.h>
52#include <sys/ucred.h>
53#include <sys/proc.h>
54#include <sys/time.h>
55#include <sys/_types/_timeval.h>
56#include <sys/appleapiopts.h>
57#include <sys/cdefs.h>
58#include <sys/param.h>
59#include <bsm/audit.h>
60#include <sys/queue.h>
61
62enum {
63	sizeofPtr = sizeof(void*),
64};
65
66union sockaddr_all {
67	struct sockaddr s1;	// this one gets used for fields
68	struct sockaddr_in s2;	// these pad it out
69	struct sockaddr_in6 s3;
70	struct sockaddr_un s4;
71	struct sockaddr_dl s5;
72};
73
74struct sockaddr_any {
75	struct sockaddr addr;
76	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
77};
78
79struct ucred_queue {
80        struct ucred *tqe_next;
81        struct ucred **tqe_prev;
82        TRACEBUF
83};
84
85*/
86import "C"
87
88// Machine characteristics; for internal use.
89
90const (
91	sizeofPtr      = C.sizeofPtr
92	sizeofShort    = C.sizeof_short
93	sizeofInt      = C.sizeof_int
94	sizeofLong     = C.sizeof_long
95	sizeofLongLong = C.sizeof_longlong
96)
97
98// Basic types
99
100type (
101	_C_short     C.short
102	_C_int       C.int
103	_C_long      C.long
104	_C_long_long C.longlong
105)
106
107// Time
108
109type Timespec C.struct_timespec
110
111type Timeval C.struct_timeval
112
113// Processes
114
115type Rusage C.struct_rusage
116
117type Rlimit C.struct_rlimit
118
119type UGid_t C.gid_t
120
121type KinfoProc C.struct_kinfo_proc
122
123type Eproc C.struct_eproc
124
125type Proc C.struct_proc
126
127type Session C.struct_session
128
129type ucred C.struct_ucred
130
131type Uucred C.struct__ucred
132
133type Upcred C.struct__pcred
134
135type Vmspace C.struct_vmspace
136
137type Sigacts C.struct_sigacts
138
139type ExternProc C.struct_extern_proc
140
141type Itimerval C.struct_itimerval
142
143type Vnode C.struct_vnode
144
145type Pgrp C.struct_pgrp
146
147type UserStruct C.struct_user
148
149type Au_session C.struct_au_session
150
151type Posix_cred C.struct_posix_cred
152
153type Label C.struct_label
154
155type AuditinfoAddr C.struct_auditinfo_addr
156type AuMask C.struct_au_mask
157type AuTidAddr C.struct_au_tid_addr
158
159// TAILQ(ucred)
160type UcredQueue C.struct_ucred_queue
161