Skip to content

Commit 8b8312a

Browse files
committed
unix: avoid "64"-postfixed libSystem calls on iOS
Parallel to CL 151938 for package x/sys/unix instead of syscall. iOS needs to use these functions without the "64" postfix. (The functions do exist, but the App Store bans their use.) Updates golang/go#28984 Change-Id: I6b82950700cc8a1afca612844b05fa007574e008 Reviewed-on: https://go-review.googlesource.com/c/154658 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 45d26eb commit 8b8312a

17 files changed

+812
-790
lines changed

unix/syscall_darwin.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,6 @@ func Uname(uname *Utsname) error {
435435
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
436436
//sys Flock(fd int, how int) (err error)
437437
//sys Fpathconf(fd int, name int) (val int, err error)
438-
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
439-
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
440-
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
441438
//sys Fsync(fd int) (err error)
442439
//sys Ftruncate(fd int, length int64) (err error)
443440
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
@@ -460,7 +457,6 @@ func Uname(uname *Utsname) error {
460457
//sys Link(path string, link string) (err error)
461458
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
462459
//sys Listen(s int, backlog int) (err error)
463-
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
464460
//sys Mkdir(path string, mode uint32) (err error)
465461
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
466462
//sys Mkfifo(path string, mode uint32) (err error)
@@ -492,8 +488,6 @@ func Uname(uname *Utsname) error {
492488
//sysnb Setsid() (pid int, err error)
493489
//sysnb Settimeofday(tp *Timeval) (err error)
494490
//sysnb Setuid(uid int) (err error)
495-
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
496-
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
497491
//sys Symlink(path string, link string) (err error)
498492
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
499493
//sys Sync() (err error)

unix/syscall_darwin_386.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
6666
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
6767
// of darwin/386 the syscall is called sysctl instead of __sysctl.
6868
const SYS___SYSCTL = SYS_SYSCTL
69+
70+
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
71+
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
72+
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
73+
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
74+
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
75+
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64

unix/syscall_darwin_amd64.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
6666
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
6767
// of darwin/amd64 the syscall is called sysctl instead of __sysctl.
6868
const SYS___SYSCTL = SYS_SYSCTL
69+
70+
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
71+
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
72+
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
73+
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
74+
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
75+
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64

unix/syscall_darwin_arm.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
6464
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
6565
// of darwin/arm the syscall is called sysctl instead of __sysctl.
6666
const SYS___SYSCTL = SYS_SYSCTL
67+
68+
//sys Fstat(fd int, stat *Stat_t) (err error)
69+
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
70+
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
71+
//sys Lstat(path string, stat *Stat_t) (err error)
72+
//sys Stat(path string, stat *Stat_t) (err error)
73+
//sys Statfs(path string, stat *Statfs_t) (err error)

unix/syscall_darwin_arm64.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
6666
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
6767
// of darwin/arm64 the syscall is called sysctl instead of __sysctl.
6868
const SYS___SYSCTL = SYS_SYSCTL
69+
70+
//sys Fstat(fd int, stat *Stat_t) (err error)
71+
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
72+
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
73+
//sys Lstat(path string, stat *Stat_t) (err error)
74+
//sys Stat(path string, stat *Stat_t) (err error)
75+
//sys Statfs(path string, stat *Statfs_t) (err error)

unix/zsyscall_darwin_386.1_12.go

Lines changed: 104 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)