Переглянути джерело

x/sys/unix: remove the SYS___SYSCTL manual edit for darwin/amd64.

In commit e3fe6f5 I manually renamed SYS_SYSCTL to SYS___SYSCTL so that
syscall_bsd.go would continue to build, despite a rename of __sysctl to
sysctl somewhere between these two XNU versions:

    http://www.opensource.apple.com/source/xnu/xnu-2422.90.20/bsd/kern/syscalls.master
    http://www.opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/kern/syscalls.master

In this commit I add a workaround that doesn't require manual edits to
autogenerated output, so regenerating the output should now cause no
diffs.

Change-Id: I0286484e7efcf9762ce39e5dcc7a8366e3798a77
Reviewed-on: https://go-review.googlesource.com/14091
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Aaron Jacobs 10 роки тому
батько
коміт
9ef4b6c1ff
2 змінених файлів з 5 додано та 1 видалено
  1. 4 0
      unix/syscall_darwin_amd64.go
  2. 1 1
      unix/zsysnum_darwin_amd64.go

+ 4 - 0
unix/syscall_darwin_amd64.go

@@ -73,3 +73,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 }
 }
 
 
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
+
+// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
+// of darwin/amd64 the syscall is called sysctl instead of __sysctl.
+const SYS___SYSCTL = SYS_SYSCTL

+ 1 - 1
unix/zsysnum_darwin_amd64.go

@@ -141,7 +141,7 @@ const (
 	SYS_LSEEK                          = 199
 	SYS_LSEEK                          = 199
 	SYS_TRUNCATE                       = 200
 	SYS_TRUNCATE                       = 200
 	SYS_FTRUNCATE                      = 201
 	SYS_FTRUNCATE                      = 201
-	SYS___SYSCTL                       = 202
+	SYS_SYSCTL                         = 202
 	SYS_MLOCK                          = 203
 	SYS_MLOCK                          = 203
 	SYS_MUNLOCK                        = 204
 	SYS_MUNLOCK                        = 204
 	SYS_UNDELETE                       = 205
 	SYS_UNDELETE                       = 205