1// Copyright 2009,2010 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// Darwin system calls.
6// This file is compiled as ordinary Go code,
7// but it is also input to mksyscall,
8// which parses the //sys lines and generates system call stubs.
9// Note that sometimes we use a lowercase //sys name and wrap
10// it in our own nicer implementation, either here or in
11// syscall_bsd.go or syscall_unix.go.
12
13package unix
14
15import (
16	"runtime"
17	"syscall"
18	"unsafe"
19)
20
21// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
22type SockaddrDatalink struct {
23	Len    uint8
24	Family uint8
25	Index  uint16
26	Type   uint8
27	Nlen   uint8
28	Alen   uint8
29	Slen   uint8
30	Data   [12]int8
31	raw    RawSockaddrDatalink
32}
33
34// SockaddrCtl implements the Sockaddr interface for AF_SYSTEM type sockets.
35type SockaddrCtl struct {
36	ID   uint32
37	Unit uint32
38	raw  RawSockaddrCtl
39}
40
41func (sa *SockaddrCtl) sockaddr() (unsafe.Pointer, _Socklen, error) {
42	sa.raw.Sc_len = SizeofSockaddrCtl
43	sa.raw.Sc_family = AF_SYSTEM
44	sa.raw.Ss_sysaddr = AF_SYS_CONTROL
45	sa.raw.Sc_id = sa.ID
46	sa.raw.Sc_unit = sa.Unit
47	return unsafe.Pointer(&sa.raw), SizeofSockaddrCtl, nil
48}
49
50func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
51	switch rsa.Addr.Family {
52	case AF_SYSTEM:
53		pp := (*RawSockaddrCtl)(unsafe.Pointer(rsa))
54		if pp.Ss_sysaddr == AF_SYS_CONTROL {
55			sa := new(SockaddrCtl)
56			sa.ID = pp.Sc_id
57			sa.Unit = pp.Sc_unit
58			return sa, nil
59		}
60	}
61	return nil, EAFNOSUPPORT
62}
63
64// Some external packages rely on SYS___SYSCTL being defined to implement their
65// own sysctl wrappers. Provide it here, even though direct syscalls are no
66// longer supported on darwin.
67const SYS___SYSCTL = SYS_SYSCTL
68
69// Translate "kern.hostname" to []_C_int{0,1,2,3}.
70func nametomib(name string) (mib []_C_int, err error) {
71	const siz = unsafe.Sizeof(mib[0])
72
73	// NOTE(rsc): It seems strange to set the buffer to have
74	// size CTL_MAXNAME+2 but use only CTL_MAXNAME
75	// as the size. I don't know why the +2 is here, but the
76	// kernel uses +2 for its own implementation of this function.
77	// I am scared that if we don't include the +2 here, the kernel
78	// will silently write 2 words farther than we specify
79	// and we'll get memory corruption.
80	var buf [CTL_MAXNAME + 2]_C_int
81	n := uintptr(CTL_MAXNAME) * siz
82
83	p := (*byte)(unsafe.Pointer(&buf[0]))
84	bytes, err := ByteSliceFromString(name)
85	if err != nil {
86		return nil, err
87	}
88
89	// Magic sysctl: "setting" 0.3 to a string name
90	// lets you read back the array of integers form.
91	if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
92		return nil, err
93	}
94	return buf[0 : n/siz], nil
95}
96
97func direntIno(buf []byte) (uint64, bool) {
98	return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
99}
100
101func direntReclen(buf []byte) (uint64, bool) {
102	return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
103}
104
105func direntNamlen(buf []byte) (uint64, bool) {
106	return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
107}
108
109func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
110func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
111
112type attrList struct {
113	bitmapCount uint16
114	_           uint16
115	CommonAttr  uint32
116	VolAttr     uint32
117	DirAttr     uint32
118	FileAttr    uint32
119	Forkattr    uint32
120}
121
122//sysnb	pipe(p *[2]int32) (err error)
123
124func Pipe(p []int) (err error) {
125	if len(p) != 2 {
126		return EINVAL
127	}
128	var x [2]int32
129	err = pipe(&x)
130	p[0] = int(x[0])
131	p[1] = int(x[1])
132	return
133}
134
135func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
136	var _p0 unsafe.Pointer
137	var bufsize uintptr
138	if len(buf) > 0 {
139		_p0 = unsafe.Pointer(&buf[0])
140		bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
141	}
142	return getfsstat(_p0, bufsize, flags)
143}
144
145func xattrPointer(dest []byte) *byte {
146	// It's only when dest is set to NULL that the OS X implementations of
147	// getxattr() and listxattr() return the current sizes of the named attributes.
148	// An empty byte array is not sufficient. To maintain the same behaviour as the
149	// linux implementation, we wrap around the system calls and pass in NULL when
150	// dest is empty.
151	var destp *byte
152	if len(dest) > 0 {
153		destp = &dest[0]
154	}
155	return destp
156}
157
158//sys	getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
159
160func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
161	return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0)
162}
163
164func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
165	return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW)
166}
167
168//sys	fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
169
170func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
171	return fgetxattr(fd, attr, xattrPointer(dest), len(dest), 0, 0)
172}
173
174//sys	setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error)
175
176func Setxattr(path string, attr string, data []byte, flags int) (err error) {
177	// The parameters for the OS X implementation vary slightly compared to the
178	// linux system call, specifically the position parameter:
179	//
180	//  linux:
181	//      int setxattr(
182	//          const char *path,
183	//          const char *name,
184	//          const void *value,
185	//          size_t size,
186	//          int flags
187	//      );
188	//
189	//  darwin:
190	//      int setxattr(
191	//          const char *path,
192	//          const char *name,
193	//          void *value,
194	//          size_t size,
195	//          u_int32_t position,
196	//          int options
197	//      );
198	//
199	// position specifies the offset within the extended attribute. In the
200	// current implementation, only the resource fork extended attribute makes
201	// use of this argument. For all others, position is reserved. We simply
202	// default to setting it to zero.
203	return setxattr(path, attr, xattrPointer(data), len(data), 0, flags)
204}
205
206func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
207	return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW)
208}
209
210//sys	fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error)
211
212func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
213	return fsetxattr(fd, attr, xattrPointer(data), len(data), 0, 0)
214}
215
216//sys	removexattr(path string, attr string, options int) (err error)
217
218func Removexattr(path string, attr string) (err error) {
219	// We wrap around and explicitly zero out the options provided to the OS X
220	// implementation of removexattr, we do so for interoperability with the
221	// linux variant.
222	return removexattr(path, attr, 0)
223}
224
225func Lremovexattr(link string, attr string) (err error) {
226	return removexattr(link, attr, XATTR_NOFOLLOW)
227}
228
229//sys	fremovexattr(fd int, attr string, options int) (err error)
230
231func Fremovexattr(fd int, attr string) (err error) {
232	return fremovexattr(fd, attr, 0)
233}
234
235//sys	listxattr(path string, dest *byte, size int, options int) (sz int, err error)
236
237func Listxattr(path string, dest []byte) (sz int, err error) {
238	return listxattr(path, xattrPointer(dest), len(dest), 0)
239}
240
241func Llistxattr(link string, dest []byte) (sz int, err error) {
242	return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW)
243}
244
245//sys	flistxattr(fd int, dest *byte, size int, options int) (sz int, err error)
246
247func Flistxattr(fd int, dest []byte) (sz int, err error) {
248	return flistxattr(fd, xattrPointer(dest), len(dest), 0)
249}
250
251func setattrlistTimes(path string, times []Timespec, flags int) error {
252	_p0, err := BytePtrFromString(path)
253	if err != nil {
254		return err
255	}
256
257	var attrList attrList
258	attrList.bitmapCount = ATTR_BIT_MAP_COUNT
259	attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
260
261	// order is mtime, atime: the opposite of Chtimes
262	attributes := [2]Timespec{times[1], times[0]}
263	options := 0
264	if flags&AT_SYMLINK_NOFOLLOW != 0 {
265		options |= FSOPT_NOFOLLOW
266	}
267	return setattrlist(
268		_p0,
269		unsafe.Pointer(&attrList),
270		unsafe.Pointer(&attributes),
271		unsafe.Sizeof(attributes),
272		options)
273}
274
275//sys	setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
276
277func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
278	// Darwin doesn't support SYS_UTIMENSAT
279	return ENOSYS
280}
281
282/*
283 * Wrapped
284 */
285
286//sys	fcntl(fd int, cmd int, arg int) (val int, err error)
287
288//sys	kill(pid int, signum int, posix int) (err error)
289
290func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
291
292//sys	ioctl(fd int, req uint, arg uintptr) (err error)
293
294func IoctlCtlInfo(fd int, ctlInfo *CtlInfo) error {
295	err := ioctl(fd, CTLIOCGINFO, uintptr(unsafe.Pointer(ctlInfo)))
296	runtime.KeepAlive(ctlInfo)
297	return err
298}
299
300// IfreqMTU is struct ifreq used to get or set a network device's MTU.
301type IfreqMTU struct {
302	Name [IFNAMSIZ]byte
303	MTU  int32
304}
305
306// IoctlGetIfreqMTU performs the SIOCGIFMTU ioctl operation on fd to get the MTU
307// of the network device specified by ifname.
308func IoctlGetIfreqMTU(fd int, ifname string) (*IfreqMTU, error) {
309	var ifreq IfreqMTU
310	copy(ifreq.Name[:], ifname)
311	err := ioctl(fd, SIOCGIFMTU, uintptr(unsafe.Pointer(&ifreq)))
312	return &ifreq, err
313}
314
315// IoctlSetIfreqMTU performs the SIOCSIFMTU ioctl operation on fd to set the MTU
316// of the network device specified by ifreq.Name.
317func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error {
318	err := ioctl(fd, SIOCSIFMTU, uintptr(unsafe.Pointer(ifreq)))
319	runtime.KeepAlive(ifreq)
320	return err
321}
322
323//sys	sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
324
325func Uname(uname *Utsname) error {
326	mib := []_C_int{CTL_KERN, KERN_OSTYPE}
327	n := unsafe.Sizeof(uname.Sysname)
328	if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
329		return err
330	}
331
332	mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
333	n = unsafe.Sizeof(uname.Nodename)
334	if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
335		return err
336	}
337
338	mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
339	n = unsafe.Sizeof(uname.Release)
340	if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
341		return err
342	}
343
344	mib = []_C_int{CTL_KERN, KERN_VERSION}
345	n = unsafe.Sizeof(uname.Version)
346	if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
347		return err
348	}
349
350	// The version might have newlines or tabs in it, convert them to
351	// spaces.
352	for i, b := range uname.Version {
353		if b == '\n' || b == '\t' {
354			if i == len(uname.Version)-1 {
355				uname.Version[i] = 0
356			} else {
357				uname.Version[i] = ' '
358			}
359		}
360	}
361
362	mib = []_C_int{CTL_HW, HW_MACHINE}
363	n = unsafe.Sizeof(uname.Machine)
364	if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
365		return err
366	}
367
368	return nil
369}
370
371func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
372	if raceenabled {
373		raceReleaseMerge(unsafe.Pointer(&ioSync))
374	}
375	var length = int64(count)
376	err = sendfile(infd, outfd, *offset, &length, nil, 0)
377	written = int(length)
378	return
379}
380
381// GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct.
382// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively.
383func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
384	x := new(Xucred)
385	vallen := _Socklen(SizeofXucred)
386	err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen)
387	return x, err
388}
389
390//sys	sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
391
392/*
393 * Exposed directly
394 */
395//sys	Access(path string, mode uint32) (err error)
396//sys	Adjtime(delta *Timeval, olddelta *Timeval) (err error)
397//sys	Chdir(path string) (err error)
398//sys	Chflags(path string, flags int) (err error)
399//sys	Chmod(path string, mode uint32) (err error)
400//sys	Chown(path string, uid int, gid int) (err error)
401//sys	Chroot(path string) (err error)
402//sys	ClockGettime(clockid int32, time *Timespec) (err error)
403//sys	Close(fd int) (err error)
404//sys	Clonefile(src string, dst string, flags int) (err error)
405//sys	Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error)
406//sys	Dup(fd int) (nfd int, err error)
407//sys	Dup2(from int, to int) (err error)
408//sys	Exchangedata(path1 string, path2 string, options int) (err error)
409//sys	Exit(code int)
410//sys	Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
411//sys	Fchdir(fd int) (err error)
412//sys	Fchflags(fd int, flags int) (err error)
413//sys	Fchmod(fd int, mode uint32) (err error)
414//sys	Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
415//sys	Fchown(fd int, uid int, gid int) (err error)
416//sys	Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
417//sys	Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error)
418//sys	Flock(fd int, how int) (err error)
419//sys	Fpathconf(fd int, name int) (val int, err error)
420//sys	Fsync(fd int) (err error)
421//sys	Ftruncate(fd int, length int64) (err error)
422//sys	Getcwd(buf []byte) (n int, err error)
423//sys	Getdtablesize() (size int)
424//sysnb	Getegid() (egid int)
425//sysnb	Geteuid() (uid int)
426//sysnb	Getgid() (gid int)
427//sysnb	Getpgid(pid int) (pgid int, err error)
428//sysnb	Getpgrp() (pgrp int)
429//sysnb	Getpid() (pid int)
430//sysnb	Getppid() (ppid int)
431//sys	Getpriority(which int, who int) (prio int, err error)
432//sysnb	Getrlimit(which int, lim *Rlimit) (err error)
433//sysnb	Getrusage(who int, rusage *Rusage) (err error)
434//sysnb	Getsid(pid int) (sid int, err error)
435//sysnb	Gettimeofday(tp *Timeval) (err error)
436//sysnb	Getuid() (uid int)
437//sysnb	Issetugid() (tainted bool)
438//sys	Kqueue() (fd int, err error)
439//sys	Lchown(path string, uid int, gid int) (err error)
440//sys	Link(path string, link string) (err error)
441//sys	Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
442//sys	Listen(s int, backlog int) (err error)
443//sys	Mkdir(path string, mode uint32) (err error)
444//sys	Mkdirat(dirfd int, path string, mode uint32) (err error)
445//sys	Mkfifo(path string, mode uint32) (err error)
446//sys	Mknod(path string, mode uint32, dev int) (err error)
447//sys	Open(path string, mode int, perm uint32) (fd int, err error)
448//sys	Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
449//sys	Pathconf(path string, name int) (val int, err error)
450//sys	Pread(fd int, p []byte, offset int64) (n int, err error)
451//sys	Pwrite(fd int, p []byte, offset int64) (n int, err error)
452//sys	read(fd int, p []byte) (n int, err error)
453//sys	Readlink(path string, buf []byte) (n int, err error)
454//sys	Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
455//sys	Rename(from string, to string) (err error)
456//sys	Renameat(fromfd int, from string, tofd int, to string) (err error)
457//sys	Revoke(path string) (err error)
458//sys	Rmdir(path string) (err error)
459//sys	Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
460//sys	Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
461//sys	Setegid(egid int) (err error)
462//sysnb	Seteuid(euid int) (err error)
463//sysnb	Setgid(gid int) (err error)
464//sys	Setlogin(name string) (err error)
465//sysnb	Setpgid(pid int, pgid int) (err error)
466//sys	Setpriority(which int, who int, prio int) (err error)
467//sys	Setprivexec(flag int) (err error)
468//sysnb	Setregid(rgid int, egid int) (err error)
469//sysnb	Setreuid(ruid int, euid int) (err error)
470//sysnb	Setrlimit(which int, lim *Rlimit) (err error)
471//sysnb	Setsid() (pid int, err error)
472//sysnb	Settimeofday(tp *Timeval) (err error)
473//sysnb	Setuid(uid int) (err error)
474//sys	Symlink(path string, link string) (err error)
475//sys	Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
476//sys	Sync() (err error)
477//sys	Truncate(path string, length int64) (err error)
478//sys	Umask(newmask int) (oldmask int)
479//sys	Undelete(path string) (err error)
480//sys	Unlink(path string) (err error)
481//sys	Unlinkat(dirfd int, path string, flags int) (err error)
482//sys	Unmount(path string, flags int) (err error)
483//sys	write(fd int, p []byte) (n int, err error)
484//sys	mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
485//sys	munmap(addr uintptr, length uintptr) (err error)
486//sys	readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
487//sys	writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
488
489/*
490 * Unimplemented
491 */
492// Profil
493// Sigaction
494// Sigprocmask
495// Getlogin
496// Sigpending
497// Sigaltstack
498// Ioctl
499// Reboot
500// Execve
501// Vfork
502// Sbrk
503// Sstk
504// Ovadvise
505// Mincore
506// Setitimer
507// Swapon
508// Select
509// Sigsuspend
510// Readv
511// Writev
512// Nfssvc
513// Getfh
514// Quotactl
515// Mount
516// Csops
517// Waitid
518// Add_profil
519// Kdebug_trace
520// Sigreturn
521// Atsocket
522// Kqueue_from_portset_np
523// Kqueue_portset
524// Getattrlist
525// Setattrlist
526// Getdirentriesattr
527// Searchfs
528// Delete
529// Copyfile
530// Watchevent
531// Waitevent
532// Modwatch
533// Fsctl
534// Initgroups
535// Posix_spawn
536// Nfsclnt
537// Fhopen
538// Minherit
539// Semsys
540// Msgsys
541// Shmsys
542// Semctl
543// Semget
544// Semop
545// Msgctl
546// Msgget
547// Msgsnd
548// Msgrcv
549// Shmat
550// Shmctl
551// Shmdt
552// Shmget
553// Shm_open
554// Shm_unlink
555// Sem_open
556// Sem_close
557// Sem_unlink
558// Sem_wait
559// Sem_trywait
560// Sem_post
561// Sem_getvalue
562// Sem_init
563// Sem_destroy
564// Open_extended
565// Umask_extended
566// Stat_extended
567// Lstat_extended
568// Fstat_extended
569// Chmod_extended
570// Fchmod_extended
571// Access_extended
572// Settid
573// Gettid
574// Setsgroups
575// Getsgroups
576// Setwgroups
577// Getwgroups
578// Mkfifo_extended
579// Mkdir_extended
580// Identitysvc
581// Shared_region_check_np
582// Shared_region_map_np
583// __pthread_mutex_destroy
584// __pthread_mutex_init
585// __pthread_mutex_lock
586// __pthread_mutex_trylock
587// __pthread_mutex_unlock
588// __pthread_cond_init
589// __pthread_cond_destroy
590// __pthread_cond_broadcast
591// __pthread_cond_signal
592// Setsid_with_pid
593// __pthread_cond_timedwait
594// Aio_fsync
595// Aio_return
596// Aio_suspend
597// Aio_cancel
598// Aio_error
599// Aio_read
600// Aio_write
601// Lio_listio
602// __pthread_cond_wait
603// Iopolicysys
604// __pthread_kill
605// __pthread_sigmask
606// __sigwait
607// __disable_threadsignal
608// __pthread_markcancel
609// __pthread_canceled
610// __semwait_signal
611// Proc_info
612// sendfile
613// Stat64_extended
614// Lstat64_extended
615// Fstat64_extended
616// __pthread_chdir
617// __pthread_fchdir
618// Audit
619// Auditon
620// Getauid
621// Setauid
622// Getaudit
623// Setaudit
624// Getaudit_addr
625// Setaudit_addr
626// Auditctl
627// Bsdthread_create
628// Bsdthread_terminate
629// Stack_snapshot
630// Bsdthread_register
631// Workq_open
632// Workq_ops
633// __mac_execve
634// __mac_syscall
635// __mac_get_file
636// __mac_set_file
637// __mac_get_link
638// __mac_set_link
639// __mac_get_proc
640// __mac_set_proc
641// __mac_get_fd
642// __mac_set_fd
643// __mac_get_pid
644// __mac_get_lcid
645// __mac_get_lctx
646// __mac_set_lctx
647// Setlcid
648// Read_nocancel
649// Write_nocancel
650// Open_nocancel
651// Close_nocancel
652// Wait4_nocancel
653// Recvmsg_nocancel
654// Sendmsg_nocancel
655// Recvfrom_nocancel
656// Accept_nocancel
657// Fcntl_nocancel
658// Select_nocancel
659// Fsync_nocancel
660// Connect_nocancel
661// Sigsuspend_nocancel
662// Readv_nocancel
663// Writev_nocancel
664// Sendto_nocancel
665// Pread_nocancel
666// Pwrite_nocancel
667// Waitid_nocancel
668// Poll_nocancel
669// Msgsnd_nocancel
670// Msgrcv_nocancel
671// Sem_wait_nocancel
672// Aio_suspend_nocancel
673// __sigwait_nocancel
674// __semwait_signal_nocancel
675// __mac_mount
676// __mac_get_mount
677// __mac_getfsstat
678