19da7bddpfg/*-
29da7bddpfg * SPDX-License-Identifier: BSD-4-Clause
39da7bddpfg *
49563548imp * Copyright 1997 Sean Eric Fagan
5297bd47sef *
6297bd47sef * Redistribution and use in source and binary forms, with or without
7297bd47sef * modification, are permitted provided that the following conditions
8297bd47sef * are met:
9297bd47sef * 1. Redistributions of source code must retain the above copyright
10297bd47sef *    notice, this list of conditions and the following disclaimer.
11297bd47sef * 2. Redistributions in binary form must reproduce the above copyright
12297bd47sef *    notice, this list of conditions and the following disclaimer in the
13297bd47sef *    documentation and/or other materials provided with the distribution.
14297bd47sef * 3. All advertising materials mentioning features or use of this software
15297bd47sef *    must display the following acknowledgement:
16297bd47sef *	This product includes software developed by Sean Eric Fagan
17297bd47sef * 4. Neither the name of the author may be used to endorse or promote
18297bd47sef *    products derived from this software without specific prior written
19297bd47sef *    permission.
20297bd47sef *
21297bd47sef * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22297bd47sef * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23297bd47sef * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24297bd47sef * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25297bd47sef * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26297bd47sef * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27297bd47sef * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28297bd47sef * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29297bd47sef * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30297bd47sef * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31297bd47sef * SUCH DAMAGE.
32297bd47sef */
33297bd47sef
34e2fc305jhb#include <sys/cdefs.h>
35e2fc305jhb__FBSDID("$FreeBSD$");
3650a2f19charnier
37297bd47sef/*
389e9a114sef * This file has routines used to print out system calls and their
399e9a114sef * arguments.
409e9a114sef */
419e9a114sef
42be6866fjhb#include <sys/capsicum.h>
4390be41fdes#include <sys/types.h>
44bac78aajhb#define	_WANT_FREEBSD11_KEVENT
45e2fc305jhb#include <sys/event.h>
46e2fc305jhb#include <sys/ioccom.h>
47aea7646tmunro#include <sys/mman.h>
4860e8720bdrewery#include <sys/mount.h>
4970cda62delphij#include <sys/ptrace.h>
50e2fc305jhb#include <sys/resource.h>
5190be41fdes#include <sys/socket.h>
5225c1ae6imp#define _WANT_FREEBSD11_STAT
53e2fc305jhb#include <sys/stat.h>
5414aef6dkib#include <sys/sysctl.h>
55b3776cbasomers#include <sys/time.h>
5690be41fdes#include <sys/un.h>
57e4d9007jhb#include <sys/wait.h>
5890be41fdes#include <netinet/in.h>
594b456d8tuexen#include <netinet/sctp.h>
6090be41fdes#include <arpa/inet.h>
6190be41fdes
62d833056jhb#include <assert.h>
63b9c07fdgreen#include <ctype.h>
6450a2f19charnier#include <err.h>
65fa69965jhb#define _WANT_KERNEL_ERRNO
66fa69965jhb#include <errno.h>
675b22f04alfred#include <fcntl.h>
6831968bcdwmalone#include <poll.h>
69f4dd073jhb#include <sched.h>
7090be41fdes#include <signal.h>
71d297893ed#include <stdbool.h>
729e9a114sef#include <stdio.h>
739e9a114sef#include <stdlib.h>
749e9a114sef#include <string.h>
75fea0addjhb#include <sysdecode.h>
769e9a114sef#include <unistd.h>
77a233d0apav#include <vis.h>
7890be41fdes
79dfa2acded#include <contrib/cloudabi/cloudabi_types_common.h>
80d297893ed
81357fc60mdodd#include "truss.h"
8287c4eaemarkm#include "extern.h"
839e9a114sef#include "syscall.h"
849e9a114sef
859e9a114sef/*
86a233d0apav * This should probably be in its own file, sorted alphabetically.
879e9a114sef */
881a85444bdrewerystatic struct syscall decoded_syscalls[] = {
890e49f5djhb	/* Native ABI */
90dcf445cjhb	{ .name = "__acl_aclcheck_fd", .ret_type = 1, .nargs = 3,
91dcf445cjhb	  .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
92dcf445cjhb	{ .name = "__acl_aclcheck_file", .ret_type = 1, .nargs = 3,
93dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
94dcf445cjhb	{ .name = "__acl_aclcheck_link", .ret_type = 1, .nargs = 3,
95dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
96dcf445cjhb	{ .name = "__acl_delete_fd", .ret_type = 1, .nargs = 2,
97dcf445cjhb	  .args = { { Int, 0 }, { Acltype, 1 } } },
98dcf445cjhb	{ .name = "__acl_delete_file", .ret_type = 1, .nargs = 2,
99dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 } } },
100dcf445cjhb	{ .name = "__acl_delete_link", .ret_type = 1, .nargs = 2,
101dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 } } },
102dcf445cjhb	{ .name = "__acl_get_fd", .ret_type = 1, .nargs = 3,
103dcf445cjhb	  .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
104dcf445cjhb	{ .name = "__acl_get_file", .ret_type = 1, .nargs = 3,
105dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
106dcf445cjhb	{ .name = "__acl_get_link", .ret_type = 1, .nargs = 3,
107dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
108dcf445cjhb	{ .name = "__acl_set_fd", .ret_type = 1, .nargs = 3,
109dcf445cjhb	  .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
110dcf445cjhb	{ .name = "__acl_set_file", .ret_type = 1, .nargs = 3,
111dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
112dcf445cjhb	{ .name = "__acl_set_link", .ret_type = 1, .nargs = 3,
113dcf445cjhb	  .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } },
114be6866fjhb	{ .name = "__cap_rights_get", .ret_type = 1, .nargs = 3,
115be6866fjhb	  .args = { { Int, 0 }, { Int, 1 }, { CapRights | OUT, 2 } } },
1160e49f5djhb	{ .name = "__getcwd", .ret_type = 1, .nargs = 2,
1170e49f5djhb	  .args = { { Name | OUT, 0 }, { Int, 1 } } },
11854c053bmjg	{ .name = "__realpathat", .ret_type = 1, .nargs = 5,
11954c053bmjg	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Name | OUT, 2 },
12054c053bmjg		    { Sizet, 3 }, { Int, 4} } },
1210e49f5djhb	{ .name = "_umtx_op", .ret_type = 1, .nargs = 5,
1220e49f5djhb	  .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 },
1230e49f5djhb		    { Ptr, 4 } } },
1240e49f5djhb	{ .name = "accept", .ret_type = 1, .nargs = 3,
1250e49f5djhb	  .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
1260e49f5djhb	{ .name = "access", .ret_type = 1, .nargs = 2,
1270e49f5djhb	  .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
1280e49f5djhb	{ .name = "bind", .ret_type = 1, .nargs = 3,
129de22e2atuexen	  .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Socklent, 2 } } },
1300e49f5djhb	{ .name = "bindat", .ret_type = 1, .nargs = 4,
1310e49f5djhb	  .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
132cb8b7b2jhb		    { Int, 3 } } },
1330e49f5djhb	{ .name = "break", .ret_type = 1, .nargs = 1,
1340e49f5djhb	  .args = { { Ptr, 0 } } },
135b1206e0jhb	{ .name = "cap_fcntls_get", .ret_type = 1, .nargs = 2,
136b1206e0jhb	  .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } },
137b1206e0jhb	{ .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2,
138b1206e0jhb	  .args = { { Int, 0 }, { CapFcntlRights, 1 } } },
13911b8906jhb	{ .name = "cap_getmode", .ret_type = 1, .nargs = 1,
14011b8906jhb	  .args = { { PUInt | OUT, 0 } } },
141be6866fjhb	{ .name = "cap_rights_limit", .ret_type = 1, .nargs = 2,
142be6866fjhb	  .args = { { Int, 0 }, { CapRights, 1 } } },
143e2fc305jhb	{ .name = "chdir", .ret_type = 1, .nargs = 1,
144bea63f2dds	  .args = { { Name, 0 } } },
1450e49f5djhb	{ .name = "chflags", .ret_type = 1, .nargs = 2,
146f99d0dfjhb	  .args = { { Name | IN, 0 }, { FileFlags, 1 } } },
147f99d0dfjhb	{ .name = "chflagsat", .ret_type = 1, .nargs = 4,
148f99d0dfjhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { FileFlags, 2 },
149f99d0dfjhb		    { Atflags, 3 } } },
150e2fc305jhb	{ .name = "chmod", .ret_type = 1, .nargs = 2,
151bea63f2dds	  .args = { { Name, 0 }, { Octal, 1 } } },
1520e49f5djhb	{ .name = "chown", .ret_type = 1, .nargs = 3,
1530e49f5djhb	  .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
1540e49f5djhb	{ .name = "chroot", .ret_type = 1, .nargs = 1,
1550e49f5djhb	  .args = { { Name, 0 } } },
1560e49f5djhb	{ .name = "clock_gettime", .ret_type = 1, .nargs = 2,
1570e49f5djhb	  .args = { { Int, 0 }, { Timespec | OUT, 1 } } },
1580e49f5djhb	{ .name = "close", .ret_type = 1, .nargs = 1,
1590e49f5djhb	  .args = { { Int, 0 } } },
1603d2a2f4csjp	{ .name = "closefrom", .ret_type = 1, .nargs = 1,
1613d2a2f4csjp	  .args = { { Int, 0 } } },
16231598bcimp	{ .name = "compat11.fstat", .ret_type = 1, .nargs = 2,
16331598bcimp	  .args = { { Int, 0 }, { Stat11 | OUT, 1 } } },
1646b75d5fmarkj	{ .name = "compat11.fstatat", .ret_type = 1, .nargs = 4,
1656b75d5fmarkj	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat11 | OUT, 2 },
1666b75d5fmarkj		    { Atflags, 3 } } },
167bac78aajhb	{ .name = "compat11.kevent", .ret_type = 1, .nargs = 6,
168bac78aajhb	  .args = { { Int, 0 }, { Kevent11, 1 }, { Int, 2 },
169bac78aajhb		    { Kevent11 | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } },
17031598bcimp	{ .name = "compat11.lstat", .ret_type = 1, .nargs = 2,
17131598bcimp	  .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } },
17231598bcimp	{ .name = "compat11.stat", .ret_type = 1, .nargs = 2,
17331598bcimp	  .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } },
1740e49f5djhb	{ .name = "connect", .ret_type = 1, .nargs = 3,
175de22e2atuexen	  .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Socklent, 2 } } },
1760e49f5djhb	{ .name = "connectat", .ret_type = 1, .nargs = 4,
1770e49f5djhb	  .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
1780e49f5djhb		    { Int, 3 } } },
1791cc8254jhb	{ .name = "dup", .ret_type = 1, .nargs = 1,
1801cc8254jhb	  .args = { { Int, 0 } } },
1811cc8254jhb	{ .name = "dup2", .ret_type = 1, .nargs = 2,
1821cc8254jhb	  .args = { { Int, 0 }, { Int, 1 } } },
1830e49f5djhb	{ .name = "eaccess", .ret_type = 1, .nargs = 2,
1840e49f5djhb	  .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
1850e49f5djhb	{ .name = "execve", .ret_type = 1, .nargs = 3,
1860e49f5djhb	  .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
1870e49f5djhb		    { ExecEnv | IN, 2 } } },
1880e49f5djhb	{ .name = "exit", .ret_type = 0, .nargs = 1,
1890e49f5djhb	  .args = { { Hex, 0 } } },
19094dda19jhb	{ .name = "extattr_delete_fd", .ret_type = 1, .nargs = 3,
19194dda19jhb	  .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } },
19294dda19jhb	{ .name = "extattr_delete_file", .ret_type = 1, .nargs = 3,
19394dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } },
19494dda19jhb	{ .name = "extattr_delete_link", .ret_type = 1, .nargs = 3,
19594dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } },
19694dda19jhb	{ .name = "extattr_get_fd", .ret_type = 1, .nargs = 5,
19794dda19jhb	  .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
19894dda19jhb		    { BinString | OUT, 3 }, { Sizet, 4 } } },
19994dda19jhb	{ .name = "extattr_get_file", .ret_type = 1, .nargs = 5,
20094dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
20194dda19jhb		    { BinString | OUT, 3 }, { Sizet, 4 } } },
20294dda19jhb	{ .name = "extattr_get_link", .ret_type = 1, .nargs = 5,
20394dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
20494dda19jhb		    { BinString | OUT, 3 }, { Sizet, 4 } } },
20594dda19jhb	{ .name = "extattr_list_fd", .ret_type = 1, .nargs = 4,
20694dda19jhb	  .args = { { Int, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 },
20794dda19jhb		    { Sizet, 3 } } },
20894dda19jhb	{ .name = "extattr_list_file", .ret_type = 1, .nargs = 4,
20994dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 },
21094dda19jhb		    { Sizet, 3 } } },
21194dda19jhb	{ .name = "extattr_list_link", .ret_type = 1, .nargs = 4,
21294dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 },
21394dda19jhb		    { Sizet, 3 } } },
21494dda19jhb	{ .name = "extattr_set_fd", .ret_type = 1, .nargs = 5,
21594dda19jhb	  .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
21694dda19jhb		    { BinString | IN, 3 }, { Sizet, 4 } } },
21794dda19jhb	{ .name = "extattr_set_file", .ret_type = 1, .nargs = 5,
21894dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
21994dda19jhb		    { BinString | IN, 3 }, { Sizet, 4 } } },
22094dda19jhb	{ .name = "extattr_set_link", .ret_type = 1, .nargs = 5,
22194dda19jhb	  .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 },
22294dda19jhb		    { BinString | IN, 3 }, { Sizet, 4 } } },
22394dda19jhb	{ .name = "extattrctl", .ret_type = 1, .nargs = 5,
22494dda19jhb	  .args = { { Name, 0 }, { Hex, 1 }, { Name, 2 },
22594dda19jhb		    { Extattrnamespace, 3 }, { Name, 4 } } },
2260e49f5djhb	{ .name = "faccessat", .ret_type = 1, .nargs = 4,
2270e49f5djhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 },
2280e49f5djhb		    { Atflags, 3 } } },
229f99d0dfjhb	{ .name = "fchflags", .ret_type = 1, .nargs = 2,
230f99d0dfjhb	  .args = { { Int, 0 }, { FileFlags, 1 } } },
231e2fc305jhb	{ .name = "fchmod", .ret_type = 1, .nargs = 2,
232cb8b7b2jhb	  .args = { { Int, 0 }, { Octal, 1 } } },
233e2fc305jhb	{ .name = "fchmodat", .ret_type = 1, .nargs = 4,
234cb8b7b2jhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Atflags, 3 } } },
235e2fc305jhb	{ .name = "fchown", .ret_type = 1, .nargs = 3,
236cb8b7b2jhb	  .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } },
237e2fc305jhb	{ .name = "fchownat", .ret_type = 1, .nargs = 5,
238cb8b7b2jhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 },
239cb8b7b2jhb		    { Atflags, 4 } } },
2400e49f5djhb	{ .name = "fcntl", .ret_type = 1, .nargs = 3,
2410e49f5djhb	  .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } },
242286aa3btmunro	{ .name = "fdatasync", .ret_type = 1, .nargs = 1,
243286aa3btmunro	  .args = { { Int, 0 } } },
24472dee17jhb	{ .name = "flock", .ret_type = 1, .nargs = 2,
24572dee17jhb	  .args = { { Int, 0 }, { Flockop, 1 } } },
246bea63f2dds	{ .name = "fstat", .ret_type = 1, .nargs = 2,
247b62aca3jhb	  .args = { { Int, 0 }, { Stat | OUT, 1 } } },
248cb8b7b2jhb	{ .name = "fstatat", .ret_type = 1, .nargs = 4,
249cb8b7b2jhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat | OUT, 2 },
250cb8b7b2jhb		    { Atflags, 3 } } },
25160e8720bdrewery	{ .name = "fstatfs", .ret_type = 1, .nargs = 2,
25260e8720bdrewery	  .args = { { Int, 0 }, { StatFs | OUT, 1 } } },
253286aa3btmunro	{ .name = "fsync", .ret_type = 1, .nargs = 1,
254286aa3btmunro	  .args = { { Int, 0 } } },
2550e49f5djhb	{ .name = "ftruncate", .ret_type = 1, .nargs = 2,
2568ee439djhb	  .args = { { Int | IN, 0 }, { QuadHex | IN, 1 } } },
2570e49f5djhb	{ .name = "futimens", .ret_type = 1, .nargs = 2,
2580e49f5djhb	  .args = { { Int, 0 }, { Timespec2 | IN, 1 } } },
2590e49f5djhb	{ .name = "futimes", .ret_type = 1, .nargs = 2,
2600e49f5djhb	  .args = { { Int, 0 }, { Timeval2 | IN, 1 } } },
2610e49f5djhb	{ .name = "futimesat", .ret_type = 1, .nargs = 3,
2620e49f5djhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } },
2631cc8254jhb	{ .name = "getdirentries", .ret_type = 1, .nargs = 4,
2641cc8254jhb	  .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 },
2651cc8254jhb		    { PQuadHex | OUT, 3 } } },
266d56d166jhb	{ .name = "getfsstat", .ret_type = 1, .nargs = 3,
267d56d166jhb	  .args = { { Ptr, 0 }, { Long, 1 }, { Getfsstatmode, 2 } } },
2680e49f5djhb	{ .name = "getitimer", .ret_type = 1, .nargs = 2,
2690e49f5djhb	  .args = { { Int, 0 }, { Itimerval | OUT, 2 } } },
270bea63f2dds	{ .name = "getpeername", .ret_type = 1, .nargs = 3,
271bea63f2dds	  .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
2720e49f5djhb	{ .name = "getpgid", .ret_type = 1, .nargs = 1,
2730e49f5djhb	  .args = { { Int, 0 } } },
274f2050b8jhb	{ .name = "getpriority", .ret_type = 1, .nargs = 2,
275f2050b8jhb	  .args = { { Priowhich, 0 }, { Int, 1 } } },
27682710b5cem	{ .name = "getrandom", .ret_type = 1, .nargs = 3,
27782710b5cem	  .args = { { BinString | OUT, 0 }, { Sizet, 1 }, { UInt, 2 } } },
2780e49f5djhb	{ .name = "getrlimit", .ret_type = 1, .nargs = 2,
2790e49f5djhb	  .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } },
2800e49f5djhb	{ .name = "getrusage", .ret_type = 1, .nargs = 2,
28148d2ad8jhb	  .args = { { RusageWho, 0 }, { Rusage | OUT, 1 } } },
2820e49f5djhb	{ .name = "getsid", .ret_type = 1, .nargs = 1,
2830e49f5djhb	  .args = { { Int, 0 } } },
284bea63f2dds	{ .name = "getsockname", .ret_type = 1, .nargs = 3,
285bea63f2dds	  .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
28600de84btuexen	{ .name = "getsockopt", .ret_type = 1, .nargs = 5,
28700de84btuexen	  .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 },
28800de84btuexen		    { Ptr | OUT, 3 }, { Ptr | OUT, 4 } } },
2890e49f5djhb	{ .name = "gettimeofday", .ret_type = 1, .nargs = 2,
2900e49f5djhb	  .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } },
2910e49f5djhb	{ .name = "ioctl", .ret_type = 1, .nargs = 3,
2923b61da1jhb	  .args = { { Int, 0 }, { Ioctl, 1 }, { Ptr, 2 } } },
2930e49f5djhb	{ .name = "kevent", .ret_type = 1, .nargs = 6,
2940e49f5djhb	  .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 },
2950e49f5djhb		    { Int, 4 }, { Timespec, 5 } } },
2960e49f5djhb	{ .name = "kill", .ret_type = 1, .nargs = 2,
2970e49f5djhb	  .args = { { Int | IN, 0 }, { Signal | IN, 1 } } },
2980e49f5djhb	{ .name = "kldfind", .ret_type = 1, .nargs = 1,
299bea63f2dds	  .args = { { Name | IN, 0 } } },
3000e49f5djhb	{ .name = "kldfirstmod", .ret_type = 1, .nargs = 1,
301bea63f2dds	  .args = { { Int, 0 } } },
3020e49f5djhb	{ .name = "kldload", .ret_type = 1, .nargs = 1,
303bea63f2dds	  .args = { { Name | IN, 0 } } },
304e2fc305jhb	{ .name = "kldnext", .ret_type = 1, .nargs = 1,
305bea63f2dds	  .args = { { Int, 0 } } },
306e2fc305jhb	{ .name = "kldstat", .ret_type = 1, .nargs = 2,
307bea63f2dds	  .args = { { Int, 0 }, { Ptr, 1 } } },
308c8d899bjhb	{ .name = "kldsym", .ret_type = 1, .nargs = 3,
309c8d899bjhb	  .args = { { Int, 0 }, { Kldsymcmd, 1 }, { Ptr, 2 } } },
3100e49f5djhb	{ .name = "kldunload", .ret_type = 1, .nargs = 1,
311bea63f2dds	  .args = { { Int, 0 } } },
312c8d899bjhb	{ .name = "kldunloadf", .ret_type = 1, .nargs = 2,
313c8d899bjhb	  .args = { { Int, 0 }, { Kldunloadflags, 1 } } },
3140e49f5djhb	{ .name = "kse_release", .ret_type = 0, .nargs = 1,
3150e49f5djhb	  .args = { { Timespec, 0 } } },
3160e49f5djhb	{ .name = "lchflags", .ret_type = 1, .nargs = 2,
317f99d0dfjhb	  .args = { { Name | IN, 0 }, { FileFlags, 1 } } },
3180e49f5djhb	{ .name = "lchmod", .ret_type = 1, .nargs = 2,
3190e49f5djhb	  .args = { { Name, 0 }, { Octal, 1 } } },
3200e49f5djhb	{ .name = "lchown", .ret_type = 1, .nargs = 3,
3210e49f5djhb	  .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
3220e49f5djhb	{ .name = "link", .ret_type = 1, .nargs = 2,
3230e49f5djhb	  .args = { { Name, 0 }, { Name, 1 } } },
3240e49f5djhb	{ .name = "linkat", .ret_type = 1, .nargs = 5,
3250e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 },
3260e49f5djhb		    { Atflags, 4 } } },
327be9e174tuexen	{ .name = "listen", .ret_type = 1, .nargs = 2,
328be9e174tuexen	  .args = { { Int, 0 }, { Int, 1 } } },
329be9e174tuexen 	{ .name = "lseek", .ret_type = 2, .nargs = 3,
3308ee439djhb	  .args = { { Int, 0 }, { QuadHex, 1 }, { Whence, 2 } } },
3310e49f5djhb	{ .name = "lstat", .ret_type = 1, .nargs = 2,
3320e49f5djhb	  .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
3330e49f5djhb	{ .name = "lutimes", .ret_type = 1, .nargs = 2,
3340e49f5djhb	  .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
3358c12f82jhb	{ .name = "madvise", .ret_type = 1, .nargs = 3,
3368c12f82jhb	  .args = { { Ptr, 0 }, { Sizet, 1 }, { Madvice, 2 } } },
3379f7cff7jhb	{ .name = "minherit", .ret_type = 1, .nargs = 3,
3389f7cff7jhb	  .args = { { Ptr, 0 }, { Sizet, 1 }, { Minherit, 2 } } },
3390e49f5djhb	{ .name = "mkdir", .ret_type = 1, .nargs = 2,
3400e49f5djhb	  .args = { { Name, 0 }, { Octal, 1 } } },
3410e49f5djhb	{ .name = "mkdirat", .ret_type = 1, .nargs = 3,
3420e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
3430e49f5djhb	{ .name = "mkfifo", .ret_type = 1, .nargs = 2,
3440e49f5djhb	  .args = { { Name, 0 }, { Octal, 1 } } },
3450e49f5djhb	{ .name = "mkfifoat", .ret_type = 1, .nargs = 3,
3460e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
3470e49f5djhb	{ .name = "mknod", .ret_type = 1, .nargs = 3,
3480e49f5djhb	  .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } },
3490e49f5djhb	{ .name = "mknodat", .ret_type = 1, .nargs = 4,
3500e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } },
35157871b1jhb	{ .name = "mlock", .ret_type = 1, .nargs = 2,
35257871b1jhb	  .args = { { Ptr, 0 }, { Sizet, 1 } } },
35357871b1jhb	{ .name = "mlockall", .ret_type = 1, .nargs = 1,
35457871b1jhb	  .args = { { Mlockall, 0 } } },
3550e49f5djhb	{ .name = "mmap", .ret_type = 1, .nargs = 6,
3568d3319ajhb	  .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 }, { Mmapflags, 3 },
3578ee439djhb		    { Int, 4 }, { QuadHex, 5 } } },
3587d42e26bdrewery	{ .name = "modfind", .ret_type = 1, .nargs = 1,
3597d42e26bdrewery	  .args = { { Name | IN, 0 } } },
3600e49f5djhb	{ .name = "mount", .ret_type = 1, .nargs = 4,
3613620dccjhb	  .args = { { Name, 0 }, { Name, 1 }, { Mountflags, 2 }, { Ptr, 3 } } },
3620e49f5djhb	{ .name = "mprotect", .ret_type = 1, .nargs = 3,
3638d3319ajhb	  .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 } } },
364d6c83afjhb	{ .name = "msync", .ret_type = 1, .nargs = 3,
365d6c83afjhb	  .args = { { Ptr, 0 }, { Sizet, 1 }, { Msync, 2 } } },
36657871b1jhb	{ .name = "munlock", .ret_type = 1, .nargs = 2,
36757871b1jhb	  .args = { { Ptr, 0 }, { Sizet, 1 } } },
3680e49f5djhb	{ .name = "munmap", .ret_type = 1, .nargs = 2,
3698d3319ajhb	  .args = { { Ptr, 0 }, { Sizet, 1 } } },
370e2fc305jhb	{ .name = "nanosleep", .ret_type = 1, .nargs = 1,
371bea63f2dds	  .args = { { Timespec, 0 } } },
3723620dccjhb	{ .name = "nmount", .ret_type = 1, .nargs = 3,
3733620dccjhb	  .args = { { Ptr, 0 }, { UInt, 1 }, { Mountflags, 2 } } },
3740e49f5djhb	{ .name = "open", .ret_type = 1, .nargs = 3,
3750e49f5djhb	  .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
3760e49f5djhb	{ .name = "openat", .ret_type = 1, .nargs = 4,
3770e49f5djhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Open, 2 },
3780e49f5djhb		    { Octal, 3 } } },
3790e49f5djhb	{ .name = "pathconf", .ret_type = 1, .nargs = 2,
3800e49f5djhb	  .args = { { Name | IN, 0 }, { Pathconf, 1 } } },
3810e49f5djhb	{ .name = "pipe", .ret_type = 1, .nargs = 1,
3820e49f5djhb	  .args = { { PipeFds | OUT, 0 } } },
3830e49f5djhb	{ .name = "pipe2", .ret_type = 1, .nargs = 2,
38427ec61ajhb	  .args = { { Ptr, 0 }, { Pipe2, 1 } } },
3850e49f5djhb	{ .name = "poll", .ret_type = 1, .nargs = 3,
3860e49f5djhb	  .args = { { Pollfd, 0 }, { Int, 1 }, { Int, 2 } } },
387cee7a83jhb	{ .name = "posix_fadvise", .ret_type = 1, .nargs = 4,
388cee7a83jhb	  .args = { { Int, 0 }, { QuadHex, 1 }, { QuadHex, 2 },
389cee7a83jhb		    { Fadvice, 3 } } },
3900e49f5djhb	{ .name = "posix_openpt", .ret_type = 1, .nargs = 1,
3910e49f5djhb	  .args = { { Open, 0 } } },
3921cc8254jhb	{ .name = "pread", .ret_type = 1, .nargs = 4,
3931cc8254jhb	  .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 },
3941cc8254jhb		    { QuadHex, 3 } } },
3950e49f5djhb	{ .name = "procctl", .ret_type = 1, .nargs = 4,
3968ee439djhb	  .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } },
39763413c4jhb	{ .name = "ptrace", .ret_type = 1, .nargs = 4,
39863413c4jhb	  .args = { { Ptraceop, 0 }, { Int, 1 }, { Ptr, 2 }, { Int, 3 } } },
3991cc8254jhb	{ .name = "pwrite", .ret_type = 1, .nargs = 4,
4001cc8254jhb	  .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 },
4011cc8254jhb		    { QuadHex, 3 } } },
402ee40b0cjhb	{ .name = "quotactl", .ret_type = 1, .nargs = 4,
403ee40b0cjhb	  .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } },
4040e49f5djhb	{ .name = "read", .ret_type = 1, .nargs = 3,
4058d3319ajhb	  .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } },
4060e49f5djhb	{ .name = "readlink", .ret_type = 1, .nargs = 3,
4078d3319ajhb	  .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } },
4080e49f5djhb	{ .name = "readlinkat", .ret_type = 1, .nargs = 4,
4090e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 },
4108d3319ajhb		    { Sizet, 3 } } },
411ee7f061tuexen	{ .name = "readv", .ret_type = 1, .nargs = 3,
412ee7f061tuexen	  .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 } } },
413db8f3a8jhb	{ .name = "reboot", .ret_type = 1, .nargs = 1,
414db8f3a8jhb	  .args = { { Reboothowto, 0 } } },
4150e49f5djhb	{ .name = "recvfrom", .ret_type = 1, .nargs = 6,
41687e3c6dtuexen	  .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 },
41787e3c6dtuexen	            { Msgflags, 3 }, { Sockaddr | OUT, 4 },
41887e3c6dtuexen	            { Ptr | OUT, 5 } } },
4190bee01ctuexen	{ .name = "recvmsg", .ret_type = 1, .nargs = 3,
4203c9ef68tuexen	  .args = { { Int, 0 }, { Msghdr | OUT, 1 }, { Msgflags, 2 } } },
4210e49f5djhb	{ .name = "rename", .ret_type = 1, .nargs = 2,
4220e49f5djhb	  .args = { { Name, 0 }, { Name, 1 } } },
4230e49f5djhb	{ .name = "renameat", .ret_type = 1, .nargs = 4,
4240e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } },
4250e49f5djhb	{ .name = "rfork", .ret_type = 1, .nargs = 1,
4260e49f5djhb	  .args = { { Rforkflags, 0 } } },
427b362cc6bdrewery	{ .name = "rmdir", .ret_type = 1, .nargs = 1,
428b362cc6bdrewery	  .args = { { Name, 0 } } },
429ce50dd4jhb	{ .name = "rtprio", .ret_type = 1, .nargs = 3,
430ce50dd4jhb	  .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } },
431ce50dd4jhb	{ .name = "rtprio_thread", .ret_type = 1, .nargs = 3,
432ce50dd4jhb	  .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } },
433f4dd073jhb	{ .name = "sched_get_priority_max", .ret_type = 1, .nargs = 1,
434f4dd073jhb	  .args = { { Schedpolicy, 0 } } },
435f4dd073jhb	{ .name = "sched_get_priority_min", .ret_type = 1, .nargs = 1,
436f4dd073jhb	  .args = { { Schedpolicy, 0 } } },
437f4dd073jhb	{ .name = "sched_getparam", .ret_type = 1, .nargs = 2,
438f4dd073jhb	  .args = { { Int, 0 }, { Schedparam | OUT, 1 } } },
439f4dd073jhb	{ .name = "sched_getscheduler", .ret_type = 1, .nargs = 1,
440f4dd073jhb	  .args = { { Int, 0 } } },
441f4dd073jhb	{ .name = "sched_rr_get_interval", .ret_type = 1, .nargs = 2,
442f4dd073jhb	  .args = { { Int, 0 }, { Timespec | OUT, 1 } } },
443f4dd073jhb	{ .name = "sched_setparam", .ret_type = 1, .nargs = 2,
444f4dd073jhb	  .args = { { Int, 0 }, { Schedparam, 1 } } },
445f4dd073jhb	{ .name = "sched_setscheduler", .ret_type = 1, .nargs = 3,
446f4dd073jhb	  .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } },
447f912057tuexen	{ .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7,
4484b456d8tuexen	  .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 },
4494b456d8tuexen	            { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 },
4504b456d8tuexen	            { Sctpsndrcvinfo | OUT, 5 }, { Ptr | OUT, 6 } } },
451f912057tuexen	{ .name = "sctp_generic_sendmsg", .ret_type = 1, .nargs = 7,
452f912057tuexen	  .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 },
4534b456d8tuexen	            { Sockaddr | IN, 3 }, { Socklent, 4 },
4544b456d8tuexen	            { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } },
4554b456d8tuexen	{ .name = "sctp_generic_sendmsg_iov", .ret_type = 1, .nargs = 7,
4564b456d8tuexen	  .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 },
4574b456d8tuexen	            { Sockaddr | IN, 3 }, { Socklent, 4 },
4584b456d8tuexen	            { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } },
459bea63f2dds	{ .name = "select", .ret_type = 1, .nargs = 5,
46086e1324jhb	  .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 },
46186e1324jhb		    { Timeval, 4 } } },
4620bee01ctuexen	{ .name = "sendmsg", .ret_type = 1, .nargs = 3,
4633c9ef68tuexen	  .args = { { Int, 0 }, { Msghdr | IN, 1 }, { Msgflags, 2 } } },
4640e49f5djhb	{ .name = "sendto", .ret_type = 1, .nargs = 6,
46587e3c6dtuexen	  .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 },
46687e3c6dtuexen	            { Msgflags, 3 }, { Sockaddr | IN, 4 },
46787e3c6dtuexen	            { Socklent | IN, 5 } } },
468bea63f2dds	{ .name = "setitimer", .ret_type = 1, .nargs = 3,
469b62aca3jhb	  .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } },
470f2050b8jhb	{ .name = "setpriority", .ret_type = 1, .nargs = 3,
471f2050b8jhb	  .args = { { Priowhich, 0 }, { Int, 1 }, { Int, 2 } } },
4720e49f5djhb	{ .name = "setrlimit", .ret_type = 1, .nargs = 2,
4730e49f5djhb	  .args = { { Resource, 0 }, { Rlimit | IN, 1 } } },
47400de84btuexen	{ .name = "setsockopt", .ret_type = 1, .nargs = 5,
47500de84btuexen	  .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 },
47600de84btuexen		    { Ptr | IN, 3 }, { Socklent, 4 } } },
4770bdd1efallanjude	{ .name = "shm_open", .ret_type = 1, .nargs = 3,
478aea7646tmunro	  .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
479c6756e6kevans	{ .name = "shm_open2", .ret_type = 1, .nargs = 5,
480c6756e6kevans	  .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 },
481c7f955ckevans		    { ShmFlags, 3 }, { Name | IN, 4 } } },
482edad331dab	{ .name = "shm_rename", .ret_type = 1, .nargs = 3,
483edad331dab	  .args = { { Name | IN, 0 }, { Name | IN, 1 }, { Hex, 2 } } },
4840bdd1efallanjude	{ .name = "shm_unlink", .ret_type = 1, .nargs = 1,
4850bdd1efallanjude	  .args = { { Name | IN, 0 } } },
4860e49f5djhb	{ .name = "shutdown", .ret_type = 1, .nargs = 2,
4870e49f5djhb	  .args = { { Int, 0 }, { Shutdown, 1 } } },
4880e49f5djhb	{ .name = "sigaction", .ret_type = 1, .nargs = 3,
4890e49f5djhb	  .args = { { Signal, 0 }, { Sigaction | IN, 1 },
4900e49f5djhb		    { Sigaction | OUT, 2 } } },
491e2fc305jhb	{ .name = "sigpending", .ret_type = 1, .nargs = 1,
4925c8f890jhb	  .args = { { Sigset | OUT, 0 } } },
493e2fc305jhb	{ .name = "sigprocmask", .ret_type = 1, .nargs = 3,
494bea63f2dds	  .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } },
495e2fc305jhb	{ .name = "sigqueue", .ret_type = 1, .nargs = 3,
4965c8f890jhb	  .args = { { Int, 0 }, { Signal, 1 }, { LongHex, 2 } } },
497e2fc305jhb	{ .name = "sigreturn", .ret_type = 1, .nargs = 1,
4985c8f890jhb	  .args = { { Ptr, 0 } } },
499e2fc305jhb	{ .name = "sigsuspend", .ret_type = 1, .nargs = 1,
5005c8f890jhb	  .args = { { Sigset | IN, 0 } } },
5015c8f890jhb	{ .name = "sigtimedwait", .ret_type = 1, .nargs = 3,
50212b7246jhb	  .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 },
50312b7246jhb		    { Timespec | IN, 2 } } },
5045c8f890jhb	{ .name = "sigwait", .ret_type = 1, .nargs = 2,
50512b7246jhb	  .args = { { Sigset | IN, 0 }, { PSig | OUT, 1 } } },
5065c8f890jhb	{ .name = "sigwaitinfo", .ret_type = 1, .nargs = 2,
50712b7246jhb	  .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 } } },
508bea63f2dds	{ .name = "socket", .ret_type = 1, .nargs = 3,
50972a6041tuexen	  .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } },
5100e49f5djhb	{ .name = "stat", .ret_type = 1, .nargs = 2,
5110e49f5djhb	  .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
5120e49f5djhb	{ .name = "statfs", .ret_type = 1, .nargs = 2,
5130e49f5djhb	  .args = { { Name | IN, 0 }, { StatFs | OUT, 1 } } },
514bea63f2dds	{ .name = "symlink", .ret_type = 1, .nargs = 2,
515b62aca3jhb	  .args = { { Name, 0 }, { Name, 1 } } },
516cb8b7b2jhb	{ .name = "symlinkat", .ret_type = 1, .nargs = 3,
517cb8b7b2jhb	  .args = { { Name, 0 }, { Atfd, 1 }, { Name, 2 } } },
5180e49f5djhb	{ .name = "sysarch", .ret_type = 1, .nargs = 2,
5190e49f5djhb	  .args = { { Sysarch, 0 }, { Ptr, 1 } } },
52014aef6dkib	{ .name = "__sysctl", .ret_type = 1, .nargs = 6,
52114aef6dkib	  .args = { { Sysctl, 0 }, { Sizet, 1 }, { Ptr, 2 }, { Ptr, 3 },
52214aef6dkib	            { Ptr, 4 }, { Sizet, 5 } } },
52314aef6dkib	{ .name = "__sysctlbyname", .ret_type = 1, .nargs = 6,
52414aef6dkib	  .args = { { Name, 0 }, { Sizet, 1 }, { Ptr, 2 }, { Ptr, 3 },
52514aef6dkib	            { Ptr, 4}, { Sizet, 5 } } },
5260e49f5djhb	{ .name = "thr_kill", .ret_type = 1, .nargs = 2,
5270e49f5djhb	  .args = { { Long, 0 }, { Signal, 1 } } },
5280e49f5djhb	{ .name = "thr_self", .ret_type = 1, .nargs = 1,
5290e49f5djhb	  .args = { { Ptr, 0 } } },
530f24b1ffjhb	{ .name = "thr_set_name", .ret_type = 1, .nargs = 2,
531f24b1ffjhb	  .args = { { Long, 0 }, { Name, 1 } } },
5320e49f5djhb	{ .name = "truncate", .ret_type = 1, .nargs = 2,
5338ee439djhb	  .args = { { Name | IN, 0 }, { QuadHex | IN, 1 } } },
5340e49f5djhb#if 0
5350e49f5djhb	/* Does not exist */
5360e49f5djhb	{ .name = "umount", .ret_type = 1, .nargs = 2,
5370e49f5djhb	  .args = { { Name, 0 }, { Int, 2 } } },
5380e49f5djhb#endif
5390e49f5djhb	{ .name = "unlink", .ret_type = 1, .nargs = 1,
5400e49f5djhb	  .args = { { Name, 0 } } },
5410e49f5djhb	{ .name = "unlinkat", .ret_type = 1, .nargs = 3,
5420e49f5djhb	  .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } },
5430e49f5djhb	{ .name = "unmount", .ret_type = 1, .nargs = 2,
5443620dccjhb	  .args = { { Name, 0 }, { Mountflags, 1 } } },
5450e49f5djhb	{ .name = "utimensat", .ret_type = 1, .nargs = 4,
5460e49f5djhb	  .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 },
5470e49f5djhb		    { Atflags, 3 } } },
5480e49f5djhb	{ .name = "utimes", .ret_type = 1, .nargs = 2,
5490e49f5djhb	  .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
5507c2a5d7bdrewery	{ .name = "utrace", .ret_type = 1, .nargs = 1,
5517c2a5d7bdrewery	  .args = { { Utrace, 0 } } },
552e4d9007jhb	{ .name = "wait4", .ret_type = 1, .nargs = 4,
553e4d9007jhb	  .args = { { Int, 0 }, { ExitStatus | OUT, 1 }, { Waitoptions, 2 },
554e4d9007jhb		    { Rusage | OUT, 3 } } },
555e4d9007jhb	{ .name = "wait6", .ret_type = 1, .nargs = 6,
5568ee439djhb	  .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 },
55712b7246jhb		    { Waitoptions, 3 }, { Rusage | OUT, 4 },
55812b7246jhb		    { Siginfo | OUT, 5 } } },
5590e49f5djhb	{ .name = "write", .ret_type = 1, .nargs = 3,
5608d3319ajhb	  .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } },
56132d05bctuexen	{ .name = "writev", .ret_type = 1, .nargs = 3,
562445752dtuexen	  .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 } } },
5630e49f5djhb
5640e49f5djhb	/* Linux ABI */
5650e49f5djhb	{ .name = "linux_access", .ret_type = 1, .nargs = 2,
5660e49f5djhb	  .args = { { Name, 0 }, { Accessmode, 1 } } },
5670e49f5djhb	{ .name = "linux_execve", .ret_type = 1, .nargs = 3,
5680e49f5djhb	  .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
5690e49f5djhb		    { ExecEnv | IN, 2 } } },
5700e49f5djhb	{ .name = "linux_lseek", .ret_type = 2, .nargs = 3,
5710e49f5djhb	  .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } },
5720e49f5djhb	{ .name = "linux_mkdir", .ret_type = 1, .nargs = 2,
5730e49f5djhb	  .args = { { Name | IN, 0 }, { Int, 1 } } },
5740e49f5djhb	{ .name = "linux_newfstat", .ret_type = 1, .nargs = 2,
5750e49f5djhb	  .args = { { Int, 0 }, { Ptr | OUT, 1 } } },
5760e49f5djhb	{ .name = "linux_newstat", .ret_type = 1, .nargs = 2,
5770e49f5djhb	  .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } },
5780e49f5djhb	{ .name = "linux_open", .ret_type = 1, .nargs = 3,
5790e49f5djhb	  .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } },
5800e49f5djhb	{ .name = "linux_readlink", .ret_type = 1, .nargs = 3,
5818d3319ajhb	  .args = { { Name, 0 }, { Name | OUT, 1 }, { Sizet, 2 } } },
5820e49f5djhb	{ .name = "linux_socketcall", .ret_type = 1, .nargs = 2,
5830e49f5djhb	  .args = { { Int, 0 }, { LinuxSockArgs, 1 } } },
584228502bjhb	{ .name = "linux_stat64", .ret_type = 1, .nargs = 2,
585228502bjhb	  .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } },
5860e49f5djhb
587d297893ed	/* CloudABI system calls. */
588d297893ed	{ .name = "cloudabi_sys_clock_res_get", .ret_type = 1, .nargs = 1,
589d297893ed	  .args = { { CloudABIClockID, 0 } } },
590d297893ed	{ .name = "cloudabi_sys_clock_time_get", .ret_type = 1, .nargs = 2,
591d297893ed	  .args = { { CloudABIClockID, 0 }, { CloudABITimestamp, 1 } } },
592d297893ed	{ .name = "cloudabi_sys_condvar_signal", .ret_type = 1, .nargs = 3,
593d297893ed	  .args = { { Ptr, 0 }, { CloudABIMFlags, 1 }, { UInt, 2 } } },
594d297893ed	{ .name = "cloudabi_sys_fd_close", .ret_type = 1, .nargs = 1,
595d297893ed	  .args = { { Int, 0 } } },
596d297893ed	{ .name = "cloudabi_sys_fd_create1", .ret_type = 1, .nargs = 1,
597d297893ed	  .args = { { CloudABIFileType, 0 } } },
598d297893ed	{ .name = "cloudabi_sys_fd_create2", .ret_type = 1, .nargs = 2,
599d297893ed	  .args = { { CloudABIFileType, 0 }, { PipeFds | OUT, 0 } } },
600d297893ed	{ .name = "cloudabi_sys_fd_datasync", .ret_type = 1, .nargs = 1,
601d297893ed	  .args = { { Int, 0 } } },
602d297893ed	{ .name = "cloudabi_sys_fd_dup", .ret_type = 1, .nargs = 1,
603d297893ed	  .args = { { Int, 0 } } },
604d297893ed	{ .name = "cloudabi_sys_fd_replace", .ret_type = 1, .nargs = 2,
605d297893ed	  .args = { { Int, 0 }, { Int, 1 } } },
606d297893ed	{ .name = "cloudabi_sys_fd_seek", .ret_type = 1, .nargs = 3,
607d297893ed	  .args = { { Int, 0 }, { Int, 1 }, { CloudABIWhence, 2 } } },
608d297893ed	{ .name = "cloudabi_sys_fd_stat_get", .ret_type = 1, .nargs = 2,
609d297893ed	  .args = { { Int, 0 }, { CloudABIFDStat | OUT, 1 } } },
610d297893ed	{ .name = "cloudabi_sys_fd_stat_put", .ret_type = 1, .nargs = 3,
611d297893ed	  .args = { { Int, 0 }, { CloudABIFDStat | IN, 1 },
6120624ccfjhb	            { CloudABIFDSFlags, 2 } } },
613d297893ed	{ .name = "cloudabi_sys_fd_sync", .ret_type = 1, .nargs = 1,
614d297893ed	  .args = { { Int, 0 } } },
615d297893ed	{ .name = "cloudabi_sys_file_advise", .ret_type = 1, .nargs = 4,
616d297893ed	  .args = { { Int, 0 }, { Int, 1 }, { Int, 2 },
617d297893ed	            { CloudABIAdvice, 3 } } },
618d297893ed	{ .name = "cloudabi_sys_file_allocate", .ret_type = 1, .nargs = 3,
619d297893ed	  .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } },
620d297893ed	{ .name = "cloudabi_sys_file_create", .ret_type = 1, .nargs = 3,
621d297893ed	  .args = { { Int, 0 }, { BinString | IN, 1 },
622d297893ed	            { CloudABIFileType, 3 } } },
623d297893ed	{ .name = "cloudabi_sys_file_link", .ret_type = 1, .nargs = 4,
624d297893ed	  .args = { { CloudABILookup, 0 }, { BinString | IN, 1 },
625d297893ed	            { Int, 3 }, { BinString | IN, 4 } } },
626d297893ed	{ .name = "cloudabi_sys_file_open", .ret_type = 1, .nargs = 4,
627d297893ed	  .args = { { Int, 0 }, { BinString | IN, 1 },
628d297893ed	            { CloudABIOFlags, 3 }, { CloudABIFDStat | IN, 4 } } },
629