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  //go:nosplit
   174  func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (unsafe.Pointer, int) {
   175  	args := struct {
   176  		addr            unsafe.Pointer
   177  		n               uintptr
   178  		prot, flags, fd int32
   179  		off             uint32
   180  		ret1            unsafe.Pointer
   181  		ret2            int
   182  	}{addr, n, prot, flags, fd, off, nil, 0}
   183  	libcCall(unsafe.Pointer(abi.FuncPCABI0(mmap_trampoline)), unsafe.Pointer(&args))
   184  	return args.ret1, args.ret2
   185  }
   186  func mmap_trampoline()
   187  
   188  //go:nosplit
   189  //go:cgo_unsafe_args
   190  func munmap(addr unsafe.Pointer, n uintptr) {
   191  	libcCall(unsafe.Pointer(abi.FuncPCABI0(munmap_trampoline)), unsafe.Pointer(&addr))
   192  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   193  }
   194  func munmap_trampoline()
   195  
   196  //go:nosplit
   197  //go:cgo_unsafe_args
   198  func madvise(addr unsafe.Pointer, n uintptr, flags int32) {
   199  	libcCall(unsafe.Pointer(abi.FuncPCABI0(madvise_trampoline)), unsafe.Pointer(&addr))
   200  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   201  }
   202  func madvise_trampoline()
   203  
   204  //go:nosplit
   205  //go:cgo_unsafe_args
   206  func mlock(addr unsafe.Pointer, n uintptr) {
   207  	libcCall(unsafe.Pointer(abi.FuncPCABI0(mlock_trampoline)), unsafe.Pointer(&addr))
   208  	KeepAlive(addr) // Just for consistency. Hopefully addr is not a Go address.
   209  }
   210  func mlock_trampoline()
   211  
   212  //go:nosplit
   213  //go:cgo_unsafe_args
   214  func read(fd int32, p unsafe.Pointer, n int32) int32 {
   215  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(read_trampoline)), unsafe.Pointer(&fd))
   216  	KeepAlive(p)
   217  	return ret
   218  }
   219  func read_trampoline()
   220  
   221  func pipe() (r, w int32, errno int32) {
   222  	var p [2]int32
   223  	errno = libcCall(unsafe.Pointer(abi.FuncPCABI0(pipe_trampoline)), noescape(unsafe.Pointer(&p)))
   224  	return p[0], p[1], errno
   225  }
   226  func pipe_trampoline()
   227  
   228  //go:nosplit
   229  //go:cgo_unsafe_args
   230  func closefd(fd int32) int32 {
   231  	return libcCall(unsafe.Pointer(abi.FuncPCABI0(close_trampoline)), unsafe.Pointer(&fd))
   232  }
   233  func close_trampoline()
   234  
   235  //go:nosplit
   236  //go:cgo_unsafe_args
   237  //
   238  // This is exported via linkname to assembly in runtime/cgo.
   239  //go:linkname exit
   240  func exit(code int32) {
   241  	libcCall(unsafe.Pointer(abi.FuncPCABI0(exit_trampoline)), unsafe.Pointer(&code))
   242  }
   243  func exit_trampoline()
   244  
   245  //go:nosplit
   246  //go:cgo_unsafe_args
   247  func usleep(usec uint32) {
   248  	libcCall(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
   249  }
   250  func usleep_trampoline()
   251  
   252  //go:nosplit
   253  //go:cgo_unsafe_args
   254  func usleep_no_g(usec uint32) {
   255  	asmcgocall_no_g(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
   256  }
   257  
   258  //go:nosplit
   259  //go:cgo_unsafe_args
   260  func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
   261  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(write_trampoline)), unsafe.Pointer(&fd))
   262  	KeepAlive(p)
   263  	return ret
   264  }
   265  func write_trampoline()
   266  
   267  //go:nosplit
   268  //go:cgo_unsafe_args
   269  func open(name *byte, mode, perm int32) (ret int32) {
   270  	ret = libcCall(unsafe.Pointer(abi.FuncPCABI0(open_trampoline)), unsafe.Pointer(&name))
   271  	KeepAlive(name)
   272  	return
   273  }
   274  func open_trampoline()
   275  
   276  //go:nosplit
   277  //go:cgo_unsafe_args
   278  func nanotime1() int64 {
   279  	var r struct {
   280  		t            int64  // raw timer
   281  		numer, denom uint32 // conversion factors. nanoseconds = t * numer / denom.
   282  	}
   283  	libcCall(unsafe.Pointer(abi.FuncPCABI0(nanotime_trampoline)), unsafe.Pointer(&r))
   284  	// Note: Apple seems unconcerned about overflow here. See
   285  	// https://developer.apple.com/library/content/qa/qa1398/_index.html
   286  	// Note also, numer == denom == 1 is common.
   287  	t := r.t
   288  	if r.numer != 1 {
   289  		t *= int64(r.numer)
   290  	}
   291  	if r.denom != 1 {
   292  		t /= int64(r.denom)
   293  	}
   294  	return t
   295  }
   296  func nanotime_trampoline()
   297  
   298  //go:nosplit
   299  //go:cgo_unsafe_args
   300  func walltime() (int64, int32) {
   301  	var t timespec
   302  	libcCall(unsafe.Pointer(abi.FuncPCABI0(walltime_trampoline)), unsafe.Pointer(&t))
   303  	return t.tv_sec, int32(t.tv_nsec)
   304  }
   305  func walltime_trampoline()
   306  
   307  //go:nosplit
   308  //go:cgo_unsafe_args
   309  func sigaction(sig uint32, new *usigactiont, old *usigactiont) {
   310  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigaction_trampoline)), unsafe.Pointer(&sig))
   311  	KeepAlive(new)
   312  	KeepAlive(old)
   313  }
   314  func sigaction_trampoline()
   315  
   316  //go:nosplit
   317  //go:cgo_unsafe_args
   318  func sigprocmask(how uint32, new *sigset, old *sigset) {
   319  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigprocmask_trampoline)), unsafe.Pointer(&how))
   320  	KeepAlive(new)
   321  	KeepAlive(old)
   322  }
   323  func sigprocmask_trampoline()
   324  
   325  //go:nosplit
   326  //go:cgo_unsafe_args
   327  func sigaltstack(new *stackt, old *stackt) {
   328  	if new != nil && new.ss_flags&_SS_DISABLE != 0 && new.ss_size == 0 {
   329  		// Despite the fact that Darwin's sigaltstack man page says it ignores the size
   330  		// when SS_DISABLE is set, it doesn't. sigaltstack returns ENOMEM
   331  		// if we don't give it a reasonable size.
   332  		// ref: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140421/214296.html
   333  		new.ss_size = 32768
   334  	}
   335  	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigaltstack_trampoline)), unsafe.Pointer(&new))
   336  	KeepAlive(new)
   337  	KeepAlive(old)
   338  }
   339  func sigaltstack_trampoline()
   340  
   341  //go:nosplit
   342  //go:cgo_unsafe_args
   343  func raiseproc(sig uint32) {
   344  	libcCall(unsafe.Pointer(abi.FuncPCABI0(raiseproc_trampoline)), unsafe.Pointer(&sig))
   345  }
   346  func raiseproc_trampoline()
   347  
   348  //go:nosplit
   349  //go:cgo_unsafe_args
   350  func setitimer(mode int32, new, old *itimerval) {
   351  	libcCall(unsafe.Pointer(abi.FuncPCABI0(setitimer_trampoline)), unsafe.Pointer(&mode))
   352  	KeepAlive(new)
   353  	KeepAlive(old)
   354  }
   355  func setitimer_trampoline()
   356  
   357  //go:nosplit
   358  //go:cgo_unsafe_args
   359  func sysctl(mib *uint32, miblen uint32, oldp *byte, oldlenp *uintptr, newp *byte, newlen uintptr) int32 {
   360  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(sysctl_trampoline)), unsafe.Pointer(&mib))
   361  	KeepAlive(mib)
   362  	KeepAlive(oldp)
   363  	KeepAlive(oldlenp)
   364  	KeepAlive(newp)
   365  	return ret
   366  }
   367  func sysctl_trampoline()
   368  
   369  //go:nosplit
   370  //go:cgo_unsafe_args
   371  func sysctlbyname(name *byte, oldp *byte, oldlenp *uintptr, newp *byte, newlen uintptr) int32 {
   372  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(sysctlbyname_trampoline)), unsafe.Pointer(&name))
   373  	KeepAlive(name)
   374  	KeepAlive(oldp)
   375  	KeepAlive(oldlenp)
   376  	KeepAlive(newp)
   377  	return ret
   378  }
   379  func sysctlbyname_trampoline()
   380  
   381  //go:nosplit
   382  //go:cgo_unsafe_args
   383  func fcntl(fd, cmd, arg int32) int32 {
   384  	return libcCall(unsafe.Pointer(abi.FuncPCABI0(fcntl_trampoline)), unsafe.Pointer(&fd))
   385  }
   386  func fcntl_trampoline()
   387  
   388  //go:nosplit
   389  //go:cgo_unsafe_args
   390  func kqueue() int32 {
   391  	v := libcCall(unsafe.Pointer(abi.FuncPCABI0(kqueue_trampoline)), nil)
   392  	return v
   393  }
   394  func kqueue_trampoline()
   395  
   396  //go:nosplit
   397  //go:cgo_unsafe_args
   398  func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32 {
   399  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(kevent_trampoline)), unsafe.Pointer(&kq))
   400  	KeepAlive(ch)
   401  	KeepAlive(ev)
   402  	KeepAlive(ts)
   403  	return ret
   404  }
   405  func kevent_trampoline()
   406  
   407  //go:nosplit
   408  //go:cgo_unsafe_args
   409  func pthread_mutex_init(m *pthreadmutex, attr *pthreadmutexattr) int32 {
   410  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_init_trampoline)), unsafe.Pointer(&m))
   411  	KeepAlive(m)
   412  	KeepAlive(attr)
   413  	return ret
   414  }
   415  func pthread_mutex_init_trampoline()
   416  
   417  //go:nosplit
   418  //go:cgo_unsafe_args
   419  func pthread_mutex_lock(m *pthreadmutex) int32 {
   420  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_lock_trampoline)), unsafe.Pointer(&m))
   421  	KeepAlive(m)
   422  	return ret
   423  }
   424  func pthread_mutex_lock_trampoline()
   425  
   426  //go:nosplit
   427  //go:cgo_unsafe_args
   428  func pthread_mutex_unlock(m *pthreadmutex) int32 {
   429  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_mutex_unlock_trampoline)), unsafe.Pointer(&m))
   430  	KeepAlive(m)
   431  	return ret
   432  }
   433  func pthread_mutex_unlock_trampoline()
   434  
   435  //go:nosplit
   436  //go:cgo_unsafe_args
   437  func pthread_cond_init(c *pthreadcond, attr *pthreadcondattr) int32 {
   438  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_init_trampoline)), unsafe.Pointer(&c))
   439  	KeepAlive(c)
   440  	KeepAlive(attr)
   441  	return ret
   442  }
   443  func pthread_cond_init_trampoline()
   444  
   445  //go:nosplit
   446  //go:cgo_unsafe_args
   447  func pthread_cond_wait(c *pthreadcond, m *pthreadmutex) int32 {
   448  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_wait_trampoline)), unsafe.Pointer(&c))
   449  	KeepAlive(c)
   450  	KeepAlive(m)
   451  	return ret
   452  }
   453  func pthread_cond_wait_trampoline()
   454  
   455  //go:nosplit
   456  //go:cgo_unsafe_args
   457  func pthread_cond_timedwait_relative_np(c *pthreadcond, m *pthreadmutex, t *timespec) int32 {
   458  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_timedwait_relative_np_trampoline)), unsafe.Pointer(&c))
   459  	KeepAlive(c)
   460  	KeepAlive(m)
   461  	KeepAlive(t)
   462  	return ret
   463  }
   464  func pthread_cond_timedwait_relative_np_trampoline()
   465  
   466  //go:nosplit
   467  //go:cgo_unsafe_args
   468  func pthread_cond_signal(c *pthreadcond) int32 {
   469  	ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(pthread_cond_signal_trampoline)), unsafe.Pointer(&c))
   470  	KeepAlive(c)
   471  	return ret
   472  }
   473  func pthread_cond_signal_trampoline()
   474  
   475  // Not used on Darwin, but must be defined.
   476  func exitThread(wait *uint32) {
   477  }
   478  
   479  //go:nosplit
   480  func closeonexec(fd int32) {
   481  	fcntl(fd, _F_SETFD, _FD_CLOEXEC)
   482  }
   483  
   484  //go:nosplit
   485  func setNonblock(fd int32) {
   486  	flags := fcntl(fd, _F_GETFL, 0)
   487  	fcntl(fd, _F_SETFL, flags|_O_NONBLOCK)
   488  }
   489  
   490  // Tell the linker that the libc_* functions are to be found
   491  // in a system library, with the libc_ prefix missing.
   492  
   493  //go:cgo_import_dynamic libc_pthread_attr_init pthread_attr_init "/usr/lib/libSystem.B.dylib"
   494  //go:cgo_import_dynamic libc_pthread_attr_getstacksize pthread_attr_getstacksize "/usr/lib/libSystem.B.dylib"
   495  //go:cgo_import_dynamic libc_pthread_attr_setdetachstate pthread_attr_setdetachstate "/usr/lib/libSystem.B.dylib"
   496  //go:cgo_import_dynamic libc_pthread_create pthread_create "/usr/lib/libSystem.B.dylib"
   497  //go:cgo_import_dynamic libc_pthread_self pthread_self "/usr/lib/libSystem.B.dylib"
   498  //go:cgo_import_dynamic libc_pthread_kill pthread_kill "/usr/lib/libSystem.B.dylib"
   499  //go:cgo_import_dynamic libc_exit _exit "/usr/lib/libSystem.B.dylib"
   500  //go:cgo_import_dynamic libc_raise raise "/usr/lib/libSystem.B.dylib"
   501  
   502  //go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib"
   503  //go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib"
   504  //go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib"
   505  //go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib"
   506  //go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib"
   507  
   508  //go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib"
   509  //go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib"
   510  //go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib"
   511  //go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib"
   512  //go:cgo_import_dynamic libc_error __error "/usr/lib/libSystem.B.dylib"
   513  //go:cgo_import_dynamic libc_usleep usleep "/usr/lib/libSystem.B.dylib"
   514  
   515  //go:cgo_import_dynamic libc_mach_timebase_info mach_timebase_info "/usr/lib/libSystem.B.dylib"
   516  //go:cgo_import_dynamic libc_mach_absolute_time mach_absolute_time "/usr/lib/libSystem.B.dylib"
   517  //go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib"
   518  //go:cgo_import_dynamic libc_sigaction sigaction "/usr/lib/libSystem.B.dylib"
   519  //go:cgo_import_dynamic libc_pthread_sigmask pthread_sigmask "/usr/lib/libSystem.B.dylib"
   520  //go:cgo_import_dynamic libc_sigaltstack sigaltstack "/usr/lib/libSystem.B.dylib"
   521  //go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib"
   522  //go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib"
   523  //go:cgo_import_dynamic libc_setitimer setitimer "/usr/lib/libSystem.B.dylib"
   524  //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
   525  //go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib"
   526  //go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
   527  //go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib"
   528  //go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib"
   529  
   530  //go:cgo_import_dynamic libc_pthread_mutex_init pthread_mutex_init "/usr/lib/libSystem.B.dylib"
   531  //go:cgo_import_dynamic libc_pthread_mutex_lock pthread_mutex_lock "/usr/lib/libSystem.B.dylib"
   532  //go:cgo_import_dynamic libc_pthread_mutex_unlock pthread_mutex_unlock "/usr/lib/libSystem.B.dylib"
   533  //go:cgo_import_dynamic libc_pthread_cond_init pthread_cond_init "/usr/lib/libSystem.B.dylib"
   534  //go:cgo_import_dynamic libc_pthread_cond_wait pthread_cond_wait "/usr/lib/libSystem.B.dylib"
   535  //go:cgo_import_dynamic libc_pthread_cond_timedwait_relative_np pthread_cond_timedwait_relative_np "/usr/lib/libSystem.B.dylib"
   536  //go:cgo_import_dynamic libc_pthread_cond_signal pthread_cond_signal "/usr/lib/libSystem.B.dylib"
   537  

View as plain text