1// created by cgo -cdefs and then converted to Go
2// cgo -cdefs defs_linux.go defs1_linux.go
3
4package runtime
5
6const (
7	_EINTR  = 0x4
8	_EAGAIN = 0xb
9	_ENOMEM = 0xc
10
11	_PROT_NONE  = 0x0
12	_PROT_READ  = 0x1
13	_PROT_WRITE = 0x2
14	_PROT_EXEC  = 0x4
15
16	_MAP_ANON    = 0x20
17	_MAP_PRIVATE = 0x2
18	_MAP_FIXED   = 0x10
19
20	_MADV_DONTNEED   = 0x4
21	_MADV_HUGEPAGE   = 0xe
22	_MADV_NOHUGEPAGE = 0xf
23
24	_SA_RESTART  = 0x10000000
25	_SA_ONSTACK  = 0x8000000
26	_SA_RESTORER = 0x4000000
27	_SA_SIGINFO  = 0x4
28
29	_SIGHUP    = 0x1
30	_SIGINT    = 0x2
31	_SIGQUIT   = 0x3
32	_SIGILL    = 0x4
33	_SIGTRAP   = 0x5
34	_SIGABRT   = 0x6
35	_SIGBUS    = 0x7
36	_SIGFPE    = 0x8
37	_SIGKILL   = 0x9
38	_SIGUSR1   = 0xa
39	_SIGSEGV   = 0xb
40	_SIGUSR2   = 0xc
41	_SIGPIPE   = 0xd
42	_SIGALRM   = 0xe
43	_SIGSTKFLT = 0x10
44	_SIGCHLD   = 0x11
45	_SIGCONT   = 0x12
46	_SIGSTOP   = 0x13
47	_SIGTSTP   = 0x14
48	_SIGTTIN   = 0x15
49	_SIGTTOU   = 0x16
50	_SIGURG    = 0x17
51	_SIGXCPU   = 0x18
52	_SIGXFSZ   = 0x19
53	_SIGVTALRM = 0x1a
54	_SIGPROF   = 0x1b
55	_SIGWINCH  = 0x1c
56	_SIGIO     = 0x1d
57	_SIGPWR    = 0x1e
58	_SIGSYS    = 0x1f
59
60	_FPE_INTDIV = 0x1
61	_FPE_INTOVF = 0x2
62	_FPE_FLTDIV = 0x3
63	_FPE_FLTOVF = 0x4
64	_FPE_FLTUND = 0x5
65	_FPE_FLTRES = 0x6
66	_FPE_FLTINV = 0x7
67	_FPE_FLTSUB = 0x8
68
69	_BUS_ADRALN = 0x1
70	_BUS_ADRERR = 0x2
71	_BUS_OBJERR = 0x3
72
73	_SEGV_MAPERR = 0x1
74	_SEGV_ACCERR = 0x2
75
76	_ITIMER_REAL    = 0x0
77	_ITIMER_VIRTUAL = 0x1
78	_ITIMER_PROF    = 0x2
79
80	_EPOLLIN       = 0x1
81	_EPOLLOUT      = 0x4
82	_EPOLLERR      = 0x8
83	_EPOLLHUP      = 0x10
84	_EPOLLRDHUP    = 0x2000
85	_EPOLLET       = 0x80000000
86	_EPOLL_CLOEXEC = 0x80000
87	_EPOLL_CTL_ADD = 0x1
88	_EPOLL_CTL_DEL = 0x2
89	_EPOLL_CTL_MOD = 0x3
90
91	_AF_UNIX    = 0x1
92	_F_SETFL    = 0x4
93	_SOCK_DGRAM = 0x2
94)
95
96type timespec struct {
97	tv_sec  int64
98	tv_nsec int64
99}
100
101func (ts *timespec) set_sec(x int64) {
102	ts.tv_sec = x
103}
104
105func (ts *timespec) set_nsec(x int32) {
106	ts.tv_nsec = int64(x)
107}
108
109type timeval struct {
110	tv_sec  int64
111	tv_usec int64
112}
113
114func (tv *timeval) set_usec(x int32) {
115	tv.tv_usec = int64(x)
116}
117
118type sigactiont struct {
119	sa_handler  uintptr
120	sa_flags    uint64
121	sa_restorer uintptr
122	sa_mask     uint64
123}
124
125type siginfo struct {
126	si_signo int32
127	si_errno int32
128	si_code  int32
129	// below here is a union; si_addr is the only field we use
130	si_addr uint64
131}
132
133type itimerval struct {
134	it_interval timeval
135	it_value    timeval
136}
137
138type epollevent struct {
139	events uint32
140	data   [8]byte // unaligned uintptr
141}
142
143// created by cgo -cdefs and then converted to Go
144// cgo -cdefs defs_linux.go defs1_linux.go
145
146const (
147	_O_RDONLY  = 0x0
148	_O_CLOEXEC = 0x80000
149)
150
151type usigset struct {
152	__val [16]uint64
153}
154
155type fpxreg struct {
156	significand [4]uint16
157	exponent    uint16
158	padding     [3]uint16
159}
160
161type xmmreg struct {
162	element [4]uint32
163}
164
165type fpstate struct {
166	cwd       uint16
167	swd       uint16
168	ftw       uint16
169	fop       uint16
170	rip       uint64
171	rdp       uint64
172	mxcsr     uint32
173	mxcr_mask uint32
174	_st       [8]fpxreg
175	_xmm      [16]xmmreg
176	padding   [24]uint32
177}
178
179type fpxreg1 struct {
180	significand [4]uint16
181	exponent    uint16
182	padding     [3]uint16
183}
184
185type xmmreg1 struct {
186	element [4]uint32
187}
188
189type fpstate1 struct {
190	cwd       uint16
191	swd       uint16
192	ftw       uint16
193	fop       uint16
194	rip       uint64
195	rdp       uint64
196	mxcsr     uint32
197	mxcr_mask uint32
198	_st       [8]fpxreg1
199	_xmm      [16]xmmreg1
200	padding   [24]uint32
201}
202
203type fpreg1 struct {
204	significand [4]uint16
205	exponent    uint16
206}
207
208type stackt struct {
209	ss_sp     *byte
210	ss_flags  int32
211	pad_cgo_0 [4]byte
212	ss_size   uintptr
213}
214
215type mcontext struct {
216	gregs       [23]uint64
217	fpregs      *fpstate
218	__reserved1 [8]uint64
219}
220
221type ucontext struct {
222	uc_flags     uint64
223	uc_link      *ucontext
224	uc_stack     stackt
225	uc_mcontext  mcontext
226	uc_sigmask   usigset
227	__fpregs_mem fpstate
228}
229
230type sigcontext struct {
231	r8          uint64
232	r9          uint64
233	r10         uint64
234	r11         uint64
235	r12         uint64
236	r13         uint64
237	r14         uint64
238	r15         uint64
239	rdi         uint64
240	rsi         uint64
241	rbp         uint64
242	rbx         uint64
243	rdx         uint64
244	rax         uint64
245	rcx         uint64
246	rsp         uint64
247	rip         uint64
248	eflags      uint64
249	cs          uint16
250	gs          uint16
251	fs          uint16
252	__pad0      uint16
253	err         uint64
254	trapno      uint64
255	oldmask     uint64
256	cr2         uint64
257	fpstate     *fpstate1
258	__reserved1 [8]uint64
259}
260
261type sockaddr_un struct {
262	family uint16
263	path   [108]byte
264}
265