equal
deleted
inserted
replaced
4 // +build amd64,freebsd |
4 // +build amd64,freebsd |
5 |
5 |
6 package unix |
6 package unix |
7 |
7 |
8 const ( |
8 const ( |
9 sizeofPtr = 0x8 |
9 SizeofPtr = 0x8 |
10 sizeofShort = 0x2 |
10 SizeofShort = 0x2 |
11 sizeofInt = 0x4 |
11 SizeofInt = 0x4 |
12 sizeofLong = 0x8 |
12 SizeofLong = 0x8 |
13 sizeofLongLong = 0x8 |
13 SizeofLongLong = 0x8 |
14 ) |
14 ) |
15 |
15 |
16 type ( |
16 type ( |
17 _C_short int16 |
17 _C_short int16 |
18 _C_int int32 |
18 _C_int int32 |
54 Max int64 |
54 Max int64 |
55 } |
55 } |
56 |
56 |
57 type _Gid_t uint32 |
57 type _Gid_t uint32 |
58 |
58 |
|
59 const ( |
|
60 _statfsVersion = 0x20140518 |
|
61 _dirblksiz = 0x400 |
|
62 ) |
|
63 |
59 type Stat_t struct { |
64 type Stat_t struct { |
60 Dev uint32 |
65 Dev uint64 |
61 Ino uint32 |
66 Ino uint64 |
62 Mode uint16 |
67 Nlink uint64 |
63 Nlink uint16 |
68 Mode uint16 |
64 Uid uint32 |
69 _0 int16 |
65 Gid uint32 |
70 Uid uint32 |
66 Rdev uint32 |
71 Gid uint32 |
67 Atimespec Timespec |
72 _1 int32 |
68 Mtimespec Timespec |
73 Rdev uint64 |
69 Ctimespec Timespec |
74 Atim Timespec |
70 Size int64 |
75 Mtim Timespec |
71 Blocks int64 |
76 Ctim Timespec |
72 Blksize int32 |
77 Btim Timespec |
73 Flags uint32 |
78 Size int64 |
74 Gen uint32 |
79 Blocks int64 |
75 Lspare int32 |
80 Blksize int32 |
76 Birthtimespec Timespec |
81 Flags uint32 |
|
82 Gen uint64 |
|
83 Spare [10]uint64 |
|
84 } |
|
85 |
|
86 type stat_freebsd11_t struct { |
|
87 Dev uint32 |
|
88 Ino uint32 |
|
89 Mode uint16 |
|
90 Nlink uint16 |
|
91 Uid uint32 |
|
92 Gid uint32 |
|
93 Rdev uint32 |
|
94 Atim Timespec |
|
95 Mtim Timespec |
|
96 Ctim Timespec |
|
97 Size int64 |
|
98 Blocks int64 |
|
99 Blksize int32 |
|
100 Flags uint32 |
|
101 Gen uint32 |
|
102 Lspare int32 |
|
103 Btim Timespec |
77 } |
104 } |
78 |
105 |
79 type Statfs_t struct { |
106 type Statfs_t struct { |
|
107 Version uint32 |
|
108 Type uint32 |
|
109 Flags uint64 |
|
110 Bsize uint64 |
|
111 Iosize uint64 |
|
112 Blocks uint64 |
|
113 Bfree uint64 |
|
114 Bavail int64 |
|
115 Files uint64 |
|
116 Ffree int64 |
|
117 Syncwrites uint64 |
|
118 Asyncwrites uint64 |
|
119 Syncreads uint64 |
|
120 Asyncreads uint64 |
|
121 Spare [10]uint64 |
|
122 Namemax uint32 |
|
123 Owner uint32 |
|
124 Fsid Fsid |
|
125 Charspare [80]int8 |
|
126 Fstypename [16]int8 |
|
127 Mntfromname [1024]int8 |
|
128 Mntonname [1024]int8 |
|
129 } |
|
130 |
|
131 type statfs_freebsd11_t struct { |
80 Version uint32 |
132 Version uint32 |
81 Type uint32 |
133 Type uint32 |
82 Flags uint64 |
134 Flags uint64 |
83 Bsize uint64 |
135 Bsize uint64 |
84 Iosize uint64 |
136 Iosize uint64 |
100 Mntfromname [88]int8 |
152 Mntfromname [88]int8 |
101 Mntonname [88]int8 |
153 Mntonname [88]int8 |
102 } |
154 } |
103 |
155 |
104 type Flock_t struct { |
156 type Flock_t struct { |
105 Start int64 |
157 Start int64 |
106 Len int64 |
158 Len int64 |
107 Pid int32 |
159 Pid int32 |
108 Type int16 |
160 Type int16 |
109 Whence int16 |
161 Whence int16 |
110 Sysid int32 |
162 Sysid int32 |
111 Pad_cgo_0 [4]byte |
163 _ [4]byte |
112 } |
164 } |
113 |
165 |
114 type Dirent struct { |
166 type Dirent struct { |
|
167 Fileno uint64 |
|
168 Off int64 |
|
169 Reclen uint16 |
|
170 Type uint8 |
|
171 Pad0 uint8 |
|
172 Namlen uint16 |
|
173 Pad1 uint16 |
|
174 Name [256]int8 |
|
175 } |
|
176 |
|
177 type dirent_freebsd11 struct { |
115 Fileno uint32 |
178 Fileno uint32 |
116 Reclen uint16 |
179 Reclen uint16 |
117 Type uint8 |
180 Type uint8 |
118 Namlen uint8 |
181 Namlen uint8 |
119 Name [256]int8 |
182 Name [256]int8 |
210 } |
273 } |
211 |
274 |
212 type Msghdr struct { |
275 type Msghdr struct { |
213 Name *byte |
276 Name *byte |
214 Namelen uint32 |
277 Namelen uint32 |
215 Pad_cgo_0 [4]byte |
278 _ [4]byte |
216 Iov *Iovec |
279 Iov *Iovec |
217 Iovlen int32 |
280 Iovlen int32 |
218 Pad_cgo_1 [4]byte |
281 _ [4]byte |
219 Control *byte |
282 Control *byte |
220 Controllen uint32 |
283 Controllen uint32 |
221 Flags int32 |
284 Flags int32 |
222 } |
285 } |
223 |
286 |
257 SizeofIPv6MTUInfo = 0x20 |
320 SizeofIPv6MTUInfo = 0x20 |
258 SizeofICMPv6Filter = 0x20 |
321 SizeofICMPv6Filter = 0x20 |
259 ) |
322 ) |
260 |
323 |
261 const ( |
324 const ( |
262 PTRACE_TRACEME = 0x0 |
325 PTRACE_ATTACH = 0xa |
263 PTRACE_CONT = 0x7 |
326 PTRACE_CONT = 0x7 |
264 PTRACE_KILL = 0x8 |
327 PTRACE_DETACH = 0xb |
265 ) |
328 PTRACE_GETFPREGS = 0x23 |
|
329 PTRACE_GETFSBASE = 0x47 |
|
330 PTRACE_GETLWPLIST = 0xf |
|
331 PTRACE_GETNUMLWPS = 0xe |
|
332 PTRACE_GETREGS = 0x21 |
|
333 PTRACE_GETXSTATE = 0x45 |
|
334 PTRACE_IO = 0xc |
|
335 PTRACE_KILL = 0x8 |
|
336 PTRACE_LWPEVENTS = 0x18 |
|
337 PTRACE_LWPINFO = 0xd |
|
338 PTRACE_SETFPREGS = 0x24 |
|
339 PTRACE_SETREGS = 0x22 |
|
340 PTRACE_SINGLESTEP = 0x9 |
|
341 PTRACE_TRACEME = 0x0 |
|
342 ) |
|
343 |
|
344 const ( |
|
345 PIOD_READ_D = 0x1 |
|
346 PIOD_WRITE_D = 0x2 |
|
347 PIOD_READ_I = 0x3 |
|
348 PIOD_WRITE_I = 0x4 |
|
349 ) |
|
350 |
|
351 const ( |
|
352 PL_FLAG_BORN = 0x100 |
|
353 PL_FLAG_EXITED = 0x200 |
|
354 PL_FLAG_SI = 0x20 |
|
355 ) |
|
356 |
|
357 const ( |
|
358 TRAP_BRKPT = 0x1 |
|
359 TRAP_TRACE = 0x2 |
|
360 ) |
|
361 |
|
362 type PtraceLwpInfoStruct struct { |
|
363 Lwpid int32 |
|
364 Event int32 |
|
365 Flags int32 |
|
366 Sigmask Sigset_t |
|
367 Siglist Sigset_t |
|
368 Siginfo __Siginfo |
|
369 Tdname [20]int8 |
|
370 Child_pid int32 |
|
371 Syscall_code uint32 |
|
372 Syscall_narg uint32 |
|
373 } |
|
374 |
|
375 type __Siginfo struct { |
|
376 Signo int32 |
|
377 Errno int32 |
|
378 Code int32 |
|
379 Pid int32 |
|
380 Uid uint32 |
|
381 Status int32 |
|
382 Addr *byte |
|
383 Value [8]byte |
|
384 _ [40]byte |
|
385 } |
|
386 |
|
387 type Sigset_t struct { |
|
388 Val [4]uint32 |
|
389 } |
|
390 |
|
391 type Reg struct { |
|
392 R15 int64 |
|
393 R14 int64 |
|
394 R13 int64 |
|
395 R12 int64 |
|
396 R11 int64 |
|
397 R10 int64 |
|
398 R9 int64 |
|
399 R8 int64 |
|
400 Rdi int64 |
|
401 Rsi int64 |
|
402 Rbp int64 |
|
403 Rbx int64 |
|
404 Rdx int64 |
|
405 Rcx int64 |
|
406 Rax int64 |
|
407 Trapno uint32 |
|
408 Fs uint16 |
|
409 Gs uint16 |
|
410 Err uint32 |
|
411 Es uint16 |
|
412 Ds uint16 |
|
413 Rip int64 |
|
414 Cs int64 |
|
415 Rflags int64 |
|
416 Rsp int64 |
|
417 Ss int64 |
|
418 } |
|
419 |
|
420 type FpReg struct { |
|
421 Env [4]uint64 |
|
422 Acc [8][16]uint8 |
|
423 Xacc [16][16]uint8 |
|
424 Spare [12]uint64 |
|
425 } |
|
426 |
|
427 type PtraceIoDesc struct { |
|
428 Op int32 |
|
429 Offs *byte |
|
430 Addr *byte |
|
431 Len uint64 |
|
432 } |
266 |
433 |
267 type Kevent_t struct { |
434 type Kevent_t struct { |
268 Ident uint64 |
435 Ident uint64 |
269 Filter int16 |
436 Filter int16 |
270 Flags uint16 |
437 Flags uint16 |
272 Data int64 |
439 Data int64 |
273 Udata *byte |
440 Udata *byte |
274 } |
441 } |
275 |
442 |
276 type FdSet struct { |
443 type FdSet struct { |
277 X__fds_bits [16]uint64 |
444 Bits [16]uint64 |
278 } |
445 } |
279 |
446 |
280 const ( |
447 const ( |
281 sizeofIfMsghdr = 0xa8 |
448 sizeofIfMsghdr = 0xa8 |
282 SizeofIfMsghdr = 0xa8 |
449 SizeofIfMsghdr = 0xa8 |
288 SizeofRtMsghdr = 0x98 |
455 SizeofRtMsghdr = 0x98 |
289 SizeofRtMetrics = 0x70 |
456 SizeofRtMetrics = 0x70 |
290 ) |
457 ) |
291 |
458 |
292 type ifMsghdr struct { |
459 type ifMsghdr struct { |
293 Msglen uint16 |
460 Msglen uint16 |
294 Version uint8 |
461 Version uint8 |
295 Type uint8 |
462 Type uint8 |
296 Addrs int32 |
463 Addrs int32 |
297 Flags int32 |
464 Flags int32 |
298 Index uint16 |
465 Index uint16 |
299 Pad_cgo_0 [2]byte |
466 _ [2]byte |
300 Data ifData |
467 Data ifData |
301 } |
468 } |
302 |
469 |
303 type IfMsghdr struct { |
470 type IfMsghdr struct { |
304 Msglen uint16 |
471 Msglen uint16 |
305 Version uint8 |
472 Version uint8 |
306 Type uint8 |
473 Type uint8 |
307 Addrs int32 |
474 Addrs int32 |
308 Flags int32 |
475 Flags int32 |
309 Index uint16 |
476 Index uint16 |
310 Pad_cgo_0 [2]byte |
477 _ [2]byte |
311 Data IfData |
478 Data IfData |
312 } |
479 } |
313 |
480 |
314 type ifData struct { |
481 type ifData struct { |
315 Type uint8 |
482 Type uint8 |
316 Physical uint8 |
483 Physical uint8 |
317 Addrlen uint8 |
484 Addrlen uint8 |
318 Hdrlen uint8 |
485 Hdrlen uint8 |
319 Link_state uint8 |
486 Link_state uint8 |
320 Vhid uint8 |
487 Vhid uint8 |
321 Datalen uint16 |
488 Datalen uint16 |
322 Mtu uint32 |
489 Mtu uint32 |
323 Metric uint32 |
490 Metric uint32 |
324 Baudrate uint64 |
491 Baudrate uint64 |
325 Ipackets uint64 |
492 Ipackets uint64 |
326 Ierrors uint64 |
493 Ierrors uint64 |
327 Opackets uint64 |
494 Opackets uint64 |
328 Oerrors uint64 |
495 Oerrors uint64 |
329 Collisions uint64 |
496 Collisions uint64 |
330 Ibytes uint64 |
497 Ibytes uint64 |
331 Obytes uint64 |
498 Obytes uint64 |
332 Imcasts uint64 |
499 Imcasts uint64 |
333 Omcasts uint64 |
500 Omcasts uint64 |
334 Iqdrops uint64 |
501 Iqdrops uint64 |
335 Oqdrops uint64 |
502 Oqdrops uint64 |
336 Noproto uint64 |
503 Noproto uint64 |
337 Hwassist uint64 |
504 Hwassist uint64 |
338 X__ifi_epoch [8]byte |
505 _ [8]byte |
339 X__ifi_lastchange [16]byte |
506 _ [16]byte |
340 } |
507 } |
341 |
508 |
342 type IfData struct { |
509 type IfData struct { |
343 Type uint8 |
510 Type uint8 |
344 Physical uint8 |
511 Physical uint8 |
366 Epoch int64 |
533 Epoch int64 |
367 Lastchange Timeval |
534 Lastchange Timeval |
368 } |
535 } |
369 |
536 |
370 type IfaMsghdr struct { |
537 type IfaMsghdr struct { |
371 Msglen uint16 |
538 Msglen uint16 |
372 Version uint8 |
539 Version uint8 |
373 Type uint8 |
540 Type uint8 |
374 Addrs int32 |
541 Addrs int32 |
375 Flags int32 |
542 Flags int32 |
376 Index uint16 |
543 Index uint16 |
377 Pad_cgo_0 [2]byte |
544 _ [2]byte |
378 Metric int32 |
545 Metric int32 |
379 } |
546 } |
380 |
547 |
381 type IfmaMsghdr struct { |
548 type IfmaMsghdr struct { |
382 Msglen uint16 |
549 Msglen uint16 |
383 Version uint8 |
550 Version uint8 |
384 Type uint8 |
551 Type uint8 |
385 Addrs int32 |
552 Addrs int32 |
386 Flags int32 |
553 Flags int32 |
387 Index uint16 |
554 Index uint16 |
388 Pad_cgo_0 [2]byte |
555 _ [2]byte |
389 } |
556 } |
390 |
557 |
391 type IfAnnounceMsghdr struct { |
558 type IfAnnounceMsghdr struct { |
392 Msglen uint16 |
559 Msglen uint16 |
393 Version uint8 |
560 Version uint8 |
396 Name [16]int8 |
563 Name [16]int8 |
397 What uint16 |
564 What uint16 |
398 } |
565 } |
399 |
566 |
400 type RtMsghdr struct { |
567 type RtMsghdr struct { |
401 Msglen uint16 |
568 Msglen uint16 |
402 Version uint8 |
569 Version uint8 |
403 Type uint8 |
570 Type uint8 |
404 Index uint16 |
571 Index uint16 |
405 Pad_cgo_0 [2]byte |
572 _ [2]byte |
406 Flags int32 |
573 Flags int32 |
407 Addrs int32 |
574 Addrs int32 |
408 Pid int32 |
575 Pid int32 |
409 Seq int32 |
576 Seq int32 |
410 Errno int32 |
577 Errno int32 |
411 Fmask int32 |
578 Fmask int32 |
412 Inits uint64 |
579 Inits uint64 |
413 Rmx RtMetrics |
580 Rmx RtMetrics |
414 } |
581 } |
415 |
582 |
416 type RtMetrics struct { |
583 type RtMetrics struct { |
417 Locks uint64 |
584 Locks uint64 |
418 Mtu uint64 |
585 Mtu uint64 |
453 Bufb *byte |
620 Bufb *byte |
454 Buflen uint64 |
621 Buflen uint64 |
455 } |
622 } |
456 |
623 |
457 type BpfProgram struct { |
624 type BpfProgram struct { |
458 Len uint32 |
625 Len uint32 |
459 Pad_cgo_0 [4]byte |
626 _ [4]byte |
460 Insns *BpfInsn |
627 Insns *BpfInsn |
461 } |
628 } |
462 |
629 |
463 type BpfInsn struct { |
630 type BpfInsn struct { |
464 Code uint16 |
631 Code uint16 |
465 Jt uint8 |
632 Jt uint8 |
466 Jf uint8 |
633 Jf uint8 |
467 K uint32 |
634 K uint32 |
468 } |
635 } |
469 |
636 |
470 type BpfHdr struct { |
637 type BpfHdr struct { |
471 Tstamp Timeval |
638 Tstamp Timeval |
472 Caplen uint32 |
639 Caplen uint32 |
473 Datalen uint32 |
640 Datalen uint32 |
474 Hdrlen uint16 |
641 Hdrlen uint16 |
475 Pad_cgo_0 [6]byte |
642 _ [6]byte |
476 } |
643 } |
477 |
644 |
478 type BpfZbufHeader struct { |
645 type BpfZbufHeader struct { |
479 Kernel_gen uint32 |
646 Kernel_gen uint32 |
480 Kernel_len uint32 |
647 Kernel_len uint32 |
481 User_gen uint32 |
648 User_gen uint32 |
482 X_bzh_pad [5]uint32 |
649 _ [5]uint32 |
483 } |
650 } |
484 |
651 |
485 type Termios struct { |
652 type Termios struct { |
486 Iflag uint32 |
653 Iflag uint32 |
487 Oflag uint32 |
654 Oflag uint32 |
535 Nodename [256]byte |
702 Nodename [256]byte |
536 Release [256]byte |
703 Release [256]byte |
537 Version [256]byte |
704 Version [256]byte |
538 Machine [256]byte |
705 Machine [256]byte |
539 } |
706 } |
|
707 |
|
708 const SizeofClockinfo = 0x14 |
|
709 |
|
710 type Clockinfo struct { |
|
711 Hz int32 |
|
712 Tick int32 |
|
713 Spare int32 |
|
714 Stathz int32 |
|
715 Profhz int32 |
|
716 } |