Source file src/runtime/sys_darwin.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package runtime
     6  
     7  import (
     8  	"internal/abi"
     9  	"unsafe"
    10  )
    11  
    12  // The X versions of syscall expect the libc call to return a 64-bit result.
    13  // Otherwise (the non-X version) expects a 32-bit result.
    14  // This distinction is required because an error is indicated by returning -1,
    15  // and we need to know whether to check 32 or 64 bits of the result.
    16  // (Some libc functions that return 32 bits put junk in the upper 32 bits of AX.)
    17  
    18  //go:linkname syscall_syscall syscall.syscall
    19  //go:nosplit
    20  func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
    21  	args := struct{ fn, a1, a2, a3, r1, r2, err uintptr }{fn, a1, a2, a3, r1, r2, err}
    22  	entersyscall()
    23  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall)), unsafe.Pointer(&args))
    24  	exitsyscall()
    25  	return args.r1, args.r2, args.err
    26  }
    27  func syscall()
    28  
    29  //go:linkname syscall_syscallX syscall.syscallX
    30  //go:nosplit
    31  func syscall_syscallX(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
    32  	args := struct{ fn, a1, a2, a3, r1, r2, err uintptr }{fn, a1, a2, a3, r1, r2, err}
    33  	entersyscall()
    34  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscallX)), unsafe.Pointer(&args))
    35  	exitsyscall()
    36  	return args.r1, args.r2, args.err
    37  }
    38  func syscallX()
    39  
    40  //go:linkname syscall_syscall6 syscall.syscall6
    41  //go:nosplit
    42  func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
    43  	args := struct{ fn, a1, a2, a3, a4, a5, a6, r1, r2, err uintptr }{fn, a1, a2, a3, a4, a5, a6, r1, r2, err}
    44  	entersyscall()
    45  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall6)), unsafe.Pointer(&args))
    46  	exitsyscall()
    47  	return args.r1, args.r2, args.err
    48  }
    49  func syscall6()
    50  
    51  //go:linkname syscall_syscall6X syscall.syscall6X
    52  //go:nosplit
    53  func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
    54  	args := struct{ fn, a1, a2, a3, a4, a5, a6, r1, r2, err uintptr }{fn, a1, a2, a3, a4, a5, a6, r1, r2, err}
    55  	entersyscall()
    56  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall6X)), unsafe.Pointer(&args))
    57  	exitsyscall()
    58  	return args.r1, args.r2, args.err
    59  }
    60  func syscall6X()
    61  
    62  //go:linkname syscall_syscallPtr syscall.syscallPtr
    63  //go:nosplit
    64  func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
    65  	args := struct{ fn, a1, a2, a3, r1, r2, err uintptr }{fn, a1, a2, a3, r1, r2, err}
    66  	entersyscall()
    67  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscallPtr)), unsafe.Pointer(&args))
    68  	exitsyscall()
    69  	return args.r1, args.r2, args.err
    70  }
    71  func syscallPtr()
    72  
    73  //go:linkname syscall_rawSyscall syscall.rawSyscall
    74  //go:nosplit
    75  func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
    76  	args := struct{ fn, a1, a2, a3, r1, r2, err uintptr }{fn, a1, a2, a3, r1, r2, err}
    77  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall)), unsafe.Pointer(&args))
    78  	return args.r1, args.r2, args.err
    79  }
    80  
    81  //go:linkname syscall_rawSyscall6 syscall.rawSyscall6
    82  //go:nosplit
    83  func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
    84  	args := struct{ fn, a1, a2, a3, a4, a5, a6, r1, r2, err uintptr }{fn, a1, a2, a3, a4, a5, a6, r1, r2, err}
    85  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall6)), unsafe.Pointer(&args))
    86  	return args.r1, args.r2, args.err
    87  }
    88  
    89  // syscallNoErr is used in crypto/x509 to call into Security.framework and CF.
    90  
    91  //go:linkname crypto_x509_syscall crypto/x509/internal/macos.syscall
    92  //go:nosplit
    93  func crypto_x509_syscall(fn, a1, a2, a3, a4, a5 uintptr, f1 float64) (r1 uintptr) {
    94  	args := struct {
    95  		fn, a1, a2, a3, a4, a5 uintptr
    96  		f1                     float64
    97  		r1                     uintptr
    98  	}{fn, a1, a2, a3, a4, a5, f1, r1}
    99  	entersyscall()
   100  	libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall_x509)), unsafe.Pointer(&args))
   101  	exitsyscall()
   102  	return args.r1
   103  }
   104  func syscall_x509()
   105  
   106  // The *_trampoline functions convert from the Go calling convention to the C calling convention
   107  // and then call the underlying libc function.  They are defined in sys_darwin_$ARCH.s.
   108  
   109  //go:nosplit
   110  //go:cgo_unsafe_args
   111  func pthread_attr_init(attr *pthreadattr) int32 {
   112  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_attr_init_trampoline)), unsafe.Pointer(&attr))
   113  	KeepAlive(attr)
   114  	return ret
   115  }
   116  func pthread_attr_init_trampoline()
   117  
   118  //go:nosplit
   119  //go:cgo_unsafe_args
   120  func pthread_attr_getstacksize(attr *pthreadattr, size *uintptr) int32 {
   121  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_attr_getstacksize_trampoline)), unsafe.Pointer(&attr))
   122  	KeepAlive(attr)
   123  	KeepAlive(size)
   124  	return ret
   125  }
   126  func pthread_attr_getstacksize_trampoline()
   127  
   128  //go:nosplit
   129  //go:cgo_unsafe_args
   130  func pthread_attr_setdetachstate(attr *pthreadattr, state int) int32 {
   131  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_attr_setdetachstate_trampoline)), unsafe.Pointer(&attr))
   132  	KeepAlive(attr)
   133  	return ret
   134  }
   135  func pthread_attr_setdetachstate_trampoline()
   136  
   137  //go:nosplit
   138  //go:cgo_unsafe_args
   139  func pthread_create(attr *pthreadattr, start uintptr, arg unsafe.Pointer) int32 {
   140  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_create_trampoline)), unsafe.Pointer(&attr))
   141  	KeepAlive(attr)
   142  	KeepAlive(arg) // Just for consistency. Arg of course needs to be kept alive for the start function.
   143  	return ret
   144  }
   145  func pthread_create_trampoline()
   146  
   147  //go:nosplit
   148  //go:cgo_unsafe_args
   149  func raise(sig uint32) {
   150  	libcCall(unsafe.Pointer(abi.FuncPCABI0(raise_trampoline)), unsafe.Pointer(&sig))
   151  }
   152  func raise_trampoline()
   153  
   154  //go:nosplit
   155  //go:cgo_unsafe_args
   156  func pthread_self() (t pthread) {
   157  	libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_self_trampoline)), unsafe.Pointer(&t))
   158  	return
   159  }
   160  func pthread_self_trampoline()
   161  
   162  //go:nosplit
   163  //go:cgo_unsafe_args
   164  func pthread_kill(t pthread, sig uint32) {
   165  	libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_kill_trampoline)), unsafe.Pointer(&t))
   166  	return
   167  }
   168  func pthread_kill_trampoline()
   169  
   170  // mmap is used to do low-level memory allocation via mmap. Don't allow stack
   171  // splits, since this function (used by sysAlloc) is called in a lot of low-level
   172  // parts of the runtime and callers often assume it won't acquire any locks.
   173  //
   174  //go:nosplit
   175  func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (unsafe.Pointer, int) {
   176  	args := struct {
   177  		addr            unsafe.Pointer
   178  		n               uintptr
   179  		prot, flags, fd int32
   180  		off             uint32
   181  		ret1            unsafe.Pointer
   182  		ret2            int
   183  	}{addr, n, prot, flags, fd, off, nil, 0}
   184  	libcCall(unsafe.Pointer(abi.FuncPCABI0(mmap_trampoline)), unsafe.Pointer(&args))
   185  	return args.ret1, args.ret2
   186  }
   187  func mmap_trampoline()
   188  
   189  //go:nosplit
   190  //go:cgo_unsafe_args
   191  func munmap(addr unsafe.Pointer, n uintptr) {
   192  	libcCall(unsafe.Pointer(abi.FuncPCABI0(munmap_trampoline)), unsafe.Pointer(&addr))
   193  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   194  }
   195  func munmap_trampoline()
   196  
   197  //go:nosplit
   198  //go:cgo_unsafe_args
   199  func madvise(addr unsafe.Pointer, n uintptr, flags int32) {
   200  	libcCall(unsafe.Pointer(abi.FuncPCABI0(madvise_trampoline)), unsafe.Pointer(&addr))
   201  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   202  }
   203  func madvise_trampoline()
   204  
   205  //go:nosplit
   206  //go:cgo_unsafe_args
   207  func mlock(addr unsafe.Pointer, n uintptr) {
   208  	libcCall(unsafe.Pointer(abi.FuncPCABI0(mlock_trampoline)), unsafe.Pointer(&addr))
   209  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   210  }
   211  func mlock_trampoline()
   212  
   213  //go:nosplit
   214  //go:cgo_unsafe_args
   215  func read(fd int32, p unsafe.Pointer, n int32) int32 {
   216  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(read_trampoline)), unsafe.Pointer(&fd))
   217  	KeepAlive(p)
   218  	return ret
   219  }
   220  func read_trampoline()
   221  
   222  func pipe() (r, w int32, errno int32) {
   223  	var p [2]int32
   224  	errno = libcCall(unsafe.Pointer(abi.FuncPCABI0(pipe_trampoline)), noescape(unsafe.Pointer(&p)))
   225  	return p[0], p[1], errno
   226  }
   227  func pipe_trampoline()
   228  
   229  //go:nosplit
   230  //go:cgo_unsafe_args
   231  func closefd(fd int32) int32 {
   232  	return libcCall(unsafe.Pointer(abi.FuncPCABI0(close_trampoline)), unsafe.Pointer(&fd))
   233  }
   234  func close_trampoline()
   235  
   236  // This is exported via linkname to assembly in runtime/cgo.
   237  //
   238  //go:nosplit
   239  //go:cgo_unsafe_args
   240  //go:linkname exit
   241  func exit(code int32) {
   242  	libcCall(unsafe.Pointer(abi.FuncPCABI0(exit_trampoline)), unsafe.Pointer(&code))
   243  }
   244  func exit_trampoline()
   245  
   246  //go:nosplit
   247  //go:cgo_unsafe_args
   248  func usleep(usec uint32) {
   249  	libcCall(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
   250  }
   251  func usleep_trampoline()
   252  
   253  //go:nosplit
   254  //go:cgo_unsafe_args
   255  func usleep_no_g(usec uint32) {
   256  	asmcgocall_no_g(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
   257  }
   258  
   259  //go:nosplit
   260  //go:cgo_unsafe_args
   261  func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
   262  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(write_trampoline)), unsafe.Pointer(&fd))
   263  	KeepAlive(p)
   264  	return ret
   265  }
   266  func write_trampoline()
   267  
   268  //go:nosplit
   269  //go:cgo_unsafe_args
   270  func open(name *byte, mode, perm int32) (ret int32) {
   271  	ret = libcCall(unsafe.Pointer(abi.FuncPCABI0(open_trampoline)), unsafe.Pointer(&name))
   272  	KeepAlive(name)
   273  	return
   274  }
   275  func open_trampoline()
   276  
   277  //go:nosplit
   278  //go:cgo_unsafe_args
   279  func nanotime1() int64 {
   280  	var r struct {
   281  		t            int64  // raw timer
   282  		numer, denom uint32 // conversion factors. nanoseconds = t * numer / denom.
   283  	}
   284  	libcCall(unsafe.Pointer(abi.FuncPCABI0(nanotime_trampoline)), unsafe.Pointer(&r))
   285  	// Note: Apple seems unconcerned about overflow here. See
   286  	// https://developer.apple.com/library/content/qa/qa1398/_index.html
   287  	// Note also, numer == denom == 1 is common.
   288  	t := r.t
   289  	if r.numer != 1 {
   290  		t *= int64(r.numer)
   291  	}
   292  	if r.denom != 1 {
   293  		t /= int64(r.denom)
   294  	}
   295  	return t
   296  }
   297  func nanotime_trampoline()
   298  
   299  //go:nosplit
   300  //go:cgo_unsafe_args
   301  func walltime() (int64, int32) {
   302  	var t timespec
   303  	libcCall(unsafe.Pointer(abi.FuncPCABI0(walltime_trampoline)), unsafe.Pointer(&t))
   304  	return t.tv_sec, int32(t.tv_nsec)
   305  }
   306  func walltime_trampoline()
   307  
   308  //go:nosplit
   309  //go:cgo_unsafe_args
   310  func sigaction(sig uint32, new *usigactiont, old *usigactiont) {
   311  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigaction_trampoline)), unsafe.Pointer(&sig))
   312  	KeepAlive(new)
   313  	KeepAlive(old)
   314  }
   315  func sigaction_trampoline()
   316  
   317  //go:nosplit
   318  //go:cgo_unsafe_args
   319  func sigprocmask(how uint32, new *sigset, old *sigset) {
   320  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigprocmask_trampoline)), unsafe.Pointer(&how))
   321  	KeepAlive(new)
   322  	KeepAlive(old)
   323  }
   324  func sigprocmask_trampoline()
   325  
   326  //go:nosplit
   327  //go:cgo_unsafe_args
   328  func sigaltstack(new *stackt, old *stackt) {
   329  	if new != nil && new.ss_flags&_SS_DISABLE != 0 && new.ss_size == 0 {
   330  		// Despite the fact that Darwin's sigaltstack man page says it ignores the size
   331  		// when SS_DISABLE is set, it doesn't. sigaltstack returns ENOMEM
   332  		// if we don't give it a reasonable size.
   333  		// ref: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140421/214296.html
   334  		new.ss_size = 32768
   335  	}
   336  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigaltstack_trampoline)), unsafe.Pointer(&new))
   337  	KeepAlive(new)
   338  	KeepAlive(old)
   339  }
   340  func sigaltstack_trampoline()
   341  
   342  //go:nosplit
   343  //go:cgo_unsafe_args
   344  func raiseproc(sig uint32) {
   345  	libcCall(unsafe.Pointer(abi.FuncPCABI0(raiseproc_trampoline)), unsafe.Pointer(&sig))
   346  }
   347  func raiseproc_trampoline()
   348  
   349  //go:nosplit
   350  //go:cgo_unsafe_args
   351  func setitimer(mode int32, new, old *itimerval) {
   352  	libcCall(unsafe.Pointer(abi.FuncPCABI0(setitimer_trampoline)), unsafe.Pointer(&mode))
   353  	KeepAlive(new)
   354  	KeepAlive(old)
   355  }
   356  func setitimer_trampoline()
   357  
   358  //go:nosplit
   359  //go:cgo_unsafe_args
   360  func sysctl(mib *uint32, miblen uint32, oldp *byte, oldlenp *uintptr, newp *byte, newlen uintptr) int32 {
   361  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(sysctl_trampoline)), unsafe.Pointer(&mib))
   362  	KeepAlive(mib)
   363  	KeepAlive(oldp)
   364  	KeepAlive(oldlenp)
   365  	KeepAlive(newp)
   366  	return ret
   367  }
   368  func sysctl_trampoline()
   369  
   370  //go:nosplit
   371  //go:cgo_unsafe_args
   372  func sysctlbyname(name *byte, oldp *byte, oldlenp *uintptr, newp *byte, newlen uintptr) int32 {
   373  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(sysctlbyname_trampoline)), unsafe.Pointer(&name))
   374  	KeepAlive(name)
   375  	KeepAlive(oldp)
   376  	KeepAlive(oldlenp)
   377  	KeepAlive(newp)
   378  	return ret
   379  }
   380  func sysctlbyname_trampoline()
   381  
   382  //go:nosplit
   383  //go:cgo_unsafe_args
   384  func fcntl(fd, cmd, arg int32) int32 {
   385  	return libcCall(unsafe.Pointer(abi.FuncPCABI0(fcntl_trampoline)), unsafe.Pointer(&fd))
   386  }
   387  func fcntl_trampoline()
   388  
   389  //go:nosplit
   390  //go:cgo_unsafe_args
   391  func kqueue() int32 {
   392  	v := libcCall(unsafe.Pointer(abi.FuncPCABI0(kqueue_trampoline)), nil)
   393  	return v
   394  }
   395  func kqueue_trampoline()
   396  
   397  //go:nosplit
   398  //go:cgo_unsafe_args
   399  func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32 {
   400  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(kevent_trampoline)), unsafe.Pointer(&kq))
   401  	KeepAlive(ch)
   402  	KeepAlive(ev)
   403  	KeepAlive(ts)
   404  	return ret
   405  }
   406  func kevent_trampoline()
   407  
   408  //go:nosplit
   409  //go:cgo_unsafe_args
   410  func pthread_mutex_init(m *pthreadmutex, attr *pthreadmutexattr) int32 {
   411  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_init_trampoline)), unsafe.Pointer(&m))
   412  	KeepAlive(m)
   413  	KeepAlive(attr)
   414  	return ret
   415  }
   416  func pthread_mutex_init_trampoline()
   417  
   418  //go:nosplit
   419  //go:cgo_unsafe_args
   420  func pthread_mutex_lock(m *pthreadmutex) int32 {
   421  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_lock_trampoline)), unsafe.Pointer(&m))
   422  	KeepAlive(m)
   423  	return ret
   424  }
   425  func pthread_mutex_lock_trampoline()
   426  
   427  //go:nosplit
   428  //go:cgo_unsafe_args
   429  func pthread_mutex_unlock(m *pthreadmutex) int32 {
   430  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_unlock_trampoline)), unsafe.Pointer(&m))
   431  	KeepAlive(m)
   432  	return ret
   433  }
   434  func pthread_mutex_unlock_trampoline()
   435  
   436  //go:nosplit
   437  //go:cgo_unsafe_args
   438  func pthread_cond_init(c *pthreadcond, attr *pthreadcondattr) int32 {
   439  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_init_trampoline)), unsafe.Pointer(&c))
   440  	KeepAlive(c)
   441  	KeepAlive(attr)
   442  	return ret
   443  }
   444  func pthread_cond_init_trampoline()
   445  
   446  //go:nosplit
   447  //go:cgo_unsafe_args
   448  func pthread_cond_wait(c *pthreadcond, m *pthreadmutex) int32 {
   449  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_wait_trampoline)), unsafe.Pointer(&c))
   450  	KeepAlive(c)
   451  	KeepAlive(m)
   452  	return ret
   453  }
   454  func pthread_cond_wait_trampoline()
   455  
   456  //go:nosplit
   457  //go:cgo_unsafe_args
   458  func pthread_cond_timedwait_relative_np(c *pthreadcond, m *pthreadmutex, t *timespec) int32 {
   459  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_timedwait_relative_np_trampoline)), unsafe.Pointer(&c))
   460  	KeepAlive(c)
   461  	KeepAlive(m)
   462  	KeepAlive(t)
   463  	return ret
   464  }
   465  func pthread_cond_timedwait_relative_np_trampoline()
   466  
   467  //go:nosplit
   468  //go:cgo_unsafe_args
   469  func pthread_cond_signal(c *pthreadcond) int32 {
   470  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_signal_trampoline)), unsafe.Pointer(&c))
   471  	KeepAlive(c)
   472  	return ret
   473  }
   474  func pthread_cond_signal_trampoline()
   475  
   476  // Not used on Darwin, but must be defined.
   477  func exitThread(wait *uint32) {
   478  }
   479  
   480  //go:nosplit
   481  func closeonexec(fd int32) {
   482  	fcntl(fd, _F_SETFD, _FD_CLOEXEC)
   483  }
   484  
   485  //go:nosplit
   486  func setNonblock(fd int32) {
   487  	flags := fcntl(fd, _F_GETFL, 0)
   488  	fcntl(fd, _F_SETFL, flags|_O_NONBLOCK)
   489  }
   490  
   491  // Tell the linker that the libc_* functions are to be found
   492  // in a system library, with the libc_ prefix missing.
   493  
   494  //go:cgo_import_dynamic libc_pthread_attr_init pthread_attr_init "/usr/lib/libSystem.B.dylib"
   495  //go:cgo_import_dynamic libc_pthread_attr_getstacksize pthread_attr_getstacksize "/usr/lib/libSystem.B.dylib"
   496  //go:cgo_import_dynamic libc_pthread_attr_setdetachstate pthread_attr_setdetachstate "/usr/lib/libSystem.B.dylib"
   497  //go:cgo_import_dynamic libc_pthread_create pthread_create "/usr/lib/libSystem.B.dylib"
   498  //go:cgo_import_dynamic libc_pthread_self pthread_self "/usr/lib/libSystem.B.dylib"
   499  //go:cgo_import_dynamic libc_pthread_kill pthread_kill "/usr/lib/libSystem.B.dylib"
   500  //go:cgo_import_dynamic libc_exit _exit "/usr/lib/libSystem.B.dylib"
   501  //go:cgo_import_dynamic libc_raise raise "/usr/lib/libSystem.B.dylib"
   502  
   503  //go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
   504  //go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
   505  //go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
   506  //go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
   507  //go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
   508  
   509  //go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
   510  //go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
   511  //go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
   512  //go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
   513  //go:cgo_import_dynamic libc_error __error "/usr/lib/libSystem.B.dylib"
   514  //go:cgo_import_dynamic libc_usleep usleep "/usr/lib/libSystem.B.dylib"
   515  
   516  //go:cgo_import_dynamic libc_mach_timebase_info mach_timebase_info "/usr/lib/libSystem.B.dylib"
   517  //go:cgo_import_dynamic libc_mach_absolute_time mach_absolute_time "/usr/lib/libSystem.B.dylib"
   518  //go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
   519  //go:cgo_import_dynamic libc_sigaction sigaction "/usr/lib/libSystem.B.dylib"
   520  //go:cgo_import_dynamic libc_pthread_sigmask pthread_sigmask "/usr/lib/libSystem.B.dylib"
   521  //go:cgo_import_dynamic libc_sigaltstack sigaltstack "/usr/lib/libSystem.B.dylib"
   522  //go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
   523  //go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
   524  //go:cgo_import_dynamic libc_setitimer setitimer "/usr/lib/libSystem.B.dylib"
   525  //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
   526  //go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib"
   527  //go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
   528  //go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
   529  //go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
   530  
   531  //go:cgo_import_dynamic libc_pthread_mutex_init pthread_mutex_init "/usr/lib/libSystem.B.dylib"
   532  //go:cgo_import_dynamic libc_pthread_mutex_lock pthread_mutex_lock "/usr/lib/libSystem.B.dylib"
   533  //go:cgo_import_dynamic libc_pthread_mutex_unlock pthread_mutex_unlock "/usr/lib/libSystem.B.dylib"
   534  //go:cgo_import_dynamic libc_pthread_cond_init pthread_cond_init "/usr/lib/libSystem.B.dylib"
   535  //go:cgo_import_dynamic libc_pthread_cond_wait pthread_cond_wait "/usr/lib/libSystem.B.dylib"
   536  //go:cgo_import_dynamic libc_pthread_cond_timedwait_relative_np pthread_cond_timedwait_relative_np "/usr/lib/libSystem.B.dylib"
   537  //go:cgo_import_dynamic libc_pthread_cond_signal pthread_cond_signal "/usr/lib/libSystem.B.dylib"
   538  

View as plain text