-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: implement Getwd on OS X #4807
Labels
Milestone
Comments
$ go run getwd.go size=28 buf="\x1c\x00\x00\x00\b\x00\x00\x00\x10\x00\x00\x00/Users/bradfitz\x00" GetAttrList = <nil> package main import ( "fmt" "syscall" "unsafe" ) const ( AttrBitMapCount = 5 AttrCmnFullpath = 0x08000000 ) type AttrList struct { BitmapCount uint16 _ uint16 CommonAttr uint32 VolAttr uint32 DirAttr uint32 FileAttr uint32 Forkattr uint32 } func GetAttrList(path string, attrs AttrList, options uint) error { attrs.BitmapCount = 5 var _p0 *byte _p0, err := syscall.BytePtrFromString(path) if err != nil { return err } var buf [4096]byte _, _, e1 := syscall.Syscall6( syscall.SYS_GETATTRLIST, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(&attrs)), uintptr(unsafe.Pointer(&buf[0])), uintptr(4096), uintptr(options), 0, ) if e1 != 0 { return e1 } size := *(*uint32)(unsafe.Pointer(&buf[0])) fmt.Printf("size=%v buf=%q\n", size, buf[:size]) return nil } func main() { err := GetAttrList(".", AttrList{CommonAttr: AttrCmnFullpath}, 0) fmt.Printf("GetAttrList = %v\n", err) } |
https://golang.org/cl/12349044/ Owner changed to @bradfitz. Status changed to Started. |
This issue was closed by revision 7963ba6. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: