package syscall
import
func ( []byte, , uintptr) ( uint64, bool) {
if len() < int(+) {
return 0, false
}
if isBigEndian {
return readIntBE([:], ), true
}
return readIntLE([:], ), true
}
func ( []byte, uintptr) uint64 {
switch {
case 1:
return uint64([0])
case 2:
_ = [1]
return uint64([1]) | uint64([0])<<8
case 4:
_ = [3]
return uint64([3]) | uint64([2])<<8 | uint64([1])<<16 | uint64([0])<<24
case 8:
_ = [7]
return uint64([7]) | uint64([6])<<8 | uint64([5])<<16 | uint64([4])<<24 |
uint64([3])<<32 | uint64([2])<<40 | uint64([1])<<48 | uint64([0])<<56
default:
panic("syscall: readInt with unsupported size")
}
}
func ( []byte, uintptr) uint64 {
switch {
case 1:
return uint64([0])
case 2:
_ = [1]
return uint64([0]) | uint64([1])<<8
case 4:
_ = [3]
return uint64([0]) | uint64([1])<<8 | uint64([2])<<16 | uint64([3])<<24
case 8:
_ = [7]
return uint64([0]) | uint64([1])<<8 | uint64([2])<<16 | uint64([3])<<24 |
uint64([4])<<32 | uint64([5])<<40 | uint64([6])<<48 | uint64([7])<<56
default:
panic("syscall: readInt with unsupported size")
}
}
func ( []byte, int, []string) ( int, int, []string) {
:= len()
= 0
for != 0 && len() > 0 {
, := direntReclen()
if ! || > uint64(len()) {
return , ,
}
:= [:]
= [:]
, := direntIno()
if ! {
break
}
if == 0 {
continue
}
const = uint64(unsafe.Offsetof(Dirent{}.Name))
, := direntNamlen()
if ! || + > uint64(len()) {
break
}
:= [ : +]
for , := range {
if == 0 {
= [:]
break
}
}
if string() == "." || string() == ".." {
continue
}
--
++
= append(, string())
}
return - len(), ,
}