1
2
3
4
5
6
7
8 package unix
9
10 import (
11 "unsafe"
12 )
13
14 const _SYS_GETDIRENTRIES64 = 344
15
16 func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
17
18
19
20 var p unsafe.Pointer
21 if len(buf) > 0 {
22 p = unsafe.Pointer(&buf[0])
23 } else {
24 p = unsafe.Pointer(&_zero)
25 }
26 r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
27 n = int(r0)
28 if e1 != 0 {
29 return n, errnoErr(e1)
30 }
31 return n, nil
32 }
33
View as plain text