From 7d3fd4f3c46e57c703128bbabb385424f338d6d9 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 25 Sep 2020 18:06:26 +0200 Subject: syscall: implement Getwd using getcwd from libSystem on darwin Directly wrap the getcwd implementation provided by libSystem.dylib on darwin and use it to implement Getwd like on the BSDs. This allows to drop the custom implementation using getAttrList and to merge the implementation of Getwd for darwin and the BSDs in syscall_bsd.go. Same as CL 257497 did for golang.org/x/sys/unix Change-Id: If30390c4c17cd463bb8fdcb5465f40d6fa11f391 Reviewed-on: https://go-review.googlesource.com/c/go/+/257637 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/syscall/types_darwin.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/syscall/types_darwin.go') diff --git a/src/syscall/types_darwin.go b/src/syscall/types_darwin.go index d8218d6aea..7b3a9d2335 100644 --- a/src/syscall/types_darwin.go +++ b/src/syscall/types_darwin.go @@ -123,6 +123,12 @@ type Fsid C.struct_fsid type Dirent C.struct_dirent +// File system limits + +const ( + pathMax = C.PATH_MAX +) + // Sockets type RawSockaddrInet4 C.struct_sockaddr_in -- cgit v1.3