Skip to content

Commit 45d2b45

Browse files
EdSchoutenianlancetaylor
authored andcommitted
unix: add mount(2) for macOS
The 'data' argument of this method needs to point to a file system type specific data structure. In the case of NFS (which I'm interested in using), this needs to point to an XDR encoded message. The schema for this message can be found here: https://github.com/apple-oss-distributions/NFS/blob/main/mount_nfs/nfs_sys_prot.x Change-Id: Ia49562ba6e8ab5d4c00eb961db6862fb1310b74e GitHub-Last-Rev: 62c32df GitHub-Pull-Request: #125 Reviewed-on: https://go-review.googlesource.com/c/sys/+/405494 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]>
1 parent 988cb79 commit 45d2b45

7 files changed

+63
-1
lines changed

unix/darwin_amd64_test.go

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

unix/darwin_arm64_test.go

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

unix/syscall_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
504504
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
505505
//sys Mkfifo(path string, mode uint32) (err error)
506506
//sys Mknod(path string, mode uint32, dev int) (err error)
507+
//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error)
507508
//sys Open(path string, mode int, perm uint32) (fd int, err error)
508509
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
509510
//sys Pathconf(path string, name int) (val int, err error)
@@ -572,7 +573,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
572573
// Nfssvc
573574
// Getfh
574575
// Quotactl
575-
// Mount
576576
// Csops
577577
// Waitid
578578
// Add_profil

unix/zsyscall_darwin_amd64.go

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

unix/zsyscall_darwin_amd64.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0
600600
GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8
601601
DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB)
602602

603+
TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
604+
JMP libc_mount(SB)
605+
606+
GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
607+
DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
608+
603609
TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0
604610
JMP libc_open(SB)
605611

unix/zsyscall_darwin_arm64.go

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

unix/zsyscall_darwin_arm64.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0
600600
GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8
601601
DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB)
602602

603+
TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
604+
JMP libc_mount(SB)
605+
606+
GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
607+
DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
608+
603609
TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0
604610
JMP libc_open(SB)
605611

0 commit comments

Comments
 (0)