equal
deleted
inserted
replaced
4 // +build 386,freebsd |
4 // +build 386,freebsd |
5 |
5 |
6 package unix |
6 package unix |
7 |
7 |
8 const ( |
8 const ( |
9 sizeofPtr = 0x4 |
9 SizeofPtr = 0x4 |
10 sizeofShort = 0x2 |
10 SizeofShort = 0x2 |
11 sizeofInt = 0x4 |
11 SizeofInt = 0x4 |
12 sizeofLong = 0x4 |
12 SizeofLong = 0x4 |
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 _ int32 |
70 Size int64 |
75 Atim Timespec |
71 Blocks int64 |
76 _ int32 |
72 Blksize int32 |
77 Mtim Timespec |
73 Flags uint32 |
78 _ int32 |
74 Gen uint32 |
79 Ctim Timespec |
75 Lspare int32 |
80 _ int32 |
76 Birthtimespec Timespec |
81 Btim Timespec |
77 Pad_cgo_0 [8]byte |
82 Size int64 |
|
83 Blocks int64 |
|
84 Blksize int32 |
|
85 Flags uint32 |
|
86 Gen uint64 |
|
87 Spare [10]uint64 |
|
88 } |
|
89 |
|
90 type stat_freebsd11_t struct { |
|
91 Dev uint32 |
|
92 Ino uint32 |
|
93 Mode uint16 |
|
94 Nlink uint16 |
|
95 Uid uint32 |
|
96 Gid uint32 |
|
97 Rdev uint32 |
|
98 Atim Timespec |
|
99 Mtim Timespec |
|
100 Ctim Timespec |
|
101 Size int64 |
|
102 Blocks int64 |
|
103 Blksize int32 |
|
104 Flags uint32 |
|
105 Gen uint32 |
|
106 Lspare int32 |
|
107 Btim Timespec |
|
108 _ [8]byte |
78 } |
109 } |
79 |
110 |
80 type Statfs_t struct { |
111 type Statfs_t struct { |
|
112 Version uint32 |
|
113 Type uint32 |
|
114 Flags uint64 |
|
115 Bsize uint64 |
|
116 Iosize uint64 |
|
117 Blocks uint64 |
|
118 Bfree uint64 |
|
119 Bavail int64 |
|
120 Files uint64 |
|
121 Ffree int64 |
|
122 Syncwrites uint64 |
|
123 Asyncwrites uint64 |
|
124 Syncreads uint64 |
|
125 Asyncreads uint64 |
|
126 Spare [10]uint64 |
|
127 Namemax uint32 |
|
128 Owner uint32 |
|
129 Fsid Fsid |
|
130 Charspare [80]int8 |
|
131 Fstypename [16]int8 |
|
132 Mntfromname [1024]int8 |
|
133 Mntonname [1024]int8 |
|
134 } |
|
135 |
|
136 type statfs_freebsd11_t struct { |
81 Version uint32 |
137 Version uint32 |
82 Type uint32 |
138 Type uint32 |
83 Flags uint64 |
139 Flags uint64 |
84 Bsize uint64 |
140 Bsize uint64 |
85 Iosize uint64 |
141 Iosize uint64 |
110 Whence int16 |
166 Whence int16 |
111 Sysid int32 |
167 Sysid int32 |
112 } |
168 } |
113 |
169 |
114 type Dirent struct { |
170 type Dirent struct { |
|
171 Fileno uint64 |
|
172 Off int64 |
|
173 Reclen uint16 |
|
174 Type uint8 |
|
175 Pad0 uint8 |
|
176 Namlen uint16 |
|
177 Pad1 uint16 |
|
178 Name [256]int8 |
|
179 } |
|
180 |
|
181 type dirent_freebsd11 struct { |
115 Fileno uint32 |
182 Fileno uint32 |
116 Reclen uint16 |
183 Reclen uint16 |
117 Type uint8 |
184 Type uint8 |
118 Namlen uint8 |
185 Namlen uint8 |
119 Name [256]int8 |
186 Name [256]int8 |
255 SizeofIPv6MTUInfo = 0x20 |
322 SizeofIPv6MTUInfo = 0x20 |
256 SizeofICMPv6Filter = 0x20 |
323 SizeofICMPv6Filter = 0x20 |
257 ) |
324 ) |
258 |
325 |
259 const ( |
326 const ( |
260 PTRACE_TRACEME = 0x0 |
327 PTRACE_ATTACH = 0xa |
261 PTRACE_CONT = 0x7 |
328 PTRACE_CONT = 0x7 |
262 PTRACE_KILL = 0x8 |
329 PTRACE_DETACH = 0xb |
263 ) |
330 PTRACE_GETFPREGS = 0x23 |
|
331 PTRACE_GETFSBASE = 0x47 |
|
332 PTRACE_GETLWPLIST = 0xf |
|
333 PTRACE_GETNUMLWPS = 0xe |
|
334 PTRACE_GETREGS = 0x21 |
|
335 PTRACE_GETXSTATE = 0x45 |
|
336 PTRACE_IO = 0xc |
|
337 PTRACE_KILL = 0x8 |
|
338 PTRACE_LWPEVENTS = 0x18 |
|
339 PTRACE_LWPINFO = 0xd |
|
340 PTRACE_SETFPREGS = 0x24 |
|
341 PTRACE_SETREGS = 0x22 |
|
342 PTRACE_SINGLESTEP = 0x9 |
|
343 PTRACE_TRACEME = 0x0 |
|
344 ) |
|
345 |
|
346 const ( |
|
347 PIOD_READ_D = 0x1 |
|
348 PIOD_WRITE_D = 0x2 |
|
349 PIOD_READ_I = 0x3 |
|
350 PIOD_WRITE_I = 0x4 |
|
351 ) |
|
352 |
|
353 const ( |
|
354 PL_FLAG_BORN = 0x100 |
|
355 PL_FLAG_EXITED = 0x200 |
|
356 PL_FLAG_SI = 0x20 |
|
357 ) |
|
358 |
|
359 const ( |
|
360 TRAP_BRKPT = 0x1 |
|
361 TRAP_TRACE = 0x2 |
|
362 ) |
|
363 |
|
364 type PtraceLwpInfoStruct struct { |
|
365 Lwpid int32 |
|
366 Event int32 |
|
367 Flags int32 |
|
368 Sigmask Sigset_t |
|
369 Siglist Sigset_t |
|
370 Siginfo __Siginfo |
|
371 Tdname [20]int8 |
|
372 Child_pid int32 |
|
373 Syscall_code uint32 |
|
374 Syscall_narg uint32 |
|
375 } |
|
376 |
|
377 type __Siginfo struct { |
|
378 Signo int32 |
|
379 Errno int32 |
|
380 Code int32 |
|
381 Pid int32 |
|
382 Uid uint32 |
|
383 Status int32 |
|
384 Addr *byte |
|
385 Value [4]byte |
|
386 X_reason [32]byte |
|
387 } |
|
388 |
|
389 type Sigset_t struct { |
|
390 Val [4]uint32 |
|
391 } |
|
392 |
|
393 type Reg struct { |
|
394 Fs uint32 |
|
395 Es uint32 |
|
396 Ds uint32 |
|
397 Edi uint32 |
|
398 Esi uint32 |
|
399 Ebp uint32 |
|
400 Isp uint32 |
|
401 Ebx uint32 |
|
402 Edx uint32 |
|
403 Ecx uint32 |
|
404 Eax uint32 |
|
405 Trapno uint32 |
|
406 Err uint32 |
|
407 Eip uint32 |
|
408 Cs uint32 |
|
409 Eflags uint32 |
|
410 Esp uint32 |
|
411 Ss uint32 |
|
412 Gs uint32 |
|
413 } |
|
414 |
|
415 type FpReg struct { |
|
416 Env [7]uint32 |
|
417 Acc [8][10]uint8 |
|
418 Ex_sw uint32 |
|
419 Pad [64]uint8 |
|
420 } |
|
421 |
|
422 type PtraceIoDesc struct { |
|
423 Op int32 |
|
424 Offs *byte |
|
425 Addr *byte |
|
426 Len uint32 |
|
427 } |
264 |
428 |
265 type Kevent_t struct { |
429 type Kevent_t struct { |
266 Ident uint32 |
430 Ident uint32 |
267 Filter int16 |
431 Filter int16 |
268 Flags uint16 |
432 Flags uint16 |
270 Data int32 |
434 Data int32 |
271 Udata *byte |
435 Udata *byte |
272 } |
436 } |
273 |
437 |
274 type FdSet struct { |
438 type FdSet struct { |
275 X__fds_bits [32]uint32 |
439 Bits [32]uint32 |
276 } |
440 } |
277 |
441 |
278 const ( |
442 const ( |
279 sizeofIfMsghdr = 0xa8 |
443 sizeofIfMsghdr = 0xa8 |
280 SizeofIfMsghdr = 0x60 |
444 SizeofIfMsghdr = 0x60 |
286 SizeofRtMsghdr = 0x5c |
450 SizeofRtMsghdr = 0x5c |
287 SizeofRtMetrics = 0x38 |
451 SizeofRtMetrics = 0x38 |
288 ) |
452 ) |
289 |
453 |
290 type ifMsghdr struct { |
454 type ifMsghdr struct { |
291 Msglen uint16 |
455 Msglen uint16 |
292 Version uint8 |
456 Version uint8 |
293 Type uint8 |
457 Type uint8 |
294 Addrs int32 |
458 Addrs int32 |
295 Flags int32 |
459 Flags int32 |
296 Index uint16 |
460 Index uint16 |
297 Pad_cgo_0 [2]byte |
461 _ [2]byte |
298 Data ifData |
462 Data ifData |
299 } |
463 } |
300 |
464 |
301 type IfMsghdr struct { |
465 type IfMsghdr struct { |
302 Msglen uint16 |
466 Msglen uint16 |
303 Version uint8 |
467 Version uint8 |
304 Type uint8 |
468 Type uint8 |
305 Addrs int32 |
469 Addrs int32 |
306 Flags int32 |
470 Flags int32 |
307 Index uint16 |
471 Index uint16 |
308 Pad_cgo_0 [2]byte |
472 _ [2]byte |
309 Data IfData |
473 Data IfData |
310 } |
474 } |
311 |
475 |
312 type ifData struct { |
476 type ifData struct { |
313 Type uint8 |
477 Type uint8 |
314 Physical uint8 |
478 Physical uint8 |
315 Addrlen uint8 |
479 Addrlen uint8 |
316 Hdrlen uint8 |
480 Hdrlen uint8 |
317 Link_state uint8 |
481 Link_state uint8 |
318 Vhid uint8 |
482 Vhid uint8 |
319 Datalen uint16 |
483 Datalen uint16 |
320 Mtu uint32 |
484 Mtu uint32 |
321 Metric uint32 |
485 Metric uint32 |
322 Baudrate uint64 |
486 Baudrate uint64 |
323 Ipackets uint64 |
487 Ipackets uint64 |
324 Ierrors uint64 |
488 Ierrors uint64 |
325 Opackets uint64 |
489 Opackets uint64 |
326 Oerrors uint64 |
490 Oerrors uint64 |
327 Collisions uint64 |
491 Collisions uint64 |
328 Ibytes uint64 |
492 Ibytes uint64 |
329 Obytes uint64 |
493 Obytes uint64 |
330 Imcasts uint64 |
494 Imcasts uint64 |
331 Omcasts uint64 |
495 Omcasts uint64 |
332 Iqdrops uint64 |
496 Iqdrops uint64 |
333 Oqdrops uint64 |
497 Oqdrops uint64 |
334 Noproto uint64 |
498 Noproto uint64 |
335 Hwassist uint64 |
499 Hwassist uint64 |
336 X__ifi_epoch [8]byte |
500 _ [8]byte |
337 X__ifi_lastchange [16]byte |
501 _ [16]byte |
338 } |
502 } |
339 |
503 |
340 type IfData struct { |
504 type IfData struct { |
341 Type uint8 |
505 Type uint8 |
342 Physical uint8 |
506 Physical uint8 |
364 Epoch int32 |
528 Epoch int32 |
365 Lastchange Timeval |
529 Lastchange Timeval |
366 } |
530 } |
367 |
531 |
368 type IfaMsghdr struct { |
532 type IfaMsghdr struct { |
369 Msglen uint16 |
533 Msglen uint16 |
370 Version uint8 |
534 Version uint8 |
371 Type uint8 |
535 Type uint8 |
372 Addrs int32 |
536 Addrs int32 |
373 Flags int32 |
537 Flags int32 |
374 Index uint16 |
538 Index uint16 |
375 Pad_cgo_0 [2]byte |
539 _ [2]byte |
376 Metric int32 |
540 Metric int32 |
377 } |
541 } |
378 |
542 |
379 type IfmaMsghdr struct { |
543 type IfmaMsghdr struct { |
380 Msglen uint16 |
544 Msglen uint16 |
381 Version uint8 |
545 Version uint8 |
382 Type uint8 |
546 Type uint8 |
383 Addrs int32 |
547 Addrs int32 |
384 Flags int32 |
548 Flags int32 |
385 Index uint16 |
549 Index uint16 |
386 Pad_cgo_0 [2]byte |
550 _ [2]byte |
387 } |
551 } |
388 |
552 |
389 type IfAnnounceMsghdr struct { |
553 type IfAnnounceMsghdr struct { |
390 Msglen uint16 |
554 Msglen uint16 |
391 Version uint8 |
555 Version uint8 |
394 Name [16]int8 |
558 Name [16]int8 |
395 What uint16 |
559 What uint16 |
396 } |
560 } |
397 |
561 |
398 type RtMsghdr struct { |
562 type RtMsghdr struct { |
399 Msglen uint16 |
563 Msglen uint16 |
400 Version uint8 |
564 Version uint8 |
401 Type uint8 |
565 Type uint8 |
402 Index uint16 |
566 Index uint16 |
403 Pad_cgo_0 [2]byte |
567 _ [2]byte |
404 Flags int32 |
568 Flags int32 |
405 Addrs int32 |
569 Addrs int32 |
406 Pid int32 |
570 Pid int32 |
407 Seq int32 |
571 Seq int32 |
408 Errno int32 |
572 Errno int32 |
409 Fmask int32 |
573 Fmask int32 |
410 Inits uint32 |
574 Inits uint32 |
411 Rmx RtMetrics |
575 Rmx RtMetrics |
412 } |
576 } |
413 |
577 |
414 type RtMetrics struct { |
578 type RtMetrics struct { |
415 Locks uint32 |
579 Locks uint32 |
416 Mtu uint32 |
580 Mtu uint32 |
463 Jf uint8 |
627 Jf uint8 |
464 K uint32 |
628 K uint32 |
465 } |
629 } |
466 |
630 |
467 type BpfHdr struct { |
631 type BpfHdr struct { |
468 Tstamp Timeval |
632 Tstamp Timeval |
469 Caplen uint32 |
633 Caplen uint32 |
470 Datalen uint32 |
634 Datalen uint32 |
471 Hdrlen uint16 |
635 Hdrlen uint16 |
472 Pad_cgo_0 [2]byte |
636 _ [2]byte |
473 } |
637 } |
474 |
638 |
475 type BpfZbufHeader struct { |
639 type BpfZbufHeader struct { |
476 Kernel_gen uint32 |
640 Kernel_gen uint32 |
477 Kernel_len uint32 |
641 Kernel_len uint32 |
478 User_gen uint32 |
642 User_gen uint32 |
479 X_bzh_pad [5]uint32 |
643 _ [5]uint32 |
480 } |
644 } |
481 |
645 |
482 type Termios struct { |
646 type Termios struct { |
483 Iflag uint32 |
647 Iflag uint32 |
484 Oflag uint32 |
648 Oflag uint32 |
532 Nodename [256]byte |
696 Nodename [256]byte |
533 Release [256]byte |
697 Release [256]byte |
534 Version [256]byte |
698 Version [256]byte |
535 Machine [256]byte |
699 Machine [256]byte |
536 } |
700 } |
|
701 |
|
702 const SizeofClockinfo = 0x14 |
|
703 |
|
704 type Clockinfo struct { |
|
705 Hz int32 |
|
706 Tick int32 |
|
707 Spare int32 |
|
708 Stathz int32 |
|
709 Profhz int32 |
|
710 } |