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

View as plain text