Index: head/sys/compat/cloudabi/cloudabi_fd.c =================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c (revision 322884) +++ head/sys/compat/cloudabi/cloudabi_fd.c (revision 322885) @@ -1,529 +1,513 @@ /*- * Copyright (c) 2015 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Translation between CloudABI and Capsicum rights. */ #define RIGHTS_MAPPINGS \ MAPPING(CLOUDABI_RIGHT_FD_DATASYNC, CAP_FSYNC) \ MAPPING(CLOUDABI_RIGHT_FD_READ, CAP_READ) \ MAPPING(CLOUDABI_RIGHT_FD_SEEK, CAP_SEEK) \ MAPPING(CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS, CAP_FCNTL) \ MAPPING(CLOUDABI_RIGHT_FD_SYNC, CAP_FSYNC) \ MAPPING(CLOUDABI_RIGHT_FD_TELL, CAP_SEEK_TELL) \ MAPPING(CLOUDABI_RIGHT_FD_WRITE, CAP_WRITE) \ MAPPING(CLOUDABI_RIGHT_FILE_ADVISE) \ MAPPING(CLOUDABI_RIGHT_FILE_ALLOCATE, CAP_WRITE) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY, CAP_MKDIRAT) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FILE, CAP_CREATE) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FIFO, CAP_MKFIFOAT) \ MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LINKAT_SOURCE) \ MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT_TARGET) \ MAPPING(CLOUDABI_RIGHT_FILE_OPEN, CAP_LOOKUP) \ MAPPING(CLOUDABI_RIGHT_FILE_READDIR, CAP_READ) \ MAPPING(CLOUDABI_RIGHT_FILE_READLINK, CAP_LOOKUP) \ MAPPING(CLOUDABI_RIGHT_FILE_RENAME_SOURCE, CAP_RENAMEAT_SOURCE) \ MAPPING(CLOUDABI_RIGHT_FILE_RENAME_TARGET, CAP_RENAMEAT_TARGET) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FGET, CAP_FSTAT) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE, CAP_FTRUNCATE) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES, CAP_FUTIMES) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_GET, CAP_FSTATAT) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES, CAP_FUTIMESAT) \ MAPPING(CLOUDABI_RIGHT_FILE_SYMLINK, CAP_SYMLINKAT) \ MAPPING(CLOUDABI_RIGHT_FILE_UNLINK, CAP_UNLINKAT) \ MAPPING(CLOUDABI_RIGHT_MEM_MAP, CAP_MMAP) \ MAPPING(CLOUDABI_RIGHT_MEM_MAP_EXEC, CAP_MMAP_X) \ MAPPING(CLOUDABI_RIGHT_POLL_FD_READWRITE, CAP_EVENT) \ MAPPING(CLOUDABI_RIGHT_POLL_MODIFY, CAP_KQUEUE_CHANGE) \ MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_EVENT) \ MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \ MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE) \ MAPPING(CLOUDABI_RIGHT_SOCK_ACCEPT, CAP_ACCEPT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY, CAP_BINDAT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_BIND_SOCKET, CAP_BIND) \ - MAPPING(CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY, CAP_CONNECTAT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET, CAP_CONNECT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_LISTEN, CAP_LISTEN) \ MAPPING(CLOUDABI_RIGHT_SOCK_SHUTDOWN, CAP_SHUTDOWN) \ MAPPING(CLOUDABI_RIGHT_SOCK_STAT_GET, CAP_GETPEERNAME, \ CAP_GETSOCKNAME, CAP_GETSOCKOPT) int cloudabi_sys_fd_close(struct thread *td, struct cloudabi_sys_fd_close_args *uap) { return (kern_close(td, uap->fd)); } int cloudabi_sys_fd_create1(struct thread *td, struct cloudabi_sys_fd_create1_args *uap) { struct filecaps fcaps = {}; switch (uap->type) { case CLOUDABI_FILETYPE_POLL: cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_KQUEUE); return (kern_kqueue(td, 0, &fcaps)); case CLOUDABI_FILETYPE_SHARED_MEMORY: cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); return (kern_shm_open(td, SHM_ANON, O_RDWR, 0, &fcaps)); - case CLOUDABI_FILETYPE_SOCKET_DGRAM: - return (kern_socket(td, AF_UNIX, SOCK_DGRAM, 0)); - case CLOUDABI_FILETYPE_SOCKET_STREAM: - return (kern_socket(td, AF_UNIX, SOCK_STREAM, 0)); default: return (EINVAL); } } int cloudabi_sys_fd_create2(struct thread *td, struct cloudabi_sys_fd_create2_args *uap) { struct filecaps fcaps1 = {}, fcaps2 = {}; int fds[2]; int error; switch (uap->type) { case CLOUDABI_FILETYPE_FIFO: /* * CloudABI pipes are unidirectional. Restrict rights on * the pipe to simulate this. */ cap_rights_init(&fcaps1.fc_rights, CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_READ); fcaps1.fc_fcntls = CAP_FCNTL_SETFL; cap_rights_init(&fcaps2.fc_rights, CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_WRITE); fcaps2.fc_fcntls = CAP_FCNTL_SETFL; error = kern_pipe(td, fds, 0, &fcaps1, &fcaps2); break; case CLOUDABI_FILETYPE_SOCKET_DGRAM: error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds); break; case CLOUDABI_FILETYPE_SOCKET_STREAM: error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds); break; default: return (EINVAL); } if (error == 0) { td->td_retval[0] = fds[0]; td->td_retval[1] = fds[1]; } return (0); } int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { return (kern_fsync(td, uap->fd, false)); } int cloudabi_sys_fd_dup(struct thread *td, struct cloudabi_sys_fd_dup_args *uap) { return (kern_dup(td, FDDUP_NORMAL, 0, uap->from, 0)); } int cloudabi_sys_fd_replace(struct thread *td, struct cloudabi_sys_fd_replace_args *uap) { int error; /* * CloudABI's equivalent to dup2(). CloudABI processes should * not depend on hardcoded file descriptor layouts, but simply * use the file descriptor numbers that are allocated by the * kernel. Duplicating file descriptors to arbitrary numbers * should not be done. * * Invoke kern_dup() with FDDUP_MUSTREPLACE, so that we return * EBADF when duplicating to a nonexistent file descriptor. Also * clear the return value, as this system call yields no return * value. */ error = kern_dup(td, FDDUP_MUSTREPLACE, 0, uap->from, uap->to); td->td_retval[0] = 0; return (error); } int cloudabi_sys_fd_seek(struct thread *td, struct cloudabi_sys_fd_seek_args *uap) { int whence; switch (uap->whence) { case CLOUDABI_WHENCE_CUR: whence = SEEK_CUR; break; case CLOUDABI_WHENCE_END: whence = SEEK_END; break; case CLOUDABI_WHENCE_SET: whence = SEEK_SET; break; default: return (EINVAL); } return (kern_lseek(td, uap->fd, uap->offset, whence)); } /* Converts a file descriptor to a CloudABI file descriptor type. */ cloudabi_filetype_t cloudabi_convert_filetype(const struct file *fp) { struct socket *so; struct vnode *vp; switch (fp->f_type) { case DTYPE_FIFO: return (CLOUDABI_FILETYPE_FIFO); case DTYPE_KQUEUE: return (CLOUDABI_FILETYPE_POLL); case DTYPE_PIPE: return (CLOUDABI_FILETYPE_FIFO); case DTYPE_PROCDESC: return (CLOUDABI_FILETYPE_PROCESS); case DTYPE_SHM: return (CLOUDABI_FILETYPE_SHARED_MEMORY); case DTYPE_SOCKET: so = fp->f_data; switch (so->so_type) { case SOCK_DGRAM: return (CLOUDABI_FILETYPE_SOCKET_DGRAM); case SOCK_STREAM: return (CLOUDABI_FILETYPE_SOCKET_STREAM); default: return (CLOUDABI_FILETYPE_UNKNOWN); } case DTYPE_VNODE: vp = fp->f_vnode; switch (vp->v_type) { case VBLK: return (CLOUDABI_FILETYPE_BLOCK_DEVICE); case VCHR: return (CLOUDABI_FILETYPE_CHARACTER_DEVICE); case VDIR: return (CLOUDABI_FILETYPE_DIRECTORY); case VFIFO: return (CLOUDABI_FILETYPE_FIFO); case VLNK: return (CLOUDABI_FILETYPE_SYMBOLIC_LINK); case VREG: return (CLOUDABI_FILETYPE_REGULAR_FILE); case VSOCK: return (CLOUDABI_FILETYPE_SOCKET_STREAM); default: return (CLOUDABI_FILETYPE_UNKNOWN); } default: return (CLOUDABI_FILETYPE_UNKNOWN); } } /* Removes rights that conflict with the file descriptor type. */ void cloudabi_remove_conflicting_rights(cloudabi_filetype_t filetype, cloudabi_rights_t *base, cloudabi_rights_t *inheriting) { /* * CloudABI has a small number of additional rights bits to * disambiguate between multiple purposes. Remove the bits that * don't apply to the type of the file descriptor. * * As file descriptor access modes (O_ACCMODE) has been fully * replaced by rights bits, CloudABI distinguishes between * rights that apply to the file descriptor itself (base) versus * rights of new file descriptors derived from them * (inheriting). The code below approximates the pair by * decomposing depending on the file descriptor type. * * We need to be somewhat accurate about which actions can * actually be performed on the file descriptor, as functions * like fcntl(fd, F_GETFL) are emulated on top of this. */ switch (filetype) { case CLOUDABI_FILETYPE_DIRECTORY: *base &= CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | CLOUDABI_RIGHT_FD_SYNC | CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY | CLOUDABI_RIGHT_FILE_CREATE_FILE | CLOUDABI_RIGHT_FILE_CREATE_FIFO | CLOUDABI_RIGHT_FILE_LINK_SOURCE | CLOUDABI_RIGHT_FILE_LINK_TARGET | CLOUDABI_RIGHT_FILE_OPEN | CLOUDABI_RIGHT_FILE_READDIR | CLOUDABI_RIGHT_FILE_READLINK | CLOUDABI_RIGHT_FILE_RENAME_SOURCE | CLOUDABI_RIGHT_FILE_RENAME_TARGET | CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES | CLOUDABI_RIGHT_FILE_STAT_GET | CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES | CLOUDABI_RIGHT_FILE_SYMLINK | CLOUDABI_RIGHT_FILE_UNLINK | - CLOUDABI_RIGHT_POLL_FD_READWRITE | - CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY | - CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY; + CLOUDABI_RIGHT_POLL_FD_READWRITE; *inheriting &= CLOUDABI_RIGHT_FD_DATASYNC | CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_SEEK | CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | CLOUDABI_RIGHT_FD_SYNC | CLOUDABI_RIGHT_FD_TELL | CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_FILE_ALLOCATE | CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY | CLOUDABI_RIGHT_FILE_CREATE_FILE | CLOUDABI_RIGHT_FILE_CREATE_FIFO | CLOUDABI_RIGHT_FILE_LINK_SOURCE | CLOUDABI_RIGHT_FILE_LINK_TARGET | CLOUDABI_RIGHT_FILE_OPEN | CLOUDABI_RIGHT_FILE_READDIR | CLOUDABI_RIGHT_FILE_READLINK | CLOUDABI_RIGHT_FILE_RENAME_SOURCE | CLOUDABI_RIGHT_FILE_RENAME_TARGET | CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE | CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES | CLOUDABI_RIGHT_FILE_STAT_GET | CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES | CLOUDABI_RIGHT_FILE_SYMLINK | CLOUDABI_RIGHT_FILE_UNLINK | CLOUDABI_RIGHT_MEM_MAP | CLOUDABI_RIGHT_MEM_MAP_EXEC | CLOUDABI_RIGHT_POLL_FD_READWRITE | - CLOUDABI_RIGHT_PROC_EXEC | - CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY | - CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY; + CLOUDABI_RIGHT_PROC_EXEC; break; case CLOUDABI_FILETYPE_FIFO: *base &= CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_POLL_FD_READWRITE; *inheriting = 0; break; case CLOUDABI_FILETYPE_POLL: *base &= ~CLOUDABI_RIGHT_FILE_ADVISE; *inheriting = 0; break; case CLOUDABI_FILETYPE_PROCESS: *base &= ~(CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_POLL_FD_READWRITE); *inheriting = 0; break; case CLOUDABI_FILETYPE_REGULAR_FILE: *base &= CLOUDABI_RIGHT_FD_DATASYNC | CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_SEEK | CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | CLOUDABI_RIGHT_FD_SYNC | CLOUDABI_RIGHT_FD_TELL | CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_FILE_ALLOCATE | CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE | CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES | CLOUDABI_RIGHT_MEM_MAP | CLOUDABI_RIGHT_MEM_MAP_EXEC | CLOUDABI_RIGHT_POLL_FD_READWRITE | CLOUDABI_RIGHT_PROC_EXEC; *inheriting = 0; break; case CLOUDABI_FILETYPE_SHARED_MEMORY: *base &= ~(CLOUDABI_RIGHT_FD_SEEK | CLOUDABI_RIGHT_FD_TELL | CLOUDABI_RIGHT_FILE_ADVISE | CLOUDABI_RIGHT_FILE_ALLOCATE | CLOUDABI_RIGHT_FILE_READDIR); *inheriting = 0; break; case CLOUDABI_FILETYPE_SOCKET_DGRAM: case CLOUDABI_FILETYPE_SOCKET_STREAM: *base &= CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS | CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_POLL_FD_READWRITE | CLOUDABI_RIGHT_SOCK_ACCEPT | - CLOUDABI_RIGHT_SOCK_BIND_SOCKET | - CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET | - CLOUDABI_RIGHT_SOCK_LISTEN | CLOUDABI_RIGHT_SOCK_SHUTDOWN | CLOUDABI_RIGHT_SOCK_STAT_GET; break; default: *inheriting = 0; break; } } /* Converts FreeBSD's Capsicum rights to CloudABI's set of rights. */ static void convert_capabilities(const cap_rights_t *capabilities, cloudabi_filetype_t filetype, cloudabi_rights_t *base, cloudabi_rights_t *inheriting) { cloudabi_rights_t rights; /* Convert FreeBSD bits to CloudABI bits. */ rights = 0; #define MAPPING(cloudabi, ...) do { \ if (cap_rights_is_set(capabilities, ##__VA_ARGS__)) \ rights |= (cloudabi); \ } while (0); RIGHTS_MAPPINGS #undef MAPPING *base = rights; *inheriting = rights; cloudabi_remove_conflicting_rights(filetype, base, inheriting); } int cloudabi_sys_fd_stat_get(struct thread *td, struct cloudabi_sys_fd_stat_get_args *uap) { cloudabi_fdstat_t fsb = {}; struct file *fp; cap_rights_t rights; struct filecaps fcaps; int error, oflags; /* Obtain file descriptor properties. */ error = fget_cap(td, uap->fd, cap_rights_init(&rights), &fp, &fcaps); if (error != 0) return (error); oflags = OFLAGS(fp->f_flag); fsb.fs_filetype = cloudabi_convert_filetype(fp); fdrop(fp, td); /* Convert file descriptor flags. */ if (oflags & O_APPEND) fsb.fs_flags |= CLOUDABI_FDFLAG_APPEND; if (oflags & O_NONBLOCK) fsb.fs_flags |= CLOUDABI_FDFLAG_NONBLOCK; if (oflags & O_SYNC) fsb.fs_flags |= CLOUDABI_FDFLAG_SYNC; /* Convert capabilities to CloudABI rights. */ convert_capabilities(&fcaps.fc_rights, fsb.fs_filetype, &fsb.fs_rights_base, &fsb.fs_rights_inheriting); filecaps_free(&fcaps); return (copyout(&fsb, (void *)uap->buf, sizeof(fsb))); } /* Converts CloudABI rights to a set of Capsicum capabilities. */ int cloudabi_convert_rights(cloudabi_rights_t in, cap_rights_t *out) { cap_rights_init(out); #define MAPPING(cloudabi, ...) do { \ if (in & (cloudabi)) { \ cap_rights_set(out, ##__VA_ARGS__); \ in &= ~(cloudabi); \ } \ } while (0); RIGHTS_MAPPINGS #undef MAPPING if (in != 0) return (ENOTCAPABLE); return (0); } int cloudabi_sys_fd_stat_put(struct thread *td, struct cloudabi_sys_fd_stat_put_args *uap) { cloudabi_fdstat_t fsb; cap_rights_t rights; int error, oflags; error = copyin(uap->buf, &fsb, sizeof(fsb)); if (error != 0) return (error); if (uap->flags == CLOUDABI_FDSTAT_FLAGS) { /* Convert flags. */ oflags = 0; if (fsb.fs_flags & CLOUDABI_FDFLAG_APPEND) oflags |= O_APPEND; if (fsb.fs_flags & CLOUDABI_FDFLAG_NONBLOCK) oflags |= O_NONBLOCK; if (fsb.fs_flags & (CLOUDABI_FDFLAG_SYNC | CLOUDABI_FDFLAG_DSYNC | CLOUDABI_FDFLAG_RSYNC)) oflags |= O_SYNC; return (kern_fcntl(td, uap->fd, F_SETFL, oflags)); } else if (uap->flags == CLOUDABI_FDSTAT_RIGHTS) { /* Convert rights. */ error = cloudabi_convert_rights( fsb.fs_rights_base | fsb.fs_rights_inheriting, &rights); if (error != 0) return (error); return (kern_cap_rights_limit(td, uap->fd, &rights)); } return (EINVAL); } int cloudabi_sys_fd_sync(struct thread *td, struct cloudabi_sys_fd_sync_args *uap) { return (kern_fsync(td, uap->fd, true)); } Index: head/sys/compat/cloudabi/cloudabi_sock.c =================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c (revision 322884) +++ head/sys/compat/cloudabi/cloudabi_sock.c (revision 322885) @@ -1,283 +1,222 @@ /*- * Copyright (c) 2015-2017 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include -#include #include #include #include #include #include -/* Copies a pathname into a UNIX socket address structure. */ -static int -copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun) -{ - int error; - - /* Copy in pathname string if there's enough space. */ - if (pathlen >= sizeof(sun->sun_path)) - return (ENAMETOOLONG); - error = copyin(path, &sun->sun_path, pathlen); - if (error != 0) - return (error); - if (memchr(sun->sun_path, '\0', pathlen) != NULL) - return (EINVAL); - - /* Initialize the rest of the socket address. */ - sun->sun_path[pathlen] = '\0'; - sun->sun_family = AF_UNIX; - sun->sun_len = sizeof(*sun); - return (0); -} - int cloudabi_sys_sock_accept(struct thread *td, struct cloudabi_sys_sock_accept_args *uap) { return (kern_accept(td, uap->sock, NULL, NULL, NULL)); } int -cloudabi_sys_sock_bind(struct thread *td, - struct cloudabi_sys_sock_bind_args *uap) -{ - struct sockaddr_un sun; - int error; - - error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); - if (error != 0) - return (error); - return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun)); -} - -int -cloudabi_sys_sock_connect(struct thread *td, - struct cloudabi_sys_sock_connect_args *uap) -{ - struct sockaddr_un sun; - int error; - - error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); - if (error != 0) - return (error); - return (kern_connectat(td, uap->fd, uap->sock, - (struct sockaddr *)&sun)); -} - -int -cloudabi_sys_sock_listen(struct thread *td, - struct cloudabi_sys_sock_listen_args *uap) -{ - - return (kern_listen(td, uap->sock, uap->backlog)); -} - -int cloudabi_sys_sock_shutdown(struct thread *td, struct cloudabi_sys_sock_shutdown_args *uap) { int how; switch (uap->how) { case CLOUDABI_SHUT_RD: how = SHUT_RD; break; case CLOUDABI_SHUT_WR: how = SHUT_WR; break; case CLOUDABI_SHUT_RD | CLOUDABI_SHUT_WR: how = SHUT_RDWR; break; default: return (EINVAL); } return (kern_shutdown(td, uap->sock, how)); } int cloudabi_sys_sock_stat_get(struct thread *td, struct cloudabi_sys_sock_stat_get_args *uap) { cloudabi_sockstat_t ss = {}; cap_rights_t rights; struct file *fp; struct socket *so; int error; error = getsock_cap(td, uap->sock, cap_rights_init(&rights, CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp, NULL, NULL); if (error != 0) return (error); so = fp->f_data; /* Set ss_error. */ SOCK_LOCK(so); ss.ss_error = cloudabi_convert_errno(so->so_error); if ((uap->flags & CLOUDABI_SOCKSTAT_CLEAR_ERROR) != 0) so->so_error = 0; SOCK_UNLOCK(so); /* Set ss_state. */ if ((so->so_options & SO_ACCEPTCONN) != 0) ss.ss_state |= CLOUDABI_SOCKSTATE_ACCEPTCONN; fdrop(fp, td); return (copyout(&ss, uap->buf, sizeof(ss))); } int cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data, size_t datalen, cloudabi_fd_t *fds, size_t fdslen, cloudabi_riflags_t flags, size_t *rdatalen, size_t *rfdslen, cloudabi_roflags_t *rflags) { - struct sockaddr_storage ss; struct msghdr hdr = { - .msg_name = &ss, - .msg_namelen = sizeof(ss), .msg_iov = data, .msg_iovlen = datalen, }; struct mbuf *control; int error; /* Convert flags. */ if (flags & CLOUDABI_SOCK_RECV_PEEK) hdr.msg_flags |= MSG_PEEK; if (flags & CLOUDABI_SOCK_RECV_WAITALL) hdr.msg_flags |= MSG_WAITALL; control = NULL; error = kern_recvit(td, fd, &hdr, UIO_SYSSPACE, fdslen > 0 ? &control : NULL); if (error != 0) return (error); /* Convert return values. */ *rdatalen = td->td_retval[0]; td->td_retval[0] = 0; *rfdslen = 0; *rflags = 0; if (hdr.msg_flags & MSG_TRUNC) *rflags |= CLOUDABI_SOCK_RECV_DATA_TRUNCATED; /* Extract file descriptors from SCM_RIGHTS messages. */ if (control != NULL) { struct cmsghdr *chdr; hdr.msg_control = mtod(control, void *); hdr.msg_controllen = control->m_len; for (chdr = CMSG_FIRSTHDR(&hdr); chdr != NULL; chdr = CMSG_NXTHDR(&hdr, chdr)) { if (chdr->cmsg_level == SOL_SOCKET && chdr->cmsg_type == SCM_RIGHTS) { size_t nfds; nfds = (chdr->cmsg_len - CMSG_LEN(0)) / sizeof(int); if (nfds > fdslen) { /* Unable to store file descriptors. */ nfds = fdslen; *rflags |= CLOUDABI_SOCK_RECV_FDS_TRUNCATED; } error = copyout(CMSG_DATA(chdr), fds, nfds * sizeof(int)); if (error != 0) { m_free(control); return (error); } fds += nfds; fdslen -= nfds; *rfdslen += nfds; } } m_free(control); } return (0); } int cloudabi_sock_send(struct thread *td, cloudabi_fd_t fd, struct iovec *data, size_t datalen, const cloudabi_fd_t *fds, size_t fdslen, size_t *rdatalen) { struct msghdr hdr = { .msg_iov = data, .msg_iovlen = datalen, }; struct mbuf *control; int error; /* Convert file descriptor array to an SCM_RIGHTS message. */ if (fdslen > MCLBYTES || CMSG_SPACE(fdslen * sizeof(int)) > MCLBYTES) { return (EINVAL); } else if (fdslen > 0) { struct cmsghdr *chdr; control = m_get2(CMSG_SPACE(fdslen * sizeof(int)), M_WAITOK, MT_CONTROL, 0); control->m_len = CMSG_SPACE(fdslen * sizeof(int)); chdr = mtod(control, struct cmsghdr *); chdr->cmsg_len = CMSG_LEN(fdslen * sizeof(int)); chdr->cmsg_level = SOL_SOCKET; chdr->cmsg_type = SCM_RIGHTS; error = copyin(fds, CMSG_DATA(chdr), fdslen * sizeof(int)); if (error != 0) { m_free(control); return (error); } } else { control = NULL; } error = kern_sendit(td, fd, &hdr, MSG_NOSIGNAL, control, UIO_USERSPACE); if (error != 0) return (error); *rdatalen = td->td_retval[0]; td->td_retval[0] = 0; return (0); } Index: head/sys/compat/cloudabi32/cloudabi32_proto.h =================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h (revision 322884) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h (revision 322885) @@ -1,458 +1,436 @@ /* * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #ifndef _CLOUDABI32_SYSPROTO_H_ #define _CLOUDABI32_SYSPROTO_H_ #include #include #include #include #include #include #include #include struct proc; struct thread; #define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ 0 : sizeof(register_t) - sizeof(t)) #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 #define PADR_(t) PAD_(t) #else #define PADL_(t) PAD_(t) #define PADR_(t) 0 #endif struct cloudabi_sys_clock_res_get_args { char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; }; struct cloudabi_sys_clock_time_get_args { char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; char precision_l_[PADL_(cloudabi_timestamp_t)]; cloudabi_timestamp_t precision; char precision_r_[PADR_(cloudabi_timestamp_t)]; }; struct cloudabi_sys_condvar_signal_args { char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)]; }; struct cloudabi_sys_fd_close_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_create1_args { char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_fd_create2_args { char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_fd_datasync_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_dup_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi32_sys_fd_pread_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi32_sys_fd_pwrite_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi32_sys_fd_read_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_fd_replace_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; char to_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t to; char to_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_seek_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filedelta_t)]; cloudabi_filedelta_t offset; char offset_r_[PADR_(cloudabi_filedelta_t)]; char whence_l_[PADL_(cloudabi_whence_t)]; cloudabi_whence_t whence; char whence_r_[PADR_(cloudabi_whence_t)]; }; struct cloudabi_sys_fd_stat_get_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_fdstat_t *)]; cloudabi_fdstat_t * buf; char buf_r_[PADR_(cloudabi_fdstat_t *)]; }; struct cloudabi_sys_fd_stat_put_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * buf; char buf_r_[PADR_(const cloudabi_fdstat_t *)]; char flags_l_[PADL_(cloudabi_fdsflags_t)]; cloudabi_fdsflags_t flags; char flags_r_[PADR_(cloudabi_fdsflags_t)]; }; struct cloudabi_sys_fd_sync_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi32_sys_fd_write_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_advise_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_file_allocate_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_file_create_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_file_link_args { char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_open_args { char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)]; }; struct cloudabi_sys_file_readdir_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)]; }; struct cloudabi_sys_file_readlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_rename_args { char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_stat_fget_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_fput_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_stat_get_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_put_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_symlink_args { char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_unlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; }; struct cloudabi_sys_lock_unlock_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_mem_advise_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_mem_map_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; char flags_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t flags; char flags_r_[PADR_(cloudabi_mflags_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_mem_protect_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; }; struct cloudabi_sys_mem_sync_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; }; struct cloudabi_sys_mem_unmap_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi32_sys_poll_args { char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; struct cloudabi32_sys_poll_fd_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)]; char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)]; char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exit_args { char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)]; }; struct cloudabi_sys_proc_fork_args { register_t dummy; }; struct cloudabi_sys_proc_raise_args { char sig_l_[PADL_(cloudabi_signal_t)]; cloudabi_signal_t sig; char sig_r_[PADR_(cloudabi_signal_t)]; }; struct cloudabi_sys_random_get_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)]; }; -struct cloudabi_sys_sock_bind_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_connect_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_listen_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; -}; struct cloudabi32_sys_sock_recv_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi32_recv_in_t *)]; const cloudabi32_recv_in_t * in; char in_r_[PADR_(const cloudabi32_recv_in_t *)]; char out_l_[PADL_(cloudabi32_recv_out_t *)]; cloudabi32_recv_out_t * out; char out_r_[PADR_(cloudabi32_recv_out_t *)]; }; struct cloudabi32_sys_sock_send_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi32_send_in_t *)]; const cloudabi32_send_in_t * in; char in_r_[PADR_(const cloudabi32_send_in_t *)]; char out_l_[PADL_(cloudabi32_send_out_t *)]; cloudabi32_send_out_t * out; char out_r_[PADR_(cloudabi32_send_out_t *)]; }; struct cloudabi_sys_sock_shutdown_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char how_l_[PADL_(cloudabi_sdflags_t)]; cloudabi_sdflags_t how; char how_r_[PADR_(cloudabi_sdflags_t)]; }; struct cloudabi_sys_sock_stat_get_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; char flags_l_[PADL_(cloudabi_ssflags_t)]; cloudabi_ssflags_t flags; char flags_r_[PADR_(cloudabi_ssflags_t)]; }; struct cloudabi32_sys_thread_create_args { char attr_l_[PADL_(cloudabi32_threadattr_t *)]; cloudabi32_threadattr_t * attr; char attr_r_[PADR_(cloudabi32_threadattr_t *)]; }; struct cloudabi_sys_thread_exit_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_thread_yield_args { register_t dummy; }; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); int cloudabi_sys_fd_close(struct thread *, struct cloudabi_sys_fd_close_args *); int cloudabi_sys_fd_create1(struct thread *, struct cloudabi_sys_fd_create1_args *); int cloudabi_sys_fd_create2(struct thread *, struct cloudabi_sys_fd_create2_args *); int cloudabi_sys_fd_datasync(struct thread *, struct cloudabi_sys_fd_datasync_args *); int cloudabi_sys_fd_dup(struct thread *, struct cloudabi_sys_fd_dup_args *); int cloudabi32_sys_fd_pread(struct thread *, struct cloudabi32_sys_fd_pread_args *); int cloudabi32_sys_fd_pwrite(struct thread *, struct cloudabi32_sys_fd_pwrite_args *); int cloudabi32_sys_fd_read(struct thread *, struct cloudabi32_sys_fd_read_args *); int cloudabi_sys_fd_replace(struct thread *, struct cloudabi_sys_fd_replace_args *); int cloudabi_sys_fd_seek(struct thread *, struct cloudabi_sys_fd_seek_args *); int cloudabi_sys_fd_stat_get(struct thread *, struct cloudabi_sys_fd_stat_get_args *); int cloudabi_sys_fd_stat_put(struct thread *, struct cloudabi_sys_fd_stat_put_args *); int cloudabi_sys_fd_sync(struct thread *, struct cloudabi_sys_fd_sync_args *); int cloudabi32_sys_fd_write(struct thread *, struct cloudabi32_sys_fd_write_args *); int cloudabi_sys_file_advise(struct thread *, struct cloudabi_sys_file_advise_args *); int cloudabi_sys_file_allocate(struct thread *, struct cloudabi_sys_file_allocate_args *); int cloudabi_sys_file_create(struct thread *, struct cloudabi_sys_file_create_args *); int cloudabi_sys_file_link(struct thread *, struct cloudabi_sys_file_link_args *); int cloudabi_sys_file_open(struct thread *, struct cloudabi_sys_file_open_args *); int cloudabi_sys_file_readdir(struct thread *, struct cloudabi_sys_file_readdir_args *); int cloudabi_sys_file_readlink(struct thread *, struct cloudabi_sys_file_readlink_args *); int cloudabi_sys_file_rename(struct thread *, struct cloudabi_sys_file_rename_args *); int cloudabi_sys_file_stat_fget(struct thread *, struct cloudabi_sys_file_stat_fget_args *); int cloudabi_sys_file_stat_fput(struct thread *, struct cloudabi_sys_file_stat_fput_args *); int cloudabi_sys_file_stat_get(struct thread *, struct cloudabi_sys_file_stat_get_args *); int cloudabi_sys_file_stat_put(struct thread *, struct cloudabi_sys_file_stat_put_args *); int cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_args *); int cloudabi_sys_file_unlink(struct thread *, struct cloudabi_sys_file_unlink_args *); int cloudabi_sys_lock_unlock(struct thread *, struct cloudabi_sys_lock_unlock_args *); int cloudabi_sys_mem_advise(struct thread *, struct cloudabi_sys_mem_advise_args *); int cloudabi_sys_mem_map(struct thread *, struct cloudabi_sys_mem_map_args *); int cloudabi_sys_mem_protect(struct thread *, struct cloudabi_sys_mem_protect_args *); int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi32_sys_poll(struct thread *, struct cloudabi32_sys_poll_args *); int cloudabi32_sys_poll_fd(struct thread *, struct cloudabi32_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); int cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *); int cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *); int cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *); -int cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *); -int cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *); -int cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *); int cloudabi32_sys_sock_recv(struct thread *, struct cloudabi32_sys_sock_recv_args *); int cloudabi32_sys_sock_send(struct thread *, struct cloudabi32_sys_sock_send_args *); int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *); int cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *); int cloudabi32_sys_thread_create(struct thread *, struct cloudabi32_sys_thread_create_args *); int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); #ifdef COMPAT_43 #endif /* COMPAT_43 */ #ifdef COMPAT_FREEBSD4 #endif /* COMPAT_FREEBSD4 */ #ifdef COMPAT_FREEBSD6 #endif /* COMPAT_FREEBSD6 */ #ifdef COMPAT_FREEBSD7 #endif /* COMPAT_FREEBSD7 */ #ifdef COMPAT_FREEBSD10 #endif /* COMPAT_FREEBSD10 */ #ifdef COMPAT_FREEBSD11 #endif /* COMPAT_FREEBSD11 */ #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_close AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create1 AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create2 AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_datasync AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_dup AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pread AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pwrite AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_read AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_replace AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_seek AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_put AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_sync AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_write AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_advise AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_allocate AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_create AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_link AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_open AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_readdir AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_readlink AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_rename AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fget AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fput AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_put AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_symlink AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_file_unlink AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_lock_unlock AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_advise AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_map AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_protect AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll_fd AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_raise AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_random_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_accept AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_bind AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_connect AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_listen AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_recv AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_send AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_shutdown AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_stat_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_thread_create AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL #undef PAD_ #undef PADL_ #undef PADR_ #endif /* !_CLOUDABI32_SYSPROTO_H_ */ Index: head/sys/compat/cloudabi32/cloudabi32_syscall.h =================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h (revision 322884) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h (revision 322885) @@ -1,63 +1,60 @@ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #define CLOUDABI32_SYS_cloudabi_sys_clock_res_get 0 #define CLOUDABI32_SYS_cloudabi_sys_clock_time_get 1 #define CLOUDABI32_SYS_cloudabi_sys_condvar_signal 2 #define CLOUDABI32_SYS_cloudabi_sys_fd_close 3 #define CLOUDABI32_SYS_cloudabi_sys_fd_create1 4 #define CLOUDABI32_SYS_cloudabi_sys_fd_create2 5 #define CLOUDABI32_SYS_cloudabi_sys_fd_datasync 6 #define CLOUDABI32_SYS_cloudabi_sys_fd_dup 7 #define CLOUDABI32_SYS_cloudabi32_sys_fd_pread 8 #define CLOUDABI32_SYS_cloudabi32_sys_fd_pwrite 9 #define CLOUDABI32_SYS_cloudabi32_sys_fd_read 10 #define CLOUDABI32_SYS_cloudabi_sys_fd_replace 11 #define CLOUDABI32_SYS_cloudabi_sys_fd_seek 12 #define CLOUDABI32_SYS_cloudabi_sys_fd_stat_get 13 #define CLOUDABI32_SYS_cloudabi_sys_fd_stat_put 14 #define CLOUDABI32_SYS_cloudabi_sys_fd_sync 15 #define CLOUDABI32_SYS_cloudabi32_sys_fd_write 16 #define CLOUDABI32_SYS_cloudabi_sys_file_advise 17 #define CLOUDABI32_SYS_cloudabi_sys_file_allocate 18 #define CLOUDABI32_SYS_cloudabi_sys_file_create 19 #define CLOUDABI32_SYS_cloudabi_sys_file_link 20 #define CLOUDABI32_SYS_cloudabi_sys_file_open 21 #define CLOUDABI32_SYS_cloudabi_sys_file_readdir 22 #define CLOUDABI32_SYS_cloudabi_sys_file_readlink 23 #define CLOUDABI32_SYS_cloudabi_sys_file_rename 24 #define CLOUDABI32_SYS_cloudabi_sys_file_stat_fget 25 #define CLOUDABI32_SYS_cloudabi_sys_file_stat_fput 26 #define CLOUDABI32_SYS_cloudabi_sys_file_stat_get 27 #define CLOUDABI32_SYS_cloudabi_sys_file_stat_put 28 #define CLOUDABI32_SYS_cloudabi_sys_file_symlink 29 #define CLOUDABI32_SYS_cloudabi_sys_file_unlink 30 #define CLOUDABI32_SYS_cloudabi_sys_lock_unlock 31 #define CLOUDABI32_SYS_cloudabi_sys_mem_advise 32 #define CLOUDABI32_SYS_cloudabi_sys_mem_map 33 #define CLOUDABI32_SYS_cloudabi_sys_mem_protect 34 #define CLOUDABI32_SYS_cloudabi_sys_mem_sync 35 #define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 36 #define CLOUDABI32_SYS_cloudabi32_sys_poll 37 #define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 38 #define CLOUDABI32_SYS_cloudabi_sys_proc_exec 39 #define CLOUDABI32_SYS_cloudabi_sys_proc_exit 40 #define CLOUDABI32_SYS_cloudabi_sys_proc_fork 41 #define CLOUDABI32_SYS_cloudabi_sys_proc_raise 42 #define CLOUDABI32_SYS_cloudabi_sys_random_get 43 #define CLOUDABI32_SYS_cloudabi_sys_sock_accept 44 -#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 45 -#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 46 -#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 47 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 48 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 49 -#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 50 -#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 51 -#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 52 -#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 53 -#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 54 -#define CLOUDABI32_SYS_MAXSYSCALL 55 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 45 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 46 +#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 47 +#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 48 +#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 49 +#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 50 +#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 51 +#define CLOUDABI32_SYS_MAXSYSCALL 52 Index: head/sys/compat/cloudabi32/cloudabi32_syscalls.c =================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c (revision 322884) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c (revision 322885) @@ -1,64 +1,61 @@ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ const char *cloudabi32_syscallnames[] = { "cloudabi_sys_clock_res_get", /* 0 = cloudabi_sys_clock_res_get */ "cloudabi_sys_clock_time_get", /* 1 = cloudabi_sys_clock_time_get */ "cloudabi_sys_condvar_signal", /* 2 = cloudabi_sys_condvar_signal */ "cloudabi_sys_fd_close", /* 3 = cloudabi_sys_fd_close */ "cloudabi_sys_fd_create1", /* 4 = cloudabi_sys_fd_create1 */ "cloudabi_sys_fd_create2", /* 5 = cloudabi_sys_fd_create2 */ "cloudabi_sys_fd_datasync", /* 6 = cloudabi_sys_fd_datasync */ "cloudabi_sys_fd_dup", /* 7 = cloudabi_sys_fd_dup */ "cloudabi32_sys_fd_pread", /* 8 = cloudabi32_sys_fd_pread */ "cloudabi32_sys_fd_pwrite", /* 9 = cloudabi32_sys_fd_pwrite */ "cloudabi32_sys_fd_read", /* 10 = cloudabi32_sys_fd_read */ "cloudabi_sys_fd_replace", /* 11 = cloudabi_sys_fd_replace */ "cloudabi_sys_fd_seek", /* 12 = cloudabi_sys_fd_seek */ "cloudabi_sys_fd_stat_get", /* 13 = cloudabi_sys_fd_stat_get */ "cloudabi_sys_fd_stat_put", /* 14 = cloudabi_sys_fd_stat_put */ "cloudabi_sys_fd_sync", /* 15 = cloudabi_sys_fd_sync */ "cloudabi32_sys_fd_write", /* 16 = cloudabi32_sys_fd_write */ "cloudabi_sys_file_advise", /* 17 = cloudabi_sys_file_advise */ "cloudabi_sys_file_allocate", /* 18 = cloudabi_sys_file_allocate */ "cloudabi_sys_file_create", /* 19 = cloudabi_sys_file_create */ "cloudabi_sys_file_link", /* 20 = cloudabi_sys_file_link */ "cloudabi_sys_file_open", /* 21 = cloudabi_sys_file_open */ "cloudabi_sys_file_readdir", /* 22 = cloudabi_sys_file_readdir */ "cloudabi_sys_file_readlink", /* 23 = cloudabi_sys_file_readlink */ "cloudabi_sys_file_rename", /* 24 = cloudabi_sys_file_rename */ "cloudabi_sys_file_stat_fget", /* 25 = cloudabi_sys_file_stat_fget */ "cloudabi_sys_file_stat_fput", /* 26 = cloudabi_sys_file_stat_fput */ "cloudabi_sys_file_stat_get", /* 27 = cloudabi_sys_file_stat_get */ "cloudabi_sys_file_stat_put", /* 28 = cloudabi_sys_file_stat_put */ "cloudabi_sys_file_symlink", /* 29 = cloudabi_sys_file_symlink */ "cloudabi_sys_file_unlink", /* 30 = cloudabi_sys_file_unlink */ "cloudabi_sys_lock_unlock", /* 31 = cloudabi_sys_lock_unlock */ "cloudabi_sys_mem_advise", /* 32 = cloudabi_sys_mem_advise */ "cloudabi_sys_mem_map", /* 33 = cloudabi_sys_mem_map */ "cloudabi_sys_mem_protect", /* 34 = cloudabi_sys_mem_protect */ "cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */ "cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */ "cloudabi32_sys_poll", /* 37 = cloudabi32_sys_poll */ "cloudabi32_sys_poll_fd", /* 38 = cloudabi32_sys_poll_fd */ "cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */ "cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */ "cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */ "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ "cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */ - "cloudabi32_sys_sock_recv", /* 48 = cloudabi32_sys_sock_recv */ - "cloudabi32_sys_sock_send", /* 49 = cloudabi32_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */ - "cloudabi32_sys_thread_create", /* 52 = cloudabi32_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */ + "cloudabi32_sys_sock_recv", /* 45 = cloudabi32_sys_sock_recv */ + "cloudabi32_sys_sock_send", /* 46 = cloudabi32_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 47 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 48 = cloudabi_sys_sock_stat_get */ + "cloudabi32_sys_thread_create", /* 49 = cloudabi32_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 50 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 51 = cloudabi_sys_thread_yield */ }; Index: head/sys/compat/cloudabi32/cloudabi32_sysent.c =================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c (revision 322884) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c (revision 322885) @@ -1,72 +1,69 @@ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #include #include #include #include #define AS(name) (sizeof(struct name) / sizeof(register_t)) /* The casts are bogus but will do for now. */ struct sysent cloudabi32_sysent[] = { { AS(cloudabi_sys_clock_res_get_args), (sy_call_t *)cloudabi_sys_clock_res_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 0 = cloudabi_sys_clock_res_get */ { AS(cloudabi_sys_clock_time_get_args), (sy_call_t *)cloudabi_sys_clock_time_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 1 = cloudabi_sys_clock_time_get */ { AS(cloudabi_sys_condvar_signal_args), (sy_call_t *)cloudabi_sys_condvar_signal, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = cloudabi_sys_condvar_signal */ { AS(cloudabi_sys_fd_close_args), (sy_call_t *)cloudabi_sys_fd_close, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = cloudabi_sys_fd_close */ { AS(cloudabi_sys_fd_create1_args), (sy_call_t *)cloudabi_sys_fd_create1, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = cloudabi_sys_fd_create1 */ { AS(cloudabi_sys_fd_create2_args), (sy_call_t *)cloudabi_sys_fd_create2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = cloudabi_sys_fd_create2 */ { AS(cloudabi_sys_fd_datasync_args), (sy_call_t *)cloudabi_sys_fd_datasync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = cloudabi_sys_fd_datasync */ { AS(cloudabi_sys_fd_dup_args), (sy_call_t *)cloudabi_sys_fd_dup, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 7 = cloudabi_sys_fd_dup */ { AS(cloudabi32_sys_fd_pread_args), (sy_call_t *)cloudabi32_sys_fd_pread, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 8 = cloudabi32_sys_fd_pread */ { AS(cloudabi32_sys_fd_pwrite_args), (sy_call_t *)cloudabi32_sys_fd_pwrite, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 9 = cloudabi32_sys_fd_pwrite */ { AS(cloudabi32_sys_fd_read_args), (sy_call_t *)cloudabi32_sys_fd_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 10 = cloudabi32_sys_fd_read */ { AS(cloudabi_sys_fd_replace_args), (sy_call_t *)cloudabi_sys_fd_replace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 11 = cloudabi_sys_fd_replace */ { AS(cloudabi_sys_fd_seek_args), (sy_call_t *)cloudabi_sys_fd_seek, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 12 = cloudabi_sys_fd_seek */ { AS(cloudabi_sys_fd_stat_get_args), (sy_call_t *)cloudabi_sys_fd_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 13 = cloudabi_sys_fd_stat_get */ { AS(cloudabi_sys_fd_stat_put_args), (sy_call_t *)cloudabi_sys_fd_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 14 = cloudabi_sys_fd_stat_put */ { AS(cloudabi_sys_fd_sync_args), (sy_call_t *)cloudabi_sys_fd_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 15 = cloudabi_sys_fd_sync */ { AS(cloudabi32_sys_fd_write_args), (sy_call_t *)cloudabi32_sys_fd_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 16 = cloudabi32_sys_fd_write */ { AS(cloudabi_sys_file_advise_args), (sy_call_t *)cloudabi_sys_file_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = cloudabi_sys_file_advise */ { AS(cloudabi_sys_file_allocate_args), (sy_call_t *)cloudabi_sys_file_allocate, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 18 = cloudabi_sys_file_allocate */ { AS(cloudabi_sys_file_create_args), (sy_call_t *)cloudabi_sys_file_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = cloudabi_sys_file_create */ { AS(cloudabi_sys_file_link_args), (sy_call_t *)cloudabi_sys_file_link, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = cloudabi_sys_file_link */ { AS(cloudabi_sys_file_open_args), (sy_call_t *)cloudabi_sys_file_open, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 21 = cloudabi_sys_file_open */ { AS(cloudabi_sys_file_readdir_args), (sy_call_t *)cloudabi_sys_file_readdir, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 22 = cloudabi_sys_file_readdir */ { AS(cloudabi_sys_file_readlink_args), (sy_call_t *)cloudabi_sys_file_readlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 23 = cloudabi_sys_file_readlink */ { AS(cloudabi_sys_file_rename_args), (sy_call_t *)cloudabi_sys_file_rename, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 24 = cloudabi_sys_file_rename */ { AS(cloudabi_sys_file_stat_fget_args), (sy_call_t *)cloudabi_sys_file_stat_fget, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 25 = cloudabi_sys_file_stat_fget */ { AS(cloudabi_sys_file_stat_fput_args), (sy_call_t *)cloudabi_sys_file_stat_fput, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 26 = cloudabi_sys_file_stat_fput */ { AS(cloudabi_sys_file_stat_get_args), (sy_call_t *)cloudabi_sys_file_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 27 = cloudabi_sys_file_stat_get */ { AS(cloudabi_sys_file_stat_put_args), (sy_call_t *)cloudabi_sys_file_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 28 = cloudabi_sys_file_stat_put */ { AS(cloudabi_sys_file_symlink_args), (sy_call_t *)cloudabi_sys_file_symlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 29 = cloudabi_sys_file_symlink */ { AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */ { AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */ { AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */ { AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_map */ { AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_protect */ { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */ { AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi32_sys_poll */ { AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi32_sys_poll_fd */ { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */ { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */ { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */ { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */ - { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi32_sys_sock_recv */ - { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi32_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */ + { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi32_sys_sock_recv */ + { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi32_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_thread_yield */ }; Index: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c =================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c (revision 322884) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c (revision 322885) @@ -1,1650 +1,1556 @@ /* * System call argument to DTrace register array converstion. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ static void systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) { int64_t *iarg = (int64_t *) uarg; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: { struct cloudabi_sys_clock_res_get_args *p = params; iarg[0] = p->clock_id; /* cloudabi_clockid_t */ *n_args = 1; break; } /* cloudabi_sys_clock_time_get */ case 1: { struct cloudabi_sys_clock_time_get_args *p = params; iarg[0] = p->clock_id; /* cloudabi_clockid_t */ iarg[1] = p->precision; /* cloudabi_timestamp_t */ *n_args = 2; break; } /* cloudabi_sys_condvar_signal */ case 2: { struct cloudabi_sys_condvar_signal_args *p = params; uarg[0] = (intptr_t) p->condvar; /* cloudabi_condvar_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */ *n_args = 3; break; } /* cloudabi_sys_fd_close */ case 3: { struct cloudabi_sys_fd_close_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi_sys_fd_create1 */ case 4: { struct cloudabi_sys_fd_create1_args *p = params; iarg[0] = p->type; /* cloudabi_filetype_t */ *n_args = 1; break; } /* cloudabi_sys_fd_create2 */ case 5: { struct cloudabi_sys_fd_create2_args *p = params; iarg[0] = p->type; /* cloudabi_filetype_t */ *n_args = 1; break; } /* cloudabi_sys_fd_datasync */ case 6: { struct cloudabi_sys_fd_datasync_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi_sys_fd_dup */ case 7: { struct cloudabi_sys_fd_dup_args *p = params; iarg[0] = p->from; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi32_sys_fd_pread */ case 8: { struct cloudabi32_sys_fd_pread_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */ uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; } /* cloudabi32_sys_fd_pwrite */ case 9: { struct cloudabi32_sys_fd_pwrite_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */ uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; } /* cloudabi32_sys_fd_read */ case 10: { struct cloudabi32_sys_fd_read_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */ uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } /* cloudabi_sys_fd_replace */ case 11: { struct cloudabi_sys_fd_replace_args *p = params; iarg[0] = p->from; /* cloudabi_fd_t */ iarg[1] = p->to; /* cloudabi_fd_t */ *n_args = 2; break; } /* cloudabi_sys_fd_seek */ case 12: { struct cloudabi_sys_fd_seek_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filedelta_t */ iarg[2] = p->whence; /* cloudabi_whence_t */ *n_args = 3; break; } /* cloudabi_sys_fd_stat_get */ case 13: { struct cloudabi_sys_fd_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_fdstat_t * */ *n_args = 2; break; } /* cloudabi_sys_fd_stat_put */ case 14: { struct cloudabi_sys_fd_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* const cloudabi_fdstat_t * */ iarg[2] = p->flags; /* cloudabi_fdsflags_t */ *n_args = 3; break; } /* cloudabi_sys_fd_sync */ case 15: { struct cloudabi_sys_fd_sync_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi32_sys_fd_write */ case 16: { struct cloudabi32_sys_fd_write_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */ uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } /* cloudabi_sys_file_advise */ case 17: { struct cloudabi_sys_file_advise_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filesize_t */ iarg[2] = p->len; /* cloudabi_filesize_t */ iarg[3] = p->advice; /* cloudabi_advice_t */ *n_args = 4; break; } /* cloudabi_sys_file_allocate */ case 18: { struct cloudabi_sys_file_allocate_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filesize_t */ iarg[2] = p->len; /* cloudabi_filesize_t */ *n_args = 3; break; } /* cloudabi_sys_file_create */ case 19: { struct cloudabi_sys_file_create_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->type; /* cloudabi_filetype_t */ *n_args = 4; break; } /* cloudabi_sys_file_link */ case 20: { struct cloudabi_sys_file_link_args *p = params; iarg[0] = p->fd1; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } /* cloudabi_sys_file_open */ case 21: { struct cloudabi_sys_file_open_args *p = params; iarg[0] = p->dirfd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->oflags; /* cloudabi_oflags_t */ uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */ *n_args = 5; break; } /* cloudabi_sys_file_readdir */ case 22: { struct cloudabi_sys_file_readdir_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->buf_len; /* size_t */ iarg[3] = p->cookie; /* cloudabi_dircookie_t */ *n_args = 4; break; } /* cloudabi_sys_file_readlink */ case 23: { struct cloudabi_sys_file_readlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* char * */ uarg[4] = p->buf_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_rename */ case 24: { struct cloudabi_sys_file_rename_args *p = params; iarg[0] = p->fd1; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } /* cloudabi_sys_file_stat_fget */ case 25: { struct cloudabi_sys_file_stat_fget_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 2; break; } /* cloudabi_sys_file_stat_fput */ case 26: { struct cloudabi_sys_file_stat_fput_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[2] = p->flags; /* cloudabi_fsflags_t */ *n_args = 3; break; } /* cloudabi_sys_file_stat_get */ case 27: { struct cloudabi_sys_file_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 4; break; } /* cloudabi_sys_file_stat_put */ case 28: { struct cloudabi_sys_file_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[4] = p->flags; /* cloudabi_fsflags_t */ *n_args = 5; break; } /* cloudabi_sys_file_symlink */ case 29: { struct cloudabi_sys_file_symlink_args *p = params; uarg[0] = (intptr_t) p->path1; /* const char * */ uarg[1] = p->path1_len; /* size_t */ iarg[2] = p->fd; /* cloudabi_fd_t */ uarg[3] = (intptr_t) p->path2; /* const char * */ uarg[4] = p->path2_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_unlink */ case 30: { struct cloudabi_sys_file_unlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->flags; /* cloudabi_ulflags_t */ *n_args = 4; break; } /* cloudabi_sys_lock_unlock */ case 31: { struct cloudabi_sys_lock_unlock_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } /* cloudabi_sys_mem_advise */ case 32: { struct cloudabi_sys_mem_advise_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->advice; /* cloudabi_advice_t */ *n_args = 3; break; } /* cloudabi_sys_mem_map */ case 33: { struct cloudabi_sys_mem_map_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ iarg[3] = p->flags; /* cloudabi_mflags_t */ iarg[4] = p->fd; /* cloudabi_fd_t */ iarg[5] = p->off; /* cloudabi_filesize_t */ *n_args = 6; break; } /* cloudabi_sys_mem_protect */ case 34: { struct cloudabi_sys_mem_protect_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ *n_args = 3; break; } /* cloudabi_sys_mem_sync */ case 35: { struct cloudabi_sys_mem_sync_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->flags; /* cloudabi_msflags_t */ *n_args = 3; break; } /* cloudabi_sys_mem_unmap */ case 36: { struct cloudabi_sys_mem_unmap_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } /* cloudabi32_sys_poll */ case 37: { struct cloudabi32_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ uarg[1] = (intptr_t) p->out; /* cloudabi32_event_t * */ uarg[2] = p->nsubscriptions; /* size_t */ *n_args = 3; break; } /* cloudabi32_sys_poll_fd */ case 38: { struct cloudabi32_sys_poll_fd_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ uarg[2] = p->in_len; /* size_t */ uarg[3] = (intptr_t) p->out; /* cloudabi32_event_t * */ uarg[4] = p->out_len; /* size_t */ uarg[5] = (intptr_t) p->timeout; /* const cloudabi32_subscription_t * */ *n_args = 6; break; } /* cloudabi_sys_proc_exec */ case 39: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ uarg[2] = p->data_len; /* size_t */ uarg[3] = (intptr_t) p->fds; /* const cloudabi_fd_t * */ uarg[4] = p->fds_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_proc_exit */ case 40: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ case 41: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ case 42: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ case 43: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->buf_len; /* size_t */ *n_args = 2; break; } /* cloudabi_sys_sock_accept */ case 44: { struct cloudabi_sys_sock_accept_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->unused; /* void * */ *n_args = 2; break; } - /* cloudabi_sys_sock_bind */ - case 45: { - struct cloudabi_sys_sock_bind_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_connect */ - case 46: { - struct cloudabi_sys_sock_connect_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_listen */ - case 47: { - struct cloudabi_sys_sock_listen_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->backlog; /* cloudabi_backlog_t */ - *n_args = 2; - break; - } /* cloudabi32_sys_sock_recv */ - case 48: { + case 45: { struct cloudabi32_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_recv_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi32_recv_out_t * */ *n_args = 3; break; } /* cloudabi32_sys_sock_send */ - case 49: { + case 46: { struct cloudabi32_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_send_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi32_send_out_t * */ *n_args = 3; break; } /* cloudabi_sys_sock_shutdown */ - case 50: { + case 47: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ *n_args = 2; break; } /* cloudabi_sys_sock_stat_get */ - case 51: { + case 48: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ iarg[2] = p->flags; /* cloudabi_ssflags_t */ *n_args = 3; break; } /* cloudabi32_sys_thread_create */ - case 52: { + case 49: { struct cloudabi32_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi32_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 53: { + case 50: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } /* cloudabi_sys_thread_yield */ - case 54: { + case 51: { *n_args = 0; break; } default: *n_args = 0; break; }; } static void systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) { const char *p = NULL; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: switch(ndx) { case 0: p = "cloudabi_clockid_t"; break; default: break; }; break; /* cloudabi_sys_clock_time_get */ case 1: switch(ndx) { case 0: p = "cloudabi_clockid_t"; break; case 1: p = "cloudabi_timestamp_t"; break; default: break; }; break; /* cloudabi_sys_condvar_signal */ case 2: switch(ndx) { case 0: p = "userland cloudabi_condvar_t *"; break; case 1: p = "cloudabi_scope_t"; break; case 2: p = "cloudabi_nthreads_t"; break; default: break; }; break; /* cloudabi_sys_fd_close */ case 3: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_create1 */ case 4: switch(ndx) { case 0: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_fd_create2 */ case 5: switch(ndx) { case 0: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_fd_datasync */ case 6: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_dup */ case 7: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi32_sys_fd_pread */ case 8: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_iovec_t *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi32_sys_fd_pwrite */ case 9: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_ciovec_t *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi32_sys_fd_read */ case 10: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_iovec_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_fd_replace */ case 11: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_seek */ case 12: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filedelta_t"; break; case 2: p = "cloudabi_whence_t"; break; default: break; }; break; /* cloudabi_sys_fd_stat_get */ case 13: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_fdstat_t *"; break; default: break; }; break; /* cloudabi_sys_fd_stat_put */ case 14: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi_fdstat_t *"; break; case 2: p = "cloudabi_fdsflags_t"; break; default: break; }; break; /* cloudabi_sys_fd_sync */ case 15: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi32_sys_fd_write */ case 16: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_ciovec_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_advise */ case 17: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filesize_t"; break; case 2: p = "cloudabi_filesize_t"; break; case 3: p = "cloudabi_advice_t"; break; default: break; }; break; /* cloudabi_sys_file_allocate */ case 18: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filesize_t"; break; case 2: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi_sys_file_create */ case 19: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_file_link */ case 20: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_fd_t"; break; case 4: p = "userland const char *"; break; case 5: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_open */ case 21: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_oflags_t"; break; case 4: p = "userland const cloudabi_fdstat_t *"; break; default: break; }; break; /* cloudabi_sys_file_readdir */ case 22: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland void *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_dircookie_t"; break; default: break; }; break; /* cloudabi_sys_file_readlink */ case 23: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland char *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_rename */ case 24: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_fd_t"; break; case 4: p = "userland const char *"; break; case 5: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_stat_fget */ case 25: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_filestat_t *"; break; default: break; }; break; /* cloudabi_sys_file_stat_fput */ case 26: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi_filestat_t *"; break; case 2: p = "cloudabi_fsflags_t"; break; default: break; }; break; /* cloudabi_sys_file_stat_get */ case 27: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland cloudabi_filestat_t *"; break; default: break; }; break; /* cloudabi_sys_file_stat_put */ case 28: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland const cloudabi_filestat_t *"; break; case 4: p = "cloudabi_fsflags_t"; break; default: break; }; break; /* cloudabi_sys_file_symlink */ case 29: switch(ndx) { case 0: p = "userland const char *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_fd_t"; break; case 3: p = "userland const char *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_unlink */ case 30: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_ulflags_t"; break; default: break; }; break; /* cloudabi_sys_lock_unlock */ case 31: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; break; case 1: p = "cloudabi_scope_t"; break; default: break; }; break; /* cloudabi_sys_mem_advise */ case 32: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_advice_t"; break; default: break; }; break; /* cloudabi_sys_mem_map */ case 33: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_mprot_t"; break; case 3: p = "cloudabi_mflags_t"; break; case 4: p = "cloudabi_fd_t"; break; case 5: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi_sys_mem_protect */ case 34: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_mprot_t"; break; default: break; }; break; /* cloudabi_sys_mem_sync */ case 35: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_msflags_t"; break; default: break; }; break; /* cloudabi_sys_mem_unmap */ case 36: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; default: break; }; break; /* cloudabi32_sys_poll */ case 37: switch(ndx) { case 0: p = "userland const cloudabi32_subscription_t *"; break; case 1: p = "userland cloudabi32_event_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi32_sys_poll_fd */ case 38: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_subscription_t *"; break; case 2: p = "size_t"; break; case 3: p = "userland cloudabi32_event_t *"; break; case 4: p = "size_t"; break; case 5: p = "userland const cloudabi32_subscription_t *"; break; default: break; }; break; /* cloudabi_sys_proc_exec */ case 39: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const void *"; break; case 2: p = "size_t"; break; case 3: p = "userland const cloudabi_fd_t *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_proc_exit */ case 40: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; break; default: break; }; break; /* cloudabi_sys_proc_fork */ case 41: break; /* cloudabi_sys_proc_raise */ case 42: switch(ndx) { case 0: p = "cloudabi_signal_t"; break; default: break; }; break; /* cloudabi_sys_random_get */ case 43: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_sock_accept */ case 44: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland void *"; break; default: break; }; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi32_sys_sock_recv */ case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_connect */ - case 46: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_listen */ - case 47: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_backlog_t"; - break; - default: - break; - }; - break; - /* cloudabi32_sys_sock_recv */ - case 48: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const cloudabi32_recv_in_t *"; break; case 2: p = "userland cloudabi32_recv_out_t *"; break; default: break; }; break; /* cloudabi32_sys_sock_send */ - case 49: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi32_send_in_t *"; break; case 2: p = "userland cloudabi32_send_out_t *"; break; default: break; }; break; /* cloudabi_sys_sock_shutdown */ - case 50: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_sdflags_t"; break; default: break; }; break; /* cloudabi_sys_sock_stat_get */ - case 51: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_sockstat_t *"; break; case 2: p = "cloudabi_ssflags_t"; break; default: break; }; break; /* cloudabi32_sys_thread_create */ - case 52: + case 49: switch(ndx) { case 0: p = "userland cloudabi32_threadattr_t *"; break; default: break; }; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; break; case 1: p = "cloudabi_scope_t"; break; default: break; }; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: break; default: break; }; if (p != NULL) strlcpy(desc, p, descsz); } static void systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) { const char *p = NULL; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: if (ndx == 0 || ndx == 1) p = "cloudabi_timestamp_t"; break; /* cloudabi_sys_clock_time_get */ case 1: if (ndx == 0 || ndx == 1) p = "cloudabi_timestamp_t"; break; /* cloudabi_sys_condvar_signal */ case 2: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_close */ case 3: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_create1 */ case 4: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_fd_create2 */ case 5: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_datasync */ case 6: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_dup */ case 7: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi32_sys_fd_pread */ case 8: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi32_sys_fd_pwrite */ case 9: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi32_sys_fd_read */ case 10: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_fd_replace */ case 11: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_seek */ case 12: if (ndx == 0 || ndx == 1) p = "cloudabi_filesize_t"; break; /* cloudabi_sys_fd_stat_get */ case 13: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_stat_put */ case 14: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_sync */ case 15: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi32_sys_fd_write */ case 16: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_advise */ case 17: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_allocate */ case 18: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_create */ case 19: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_link */ case 20: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_open */ case 21: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_file_readdir */ case 22: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_readlink */ case 23: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_rename */ case 24: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_fget */ case 25: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_fput */ case 26: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_get */ case 27: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_put */ case 28: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_symlink */ case 29: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_unlink */ case 30: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_lock_unlock */ case 31: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_advise */ case 32: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_map */ case 33: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_protect */ case 34: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_sync */ case 35: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_unmap */ case 36: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi32_sys_poll */ case 37: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi32_sys_poll_fd */ case 38: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_proc_exec */ case 39: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_exit */ case 40: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_fork */ case 41: /* cloudabi_sys_proc_raise */ case 42: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_random_get */ case 43: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_accept */ case 44: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi32_sys_sock_recv */ case 45: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_connect */ + /* cloudabi32_sys_sock_send */ case 46: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_listen */ + /* cloudabi_sys_sock_shutdown */ case 47: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi32_sys_sock_recv */ + /* cloudabi_sys_sock_stat_get */ case 48: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi32_sys_sock_send */ + /* cloudabi32_sys_thread_create */ case 49: if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_shutdown */ - case 50: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_stat_get */ - case 51: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi32_sys_thread_create */ - case 52: - if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: default: break; }; if (p != NULL) strlcpy(desc, p, descsz); } Index: head/sys/compat/cloudabi64/cloudabi64_proto.h =================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h (revision 322884) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h (revision 322885) @@ -1,458 +1,436 @@ /* * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #ifndef _CLOUDABI64_SYSPROTO_H_ #define _CLOUDABI64_SYSPROTO_H_ #include #include #include #include #include #include #include #include struct proc; struct thread; #define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ 0 : sizeof(register_t) - sizeof(t)) #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 #define PADR_(t) PAD_(t) #else #define PADL_(t) PAD_(t) #define PADR_(t) 0 #endif struct cloudabi_sys_clock_res_get_args { char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; }; struct cloudabi_sys_clock_time_get_args { char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; char precision_l_[PADL_(cloudabi_timestamp_t)]; cloudabi_timestamp_t precision; char precision_r_[PADR_(cloudabi_timestamp_t)]; }; struct cloudabi_sys_condvar_signal_args { char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)]; }; struct cloudabi_sys_fd_close_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_create1_args { char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_fd_create2_args { char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_fd_datasync_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_dup_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi64_sys_fd_pread_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_pwrite_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_read_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_fd_replace_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; char to_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t to; char to_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi_sys_fd_seek_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filedelta_t)]; cloudabi_filedelta_t offset; char offset_r_[PADR_(cloudabi_filedelta_t)]; char whence_l_[PADL_(cloudabi_whence_t)]; cloudabi_whence_t whence; char whence_r_[PADR_(cloudabi_whence_t)]; }; struct cloudabi_sys_fd_stat_get_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_fdstat_t *)]; cloudabi_fdstat_t * buf; char buf_r_[PADR_(cloudabi_fdstat_t *)]; }; struct cloudabi_sys_fd_stat_put_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * buf; char buf_r_[PADR_(const cloudabi_fdstat_t *)]; char flags_l_[PADL_(cloudabi_fdsflags_t)]; cloudabi_fdsflags_t flags; char flags_r_[PADR_(cloudabi_fdsflags_t)]; }; struct cloudabi_sys_fd_sync_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; }; struct cloudabi64_sys_fd_write_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)]; char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_advise_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_file_allocate_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_file_create_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_file_link_args { char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_open_args { char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)]; }; struct cloudabi_sys_file_readdir_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)]; }; struct cloudabi_sys_file_readlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_rename_args { char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_stat_fget_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_fput_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_stat_get_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_put_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_symlink_args { char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_unlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; }; struct cloudabi_sys_lock_unlock_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_mem_advise_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_mem_map_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; char flags_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t flags; char flags_r_[PADR_(cloudabi_mflags_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_mem_protect_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; }; struct cloudabi_sys_mem_sync_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; }; struct cloudabi_sys_mem_unmap_args { char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi64_sys_poll_args { char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; struct cloudabi64_sys_poll_fd_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)]; char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)]; char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exit_args { char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)]; }; struct cloudabi_sys_proc_fork_args { register_t dummy; }; struct cloudabi_sys_proc_raise_args { char sig_l_[PADL_(cloudabi_signal_t)]; cloudabi_signal_t sig; char sig_r_[PADR_(cloudabi_signal_t)]; }; struct cloudabi_sys_random_get_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)]; }; -struct cloudabi_sys_sock_bind_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_connect_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_listen_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; -}; struct cloudabi64_sys_sock_recv_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_recv_in_t *)]; const cloudabi64_recv_in_t * in; char in_r_[PADR_(const cloudabi64_recv_in_t *)]; char out_l_[PADL_(cloudabi64_recv_out_t *)]; cloudabi64_recv_out_t * out; char out_r_[PADR_(cloudabi64_recv_out_t *)]; }; struct cloudabi64_sys_sock_send_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_send_in_t *)]; const cloudabi64_send_in_t * in; char in_r_[PADR_(const cloudabi64_send_in_t *)]; char out_l_[PADL_(cloudabi64_send_out_t *)]; cloudabi64_send_out_t * out; char out_r_[PADR_(cloudabi64_send_out_t *)]; }; struct cloudabi_sys_sock_shutdown_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char how_l_[PADL_(cloudabi_sdflags_t)]; cloudabi_sdflags_t how; char how_r_[PADR_(cloudabi_sdflags_t)]; }; struct cloudabi_sys_sock_stat_get_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; char flags_l_[PADL_(cloudabi_ssflags_t)]; cloudabi_ssflags_t flags; char flags_r_[PADR_(cloudabi_ssflags_t)]; }; struct cloudabi64_sys_thread_create_args { char attr_l_[PADL_(cloudabi64_threadattr_t *)]; cloudabi64_threadattr_t * attr; char attr_r_[PADR_(cloudabi64_threadattr_t *)]; }; struct cloudabi_sys_thread_exit_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_thread_yield_args { register_t dummy; }; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); int cloudabi_sys_fd_close(struct thread *, struct cloudabi_sys_fd_close_args *); int cloudabi_sys_fd_create1(struct thread *, struct cloudabi_sys_fd_create1_args *); int cloudabi_sys_fd_create2(struct thread *, struct cloudabi_sys_fd_create2_args *); int cloudabi_sys_fd_datasync(struct thread *, struct cloudabi_sys_fd_datasync_args *); int cloudabi_sys_fd_dup(struct thread *, struct cloudabi_sys_fd_dup_args *); int cloudabi64_sys_fd_pread(struct thread *, struct cloudabi64_sys_fd_pread_args *); int cloudabi64_sys_fd_pwrite(struct thread *, struct cloudabi64_sys_fd_pwrite_args *); int cloudabi64_sys_fd_read(struct thread *, struct cloudabi64_sys_fd_read_args *); int cloudabi_sys_fd_replace(struct thread *, struct cloudabi_sys_fd_replace_args *); int cloudabi_sys_fd_seek(struct thread *, struct cloudabi_sys_fd_seek_args *); int cloudabi_sys_fd_stat_get(struct thread *, struct cloudabi_sys_fd_stat_get_args *); int cloudabi_sys_fd_stat_put(struct thread *, struct cloudabi_sys_fd_stat_put_args *); int cloudabi_sys_fd_sync(struct thread *, struct cloudabi_sys_fd_sync_args *); int cloudabi64_sys_fd_write(struct thread *, struct cloudabi64_sys_fd_write_args *); int cloudabi_sys_file_advise(struct thread *, struct cloudabi_sys_file_advise_args *); int cloudabi_sys_file_allocate(struct thread *, struct cloudabi_sys_file_allocate_args *); int cloudabi_sys_file_create(struct thread *, struct cloudabi_sys_file_create_args *); int cloudabi_sys_file_link(struct thread *, struct cloudabi_sys_file_link_args *); int cloudabi_sys_file_open(struct thread *, struct cloudabi_sys_file_open_args *); int cloudabi_sys_file_readdir(struct thread *, struct cloudabi_sys_file_readdir_args *); int cloudabi_sys_file_readlink(struct thread *, struct cloudabi_sys_file_readlink_args *); int cloudabi_sys_file_rename(struct thread *, struct cloudabi_sys_file_rename_args *); int cloudabi_sys_file_stat_fget(struct thread *, struct cloudabi_sys_file_stat_fget_args *); int cloudabi_sys_file_stat_fput(struct thread *, struct cloudabi_sys_file_stat_fput_args *); int cloudabi_sys_file_stat_get(struct thread *, struct cloudabi_sys_file_stat_get_args *); int cloudabi_sys_file_stat_put(struct thread *, struct cloudabi_sys_file_stat_put_args *); int cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_args *); int cloudabi_sys_file_unlink(struct thread *, struct cloudabi_sys_file_unlink_args *); int cloudabi_sys_lock_unlock(struct thread *, struct cloudabi_sys_lock_unlock_args *); int cloudabi_sys_mem_advise(struct thread *, struct cloudabi_sys_mem_advise_args *); int cloudabi_sys_mem_map(struct thread *, struct cloudabi_sys_mem_map_args *); int cloudabi_sys_mem_protect(struct thread *, struct cloudabi_sys_mem_protect_args *); int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi64_sys_poll(struct thread *, struct cloudabi64_sys_poll_args *); int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); int cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *); int cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *); int cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *); -int cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *); -int cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *); -int cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *); int cloudabi64_sys_sock_recv(struct thread *, struct cloudabi64_sys_sock_recv_args *); int cloudabi64_sys_sock_send(struct thread *, struct cloudabi64_sys_sock_send_args *); int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *); int cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *); int cloudabi64_sys_thread_create(struct thread *, struct cloudabi64_sys_thread_create_args *); int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); #ifdef COMPAT_43 #endif /* COMPAT_43 */ #ifdef COMPAT_FREEBSD4 #endif /* COMPAT_FREEBSD4 */ #ifdef COMPAT_FREEBSD6 #endif /* COMPAT_FREEBSD6 */ #ifdef COMPAT_FREEBSD7 #endif /* COMPAT_FREEBSD7 */ #ifdef COMPAT_FREEBSD10 #endif /* COMPAT_FREEBSD10 */ #ifdef COMPAT_FREEBSD11 #endif /* COMPAT_FREEBSD11 */ #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_close AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_create1 AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_create2 AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_datasync AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_dup AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_fd_pread AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_fd_pwrite AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_fd_read AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_replace AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_seek AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_stat_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_stat_put AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_fd_sync AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_fd_write AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_advise AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_allocate AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_create AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_link AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_open AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_readdir AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_readlink AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_rename AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_stat_fget AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_stat_fput AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_stat_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_stat_put AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_symlink AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_file_unlink AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_lock_unlock AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_advise AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_map AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_protect AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_raise AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_random_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_accept AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_bind AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_connect AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_listen AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_sock_recv AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_sock_send AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_shutdown AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_stat_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_thread_create AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL #undef PAD_ #undef PADL_ #undef PADR_ #endif /* !_CLOUDABI64_SYSPROTO_H_ */ Index: head/sys/compat/cloudabi64/cloudabi64_syscall.h =================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h (revision 322884) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h (revision 322885) @@ -1,63 +1,60 @@ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 #define CLOUDABI64_SYS_cloudabi_sys_clock_time_get 1 #define CLOUDABI64_SYS_cloudabi_sys_condvar_signal 2 #define CLOUDABI64_SYS_cloudabi_sys_fd_close 3 #define CLOUDABI64_SYS_cloudabi_sys_fd_create1 4 #define CLOUDABI64_SYS_cloudabi_sys_fd_create2 5 #define CLOUDABI64_SYS_cloudabi_sys_fd_datasync 6 #define CLOUDABI64_SYS_cloudabi_sys_fd_dup 7 #define CLOUDABI64_SYS_cloudabi64_sys_fd_pread 8 #define CLOUDABI64_SYS_cloudabi64_sys_fd_pwrite 9 #define CLOUDABI64_SYS_cloudabi64_sys_fd_read 10 #define CLOUDABI64_SYS_cloudabi_sys_fd_replace 11 #define CLOUDABI64_SYS_cloudabi_sys_fd_seek 12 #define CLOUDABI64_SYS_cloudabi_sys_fd_stat_get 13 #define CLOUDABI64_SYS_cloudabi_sys_fd_stat_put 14 #define CLOUDABI64_SYS_cloudabi_sys_fd_sync 15 #define CLOUDABI64_SYS_cloudabi64_sys_fd_write 16 #define CLOUDABI64_SYS_cloudabi_sys_file_advise 17 #define CLOUDABI64_SYS_cloudabi_sys_file_allocate 18 #define CLOUDABI64_SYS_cloudabi_sys_file_create 19 #define CLOUDABI64_SYS_cloudabi_sys_file_link 20 #define CLOUDABI64_SYS_cloudabi_sys_file_open 21 #define CLOUDABI64_SYS_cloudabi_sys_file_readdir 22 #define CLOUDABI64_SYS_cloudabi_sys_file_readlink 23 #define CLOUDABI64_SYS_cloudabi_sys_file_rename 24 #define CLOUDABI64_SYS_cloudabi_sys_file_stat_fget 25 #define CLOUDABI64_SYS_cloudabi_sys_file_stat_fput 26 #define CLOUDABI64_SYS_cloudabi_sys_file_stat_get 27 #define CLOUDABI64_SYS_cloudabi_sys_file_stat_put 28 #define CLOUDABI64_SYS_cloudabi_sys_file_symlink 29 #define CLOUDABI64_SYS_cloudabi_sys_file_unlink 30 #define CLOUDABI64_SYS_cloudabi_sys_lock_unlock 31 #define CLOUDABI64_SYS_cloudabi_sys_mem_advise 32 #define CLOUDABI64_SYS_cloudabi_sys_mem_map 33 #define CLOUDABI64_SYS_cloudabi_sys_mem_protect 34 #define CLOUDABI64_SYS_cloudabi_sys_mem_sync 35 #define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 36 #define CLOUDABI64_SYS_cloudabi64_sys_poll 37 #define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 38 #define CLOUDABI64_SYS_cloudabi_sys_proc_exec 39 #define CLOUDABI64_SYS_cloudabi_sys_proc_exit 40 #define CLOUDABI64_SYS_cloudabi_sys_proc_fork 41 #define CLOUDABI64_SYS_cloudabi_sys_proc_raise 42 #define CLOUDABI64_SYS_cloudabi_sys_random_get 43 #define CLOUDABI64_SYS_cloudabi_sys_sock_accept 44 -#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 45 -#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 46 -#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 47 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 48 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 49 -#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 50 -#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 51 -#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 52 -#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 53 -#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 54 -#define CLOUDABI64_SYS_MAXSYSCALL 55 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 45 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 46 +#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 47 +#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 48 +#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 49 +#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 50 +#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 51 +#define CLOUDABI64_SYS_MAXSYSCALL 52 Index: head/sys/compat/cloudabi64/cloudabi64_syscalls.c =================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c (revision 322884) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c (revision 322885) @@ -1,64 +1,61 @@ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ const char *cloudabi64_syscallnames[] = { "cloudabi_sys_clock_res_get", /* 0 = cloudabi_sys_clock_res_get */ "cloudabi_sys_clock_time_get", /* 1 = cloudabi_sys_clock_time_get */ "cloudabi_sys_condvar_signal", /* 2 = cloudabi_sys_condvar_signal */ "cloudabi_sys_fd_close", /* 3 = cloudabi_sys_fd_close */ "cloudabi_sys_fd_create1", /* 4 = cloudabi_sys_fd_create1 */ "cloudabi_sys_fd_create2", /* 5 = cloudabi_sys_fd_create2 */ "cloudabi_sys_fd_datasync", /* 6 = cloudabi_sys_fd_datasync */ "cloudabi_sys_fd_dup", /* 7 = cloudabi_sys_fd_dup */ "cloudabi64_sys_fd_pread", /* 8 = cloudabi64_sys_fd_pread */ "cloudabi64_sys_fd_pwrite", /* 9 = cloudabi64_sys_fd_pwrite */ "cloudabi64_sys_fd_read", /* 10 = cloudabi64_sys_fd_read */ "cloudabi_sys_fd_replace", /* 11 = cloudabi_sys_fd_replace */ "cloudabi_sys_fd_seek", /* 12 = cloudabi_sys_fd_seek */ "cloudabi_sys_fd_stat_get", /* 13 = cloudabi_sys_fd_stat_get */ "cloudabi_sys_fd_stat_put", /* 14 = cloudabi_sys_fd_stat_put */ "cloudabi_sys_fd_sync", /* 15 = cloudabi_sys_fd_sync */ "cloudabi64_sys_fd_write", /* 16 = cloudabi64_sys_fd_write */ "cloudabi_sys_file_advise", /* 17 = cloudabi_sys_file_advise */ "cloudabi_sys_file_allocate", /* 18 = cloudabi_sys_file_allocate */ "cloudabi_sys_file_create", /* 19 = cloudabi_sys_file_create */ "cloudabi_sys_file_link", /* 20 = cloudabi_sys_file_link */ "cloudabi_sys_file_open", /* 21 = cloudabi_sys_file_open */ "cloudabi_sys_file_readdir", /* 22 = cloudabi_sys_file_readdir */ "cloudabi_sys_file_readlink", /* 23 = cloudabi_sys_file_readlink */ "cloudabi_sys_file_rename", /* 24 = cloudabi_sys_file_rename */ "cloudabi_sys_file_stat_fget", /* 25 = cloudabi_sys_file_stat_fget */ "cloudabi_sys_file_stat_fput", /* 26 = cloudabi_sys_file_stat_fput */ "cloudabi_sys_file_stat_get", /* 27 = cloudabi_sys_file_stat_get */ "cloudabi_sys_file_stat_put", /* 28 = cloudabi_sys_file_stat_put */ "cloudabi_sys_file_symlink", /* 29 = cloudabi_sys_file_symlink */ "cloudabi_sys_file_unlink", /* 30 = cloudabi_sys_file_unlink */ "cloudabi_sys_lock_unlock", /* 31 = cloudabi_sys_lock_unlock */ "cloudabi_sys_mem_advise", /* 32 = cloudabi_sys_mem_advise */ "cloudabi_sys_mem_map", /* 33 = cloudabi_sys_mem_map */ "cloudabi_sys_mem_protect", /* 34 = cloudabi_sys_mem_protect */ "cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */ "cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */ "cloudabi64_sys_poll", /* 37 = cloudabi64_sys_poll */ "cloudabi64_sys_poll_fd", /* 38 = cloudabi64_sys_poll_fd */ "cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */ "cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */ "cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */ "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ "cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */ - "cloudabi64_sys_sock_recv", /* 48 = cloudabi64_sys_sock_recv */ - "cloudabi64_sys_sock_send", /* 49 = cloudabi64_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */ - "cloudabi64_sys_thread_create", /* 52 = cloudabi64_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */ + "cloudabi64_sys_sock_recv", /* 45 = cloudabi64_sys_sock_recv */ + "cloudabi64_sys_sock_send", /* 46 = cloudabi64_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 47 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 48 = cloudabi_sys_sock_stat_get */ + "cloudabi64_sys_thread_create", /* 49 = cloudabi64_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 50 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 51 = cloudabi_sys_thread_yield */ }; Index: head/sys/compat/cloudabi64/cloudabi64_sysent.c =================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c (revision 322884) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c (revision 322885) @@ -1,72 +1,69 @@ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ */ #include #include #include #include #define AS(name) (sizeof(struct name) / sizeof(register_t)) /* The casts are bogus but will do for now. */ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_clock_res_get_args), (sy_call_t *)cloudabi_sys_clock_res_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 0 = cloudabi_sys_clock_res_get */ { AS(cloudabi_sys_clock_time_get_args), (sy_call_t *)cloudabi_sys_clock_time_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 1 = cloudabi_sys_clock_time_get */ { AS(cloudabi_sys_condvar_signal_args), (sy_call_t *)cloudabi_sys_condvar_signal, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = cloudabi_sys_condvar_signal */ { AS(cloudabi_sys_fd_close_args), (sy_call_t *)cloudabi_sys_fd_close, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = cloudabi_sys_fd_close */ { AS(cloudabi_sys_fd_create1_args), (sy_call_t *)cloudabi_sys_fd_create1, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = cloudabi_sys_fd_create1 */ { AS(cloudabi_sys_fd_create2_args), (sy_call_t *)cloudabi_sys_fd_create2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = cloudabi_sys_fd_create2 */ { AS(cloudabi_sys_fd_datasync_args), (sy_call_t *)cloudabi_sys_fd_datasync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = cloudabi_sys_fd_datasync */ { AS(cloudabi_sys_fd_dup_args), (sy_call_t *)cloudabi_sys_fd_dup, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 7 = cloudabi_sys_fd_dup */ { AS(cloudabi64_sys_fd_pread_args), (sy_call_t *)cloudabi64_sys_fd_pread, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 8 = cloudabi64_sys_fd_pread */ { AS(cloudabi64_sys_fd_pwrite_args), (sy_call_t *)cloudabi64_sys_fd_pwrite, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 9 = cloudabi64_sys_fd_pwrite */ { AS(cloudabi64_sys_fd_read_args), (sy_call_t *)cloudabi64_sys_fd_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 10 = cloudabi64_sys_fd_read */ { AS(cloudabi_sys_fd_replace_args), (sy_call_t *)cloudabi_sys_fd_replace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 11 = cloudabi_sys_fd_replace */ { AS(cloudabi_sys_fd_seek_args), (sy_call_t *)cloudabi_sys_fd_seek, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 12 = cloudabi_sys_fd_seek */ { AS(cloudabi_sys_fd_stat_get_args), (sy_call_t *)cloudabi_sys_fd_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 13 = cloudabi_sys_fd_stat_get */ { AS(cloudabi_sys_fd_stat_put_args), (sy_call_t *)cloudabi_sys_fd_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 14 = cloudabi_sys_fd_stat_put */ { AS(cloudabi_sys_fd_sync_args), (sy_call_t *)cloudabi_sys_fd_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 15 = cloudabi_sys_fd_sync */ { AS(cloudabi64_sys_fd_write_args), (sy_call_t *)cloudabi64_sys_fd_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 16 = cloudabi64_sys_fd_write */ { AS(cloudabi_sys_file_advise_args), (sy_call_t *)cloudabi_sys_file_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = cloudabi_sys_file_advise */ { AS(cloudabi_sys_file_allocate_args), (sy_call_t *)cloudabi_sys_file_allocate, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 18 = cloudabi_sys_file_allocate */ { AS(cloudabi_sys_file_create_args), (sy_call_t *)cloudabi_sys_file_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = cloudabi_sys_file_create */ { AS(cloudabi_sys_file_link_args), (sy_call_t *)cloudabi_sys_file_link, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = cloudabi_sys_file_link */ { AS(cloudabi_sys_file_open_args), (sy_call_t *)cloudabi_sys_file_open, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 21 = cloudabi_sys_file_open */ { AS(cloudabi_sys_file_readdir_args), (sy_call_t *)cloudabi_sys_file_readdir, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 22 = cloudabi_sys_file_readdir */ { AS(cloudabi_sys_file_readlink_args), (sy_call_t *)cloudabi_sys_file_readlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 23 = cloudabi_sys_file_readlink */ { AS(cloudabi_sys_file_rename_args), (sy_call_t *)cloudabi_sys_file_rename, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 24 = cloudabi_sys_file_rename */ { AS(cloudabi_sys_file_stat_fget_args), (sy_call_t *)cloudabi_sys_file_stat_fget, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 25 = cloudabi_sys_file_stat_fget */ { AS(cloudabi_sys_file_stat_fput_args), (sy_call_t *)cloudabi_sys_file_stat_fput, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 26 = cloudabi_sys_file_stat_fput */ { AS(cloudabi_sys_file_stat_get_args), (sy_call_t *)cloudabi_sys_file_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 27 = cloudabi_sys_file_stat_get */ { AS(cloudabi_sys_file_stat_put_args), (sy_call_t *)cloudabi_sys_file_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 28 = cloudabi_sys_file_stat_put */ { AS(cloudabi_sys_file_symlink_args), (sy_call_t *)cloudabi_sys_file_symlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 29 = cloudabi_sys_file_symlink */ { AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */ { AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */ { AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */ { AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_map */ { AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_protect */ { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */ { AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi64_sys_poll */ { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi64_sys_poll_fd */ { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */ { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */ { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */ { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */ - { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi64_sys_sock_recv */ - { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi64_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */ + { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi64_sys_sock_recv */ + { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi64_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_thread_yield */ }; Index: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c =================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c (revision 322884) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c (revision 322885) @@ -1,1650 +1,1556 @@ /* * System call argument to DTrace register array converstion. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ static void systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) { int64_t *iarg = (int64_t *) uarg; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: { struct cloudabi_sys_clock_res_get_args *p = params; iarg[0] = p->clock_id; /* cloudabi_clockid_t */ *n_args = 1; break; } /* cloudabi_sys_clock_time_get */ case 1: { struct cloudabi_sys_clock_time_get_args *p = params; iarg[0] = p->clock_id; /* cloudabi_clockid_t */ iarg[1] = p->precision; /* cloudabi_timestamp_t */ *n_args = 2; break; } /* cloudabi_sys_condvar_signal */ case 2: { struct cloudabi_sys_condvar_signal_args *p = params; uarg[0] = (intptr_t) p->condvar; /* cloudabi_condvar_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */ *n_args = 3; break; } /* cloudabi_sys_fd_close */ case 3: { struct cloudabi_sys_fd_close_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi_sys_fd_create1 */ case 4: { struct cloudabi_sys_fd_create1_args *p = params; iarg[0] = p->type; /* cloudabi_filetype_t */ *n_args = 1; break; } /* cloudabi_sys_fd_create2 */ case 5: { struct cloudabi_sys_fd_create2_args *p = params; iarg[0] = p->type; /* cloudabi_filetype_t */ *n_args = 1; break; } /* cloudabi_sys_fd_datasync */ case 6: { struct cloudabi_sys_fd_datasync_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi_sys_fd_dup */ case 7: { struct cloudabi_sys_fd_dup_args *p = params; iarg[0] = p->from; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi64_sys_fd_pread */ case 8: { struct cloudabi64_sys_fd_pread_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */ uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; } /* cloudabi64_sys_fd_pwrite */ case 9: { struct cloudabi64_sys_fd_pwrite_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */ uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; } /* cloudabi64_sys_fd_read */ case 10: { struct cloudabi64_sys_fd_read_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */ uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } /* cloudabi_sys_fd_replace */ case 11: { struct cloudabi_sys_fd_replace_args *p = params; iarg[0] = p->from; /* cloudabi_fd_t */ iarg[1] = p->to; /* cloudabi_fd_t */ *n_args = 2; break; } /* cloudabi_sys_fd_seek */ case 12: { struct cloudabi_sys_fd_seek_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filedelta_t */ iarg[2] = p->whence; /* cloudabi_whence_t */ *n_args = 3; break; } /* cloudabi_sys_fd_stat_get */ case 13: { struct cloudabi_sys_fd_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_fdstat_t * */ *n_args = 2; break; } /* cloudabi_sys_fd_stat_put */ case 14: { struct cloudabi_sys_fd_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* const cloudabi_fdstat_t * */ iarg[2] = p->flags; /* cloudabi_fdsflags_t */ *n_args = 3; break; } /* cloudabi_sys_fd_sync */ case 15: { struct cloudabi_sys_fd_sync_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ *n_args = 1; break; } /* cloudabi64_sys_fd_write */ case 16: { struct cloudabi64_sys_fd_write_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */ uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } /* cloudabi_sys_file_advise */ case 17: { struct cloudabi_sys_file_advise_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filesize_t */ iarg[2] = p->len; /* cloudabi_filesize_t */ iarg[3] = p->advice; /* cloudabi_advice_t */ *n_args = 4; break; } /* cloudabi_sys_file_allocate */ case 18: { struct cloudabi_sys_file_allocate_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ iarg[1] = p->offset; /* cloudabi_filesize_t */ iarg[2] = p->len; /* cloudabi_filesize_t */ *n_args = 3; break; } /* cloudabi_sys_file_create */ case 19: { struct cloudabi_sys_file_create_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->type; /* cloudabi_filetype_t */ *n_args = 4; break; } /* cloudabi_sys_file_link */ case 20: { struct cloudabi_sys_file_link_args *p = params; iarg[0] = p->fd1; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } /* cloudabi_sys_file_open */ case 21: { struct cloudabi_sys_file_open_args *p = params; iarg[0] = p->dirfd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->oflags; /* cloudabi_oflags_t */ uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */ *n_args = 5; break; } /* cloudabi_sys_file_readdir */ case 22: { struct cloudabi_sys_file_readdir_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->buf_len; /* size_t */ iarg[3] = p->cookie; /* cloudabi_dircookie_t */ *n_args = 4; break; } /* cloudabi_sys_file_readlink */ case 23: { struct cloudabi_sys_file_readlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* char * */ uarg[4] = p->buf_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_rename */ case 24: { struct cloudabi_sys_file_rename_args *p = params; iarg[0] = p->fd1; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } /* cloudabi_sys_file_stat_fget */ case 25: { struct cloudabi_sys_file_stat_fget_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 2; break; } /* cloudabi_sys_file_stat_fput */ case 26: { struct cloudabi_sys_file_stat_fput_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[2] = p->flags; /* cloudabi_fsflags_t */ *n_args = 3; break; } /* cloudabi_sys_file_stat_get */ case 27: { struct cloudabi_sys_file_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 4; break; } /* cloudabi_sys_file_stat_put */ case 28: { struct cloudabi_sys_file_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[4] = p->flags; /* cloudabi_fsflags_t */ *n_args = 5; break; } /* cloudabi_sys_file_symlink */ case 29: { struct cloudabi_sys_file_symlink_args *p = params; uarg[0] = (intptr_t) p->path1; /* const char * */ uarg[1] = p->path1_len; /* size_t */ iarg[2] = p->fd; /* cloudabi_fd_t */ uarg[3] = (intptr_t) p->path2; /* const char * */ uarg[4] = p->path2_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_unlink */ case 30: { struct cloudabi_sys_file_unlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->path_len; /* size_t */ iarg[3] = p->flags; /* cloudabi_ulflags_t */ *n_args = 4; break; } /* cloudabi_sys_lock_unlock */ case 31: { struct cloudabi_sys_lock_unlock_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } /* cloudabi_sys_mem_advise */ case 32: { struct cloudabi_sys_mem_advise_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->advice; /* cloudabi_advice_t */ *n_args = 3; break; } /* cloudabi_sys_mem_map */ case 33: { struct cloudabi_sys_mem_map_args *p = params; uarg[0] = (intptr_t) p->addr; /* void * */ uarg[1] = p->len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ iarg[3] = p->flags; /* cloudabi_mflags_t */ iarg[4] = p->fd; /* cloudabi_fd_t */ iarg[5] = p->off; /* cloudabi_filesize_t */ *n_args = 6; break; } /* cloudabi_sys_mem_protect */ case 34: { struct cloudabi_sys_mem_protect_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ *n_args = 3; break; } /* cloudabi_sys_mem_sync */ case 35: { struct cloudabi_sys_mem_sync_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->flags; /* cloudabi_msflags_t */ *n_args = 3; break; } /* cloudabi_sys_mem_unmap */ case 36: { struct cloudabi_sys_mem_unmap_args *p = params; uarg[0] = (intptr_t) p->mapping; /* void * */ uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } /* cloudabi64_sys_poll */ case 37: { struct cloudabi64_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ uarg[1] = (intptr_t) p->out; /* cloudabi64_event_t * */ uarg[2] = p->nsubscriptions; /* size_t */ *n_args = 3; break; } /* cloudabi64_sys_poll_fd */ case 38: { struct cloudabi64_sys_poll_fd_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ uarg[2] = p->in_len; /* size_t */ uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ uarg[4] = p->out_len; /* size_t */ uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ *n_args = 6; break; } /* cloudabi_sys_proc_exec */ case 39: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ uarg[2] = p->data_len; /* size_t */ uarg[3] = (intptr_t) p->fds; /* const cloudabi_fd_t * */ uarg[4] = p->fds_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_proc_exit */ case 40: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ case 41: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ case 42: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ case 43: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->buf_len; /* size_t */ *n_args = 2; break; } /* cloudabi_sys_sock_accept */ case 44: { struct cloudabi_sys_sock_accept_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->unused; /* void * */ *n_args = 2; break; } - /* cloudabi_sys_sock_bind */ - case 45: { - struct cloudabi_sys_sock_bind_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_connect */ - case 46: { - struct cloudabi_sys_sock_connect_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_listen */ - case 47: { - struct cloudabi_sys_sock_listen_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->backlog; /* cloudabi_backlog_t */ - *n_args = 2; - break; - } /* cloudabi64_sys_sock_recv */ - case 48: { + case 45: { struct cloudabi64_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi64_recv_out_t * */ *n_args = 3; break; } /* cloudabi64_sys_sock_send */ - case 49: { + case 46: { struct cloudabi64_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ uarg[2] = (intptr_t) p->out; /* cloudabi64_send_out_t * */ *n_args = 3; break; } /* cloudabi_sys_sock_shutdown */ - case 50: { + case 47: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ *n_args = 2; break; } /* cloudabi_sys_sock_stat_get */ - case 51: { + case 48: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ iarg[2] = p->flags; /* cloudabi_ssflags_t */ *n_args = 3; break; } /* cloudabi64_sys_thread_create */ - case 52: { + case 49: { struct cloudabi64_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 53: { + case 50: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } /* cloudabi_sys_thread_yield */ - case 54: { + case 51: { *n_args = 0; break; } default: *n_args = 0; break; }; } static void systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) { const char *p = NULL; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: switch(ndx) { case 0: p = "cloudabi_clockid_t"; break; default: break; }; break; /* cloudabi_sys_clock_time_get */ case 1: switch(ndx) { case 0: p = "cloudabi_clockid_t"; break; case 1: p = "cloudabi_timestamp_t"; break; default: break; }; break; /* cloudabi_sys_condvar_signal */ case 2: switch(ndx) { case 0: p = "userland cloudabi_condvar_t *"; break; case 1: p = "cloudabi_scope_t"; break; case 2: p = "cloudabi_nthreads_t"; break; default: break; }; break; /* cloudabi_sys_fd_close */ case 3: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_create1 */ case 4: switch(ndx) { case 0: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_fd_create2 */ case 5: switch(ndx) { case 0: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_fd_datasync */ case 6: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_dup */ case 7: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi64_sys_fd_pread */ case 8: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_iovec_t *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi64_sys_fd_pwrite */ case 9: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_ciovec_t *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi64_sys_fd_read */ case 10: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_iovec_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_fd_replace */ case 11: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi_sys_fd_seek */ case 12: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filedelta_t"; break; case 2: p = "cloudabi_whence_t"; break; default: break; }; break; /* cloudabi_sys_fd_stat_get */ case 13: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_fdstat_t *"; break; default: break; }; break; /* cloudabi_sys_fd_stat_put */ case 14: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi_fdstat_t *"; break; case 2: p = "cloudabi_fdsflags_t"; break; default: break; }; break; /* cloudabi_sys_fd_sync */ case 15: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; default: break; }; break; /* cloudabi64_sys_fd_write */ case 16: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_ciovec_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_advise */ case 17: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filesize_t"; break; case 2: p = "cloudabi_filesize_t"; break; case 3: p = "cloudabi_advice_t"; break; default: break; }; break; /* cloudabi_sys_file_allocate */ case 18: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_filesize_t"; break; case 2: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi_sys_file_create */ case 19: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_filetype_t"; break; default: break; }; break; /* cloudabi_sys_file_link */ case 20: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_fd_t"; break; case 4: p = "userland const char *"; break; case 5: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_open */ case 21: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_oflags_t"; break; case 4: p = "userland const cloudabi_fdstat_t *"; break; default: break; }; break; /* cloudabi_sys_file_readdir */ case 22: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland void *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_dircookie_t"; break; default: break; }; break; /* cloudabi_sys_file_readlink */ case 23: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland char *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_rename */ case 24: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_fd_t"; break; case 4: p = "userland const char *"; break; case 5: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_stat_fget */ case 25: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_filestat_t *"; break; default: break; }; break; /* cloudabi_sys_file_stat_fput */ case 26: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi_filestat_t *"; break; case 2: p = "cloudabi_fsflags_t"; break; default: break; }; break; /* cloudabi_sys_file_stat_get */ case 27: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland cloudabi_filestat_t *"; break; default: break; }; break; /* cloudabi_sys_file_stat_put */ case 28: switch(ndx) { case 0: p = "cloudabi_lookup_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "userland const cloudabi_filestat_t *"; break; case 4: p = "cloudabi_fsflags_t"; break; default: break; }; break; /* cloudabi_sys_file_symlink */ case 29: switch(ndx) { case 0: p = "userland const char *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_fd_t"; break; case 3: p = "userland const char *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_file_unlink */ case 30: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const char *"; break; case 2: p = "size_t"; break; case 3: p = "cloudabi_ulflags_t"; break; default: break; }; break; /* cloudabi_sys_lock_unlock */ case 31: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; break; case 1: p = "cloudabi_scope_t"; break; default: break; }; break; /* cloudabi_sys_mem_advise */ case 32: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_advice_t"; break; default: break; }; break; /* cloudabi_sys_mem_map */ case 33: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_mprot_t"; break; case 3: p = "cloudabi_mflags_t"; break; case 4: p = "cloudabi_fd_t"; break; case 5: p = "cloudabi_filesize_t"; break; default: break; }; break; /* cloudabi_sys_mem_protect */ case 34: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_mprot_t"; break; default: break; }; break; /* cloudabi_sys_mem_sync */ case 35: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; case 2: p = "cloudabi_msflags_t"; break; default: break; }; break; /* cloudabi_sys_mem_unmap */ case 36: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; default: break; }; break; /* cloudabi64_sys_poll */ case 37: switch(ndx) { case 0: p = "userland const cloudabi64_subscription_t *"; break; case 1: p = "userland cloudabi64_event_t *"; break; case 2: p = "size_t"; break; default: break; }; break; /* cloudabi64_sys_poll_fd */ case 38: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_subscription_t *"; break; case 2: p = "size_t"; break; case 3: p = "userland cloudabi64_event_t *"; break; case 4: p = "size_t"; break; case 5: p = "userland const cloudabi64_subscription_t *"; break; default: break; }; break; /* cloudabi_sys_proc_exec */ case 39: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const void *"; break; case 2: p = "size_t"; break; case 3: p = "userland const cloudabi_fd_t *"; break; case 4: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_proc_exit */ case 40: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; break; default: break; }; break; /* cloudabi_sys_proc_fork */ case 41: break; /* cloudabi_sys_proc_raise */ case 42: switch(ndx) { case 0: p = "cloudabi_signal_t"; break; default: break; }; break; /* cloudabi_sys_random_get */ case 43: switch(ndx) { case 0: p = "userland void *"; break; case 1: p = "size_t"; break; default: break; }; break; /* cloudabi_sys_sock_accept */ case 44: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland void *"; break; default: break; }; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi64_sys_sock_recv */ case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_connect */ - case 46: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_listen */ - case 47: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_backlog_t"; - break; - default: - break; - }; - break; - /* cloudabi64_sys_sock_recv */ - case 48: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const cloudabi64_recv_in_t *"; break; case 2: p = "userland cloudabi64_recv_out_t *"; break; default: break; }; break; /* cloudabi64_sys_sock_send */ - case 49: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland const cloudabi64_send_in_t *"; break; case 2: p = "userland cloudabi64_send_out_t *"; break; default: break; }; break; /* cloudabi_sys_sock_shutdown */ - case 50: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "cloudabi_sdflags_t"; break; default: break; }; break; /* cloudabi_sys_sock_stat_get */ - case 51: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: p = "userland cloudabi_sockstat_t *"; break; case 2: p = "cloudabi_ssflags_t"; break; default: break; }; break; /* cloudabi64_sys_thread_create */ - case 52: + case 49: switch(ndx) { case 0: p = "userland cloudabi64_threadattr_t *"; break; default: break; }; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; break; case 1: p = "cloudabi_scope_t"; break; default: break; }; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: break; default: break; }; if (p != NULL) strlcpy(desc, p, descsz); } static void systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) { const char *p = NULL; switch (sysnum) { /* cloudabi_sys_clock_res_get */ case 0: if (ndx == 0 || ndx == 1) p = "cloudabi_timestamp_t"; break; /* cloudabi_sys_clock_time_get */ case 1: if (ndx == 0 || ndx == 1) p = "cloudabi_timestamp_t"; break; /* cloudabi_sys_condvar_signal */ case 2: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_close */ case 3: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_create1 */ case 4: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_fd_create2 */ case 5: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_datasync */ case 6: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_dup */ case 7: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi64_sys_fd_pread */ case 8: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi64_sys_fd_pwrite */ case 9: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi64_sys_fd_read */ case 10: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_fd_replace */ case 11: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_seek */ case 12: if (ndx == 0 || ndx == 1) p = "cloudabi_filesize_t"; break; /* cloudabi_sys_fd_stat_get */ case 13: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_stat_put */ case 14: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_fd_sync */ case 15: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_fd_write */ case 16: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_advise */ case 17: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_allocate */ case 18: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_create */ case 19: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_link */ case 20: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_open */ case 21: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_file_readdir */ case 22: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_readlink */ case 23: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_file_rename */ case 24: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_fget */ case 25: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_fput */ case 26: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_get */ case 27: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_stat_put */ case 28: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_symlink */ case 29: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_file_unlink */ case 30: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_lock_unlock */ case 31: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_advise */ case 32: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_map */ case 33: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_protect */ case 34: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_sync */ case 35: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_mem_unmap */ case 36: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_poll */ case 37: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi64_sys_poll_fd */ case 38: if (ndx == 0 || ndx == 1) p = "size_t"; break; /* cloudabi_sys_proc_exec */ case 39: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_exit */ case 40: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_fork */ case 41: /* cloudabi_sys_proc_raise */ case 42: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_random_get */ case 43: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_accept */ case 44: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi64_sys_sock_recv */ case 45: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_connect */ + /* cloudabi64_sys_sock_send */ case 46: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_listen */ + /* cloudabi_sys_sock_shutdown */ case 47: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi64_sys_sock_recv */ + /* cloudabi_sys_sock_stat_get */ case 48: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi64_sys_sock_send */ + /* cloudabi64_sys_thread_create */ case 49: if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_shutdown */ - case 50: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_stat_get */ - case 51: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi64_sys_thread_create */ - case 52: - if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: default: break; }; if (p != NULL) strlcpy(desc, p, descsz); } Index: head/sys/contrib/cloudabi/cloudabi_types_common.h =================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h (revision 322885) @@ -1,437 +1,432 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #ifndef CLOUDABI_TYPES_COMMON_H #define CLOUDABI_TYPES_COMMON_H #if defined(__FreeBSD__) && defined(_KERNEL) #include #elif defined(__linux__) && defined(__KERNEL__) #include #else #include #include #endif typedef uint8_t cloudabi_advice_t; #define CLOUDABI_ADVICE_DONTNEED 1 #define CLOUDABI_ADVICE_NOREUSE 2 #define CLOUDABI_ADVICE_NORMAL 3 #define CLOUDABI_ADVICE_RANDOM 4 #define CLOUDABI_ADVICE_SEQUENTIAL 5 #define CLOUDABI_ADVICE_WILLNEED 6 typedef uint32_t cloudabi_auxtype_t; #define CLOUDABI_AT_ARGDATA 256 #define CLOUDABI_AT_ARGDATALEN 257 #define CLOUDABI_AT_BASE 7 #define CLOUDABI_AT_CANARY 258 #define CLOUDABI_AT_CANARYLEN 259 #define CLOUDABI_AT_NCPUS 260 #define CLOUDABI_AT_NULL 0 #define CLOUDABI_AT_PAGESZ 6 #define CLOUDABI_AT_PHDR 3 #define CLOUDABI_AT_PHNUM 4 #define CLOUDABI_AT_SYSINFO_EHDR 262 #define CLOUDABI_AT_TID 261 typedef uint32_t cloudabi_backlog_t; typedef uint32_t cloudabi_clockid_t; #define CLOUDABI_CLOCK_MONOTONIC 1 #define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2 #define CLOUDABI_CLOCK_REALTIME 3 #define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4 typedef uint32_t cloudabi_condvar_t; #define CLOUDABI_CONDVAR_HAS_NO_WAITERS 0 typedef uint64_t cloudabi_device_t; typedef uint64_t cloudabi_dircookie_t; #define CLOUDABI_DIRCOOKIE_START 0 typedef uint16_t cloudabi_errno_t; #define CLOUDABI_E2BIG 1 #define CLOUDABI_EACCES 2 #define CLOUDABI_EADDRINUSE 3 #define CLOUDABI_EADDRNOTAVAIL 4 #define CLOUDABI_EAFNOSUPPORT 5 #define CLOUDABI_EAGAIN 6 #define CLOUDABI_EALREADY 7 #define CLOUDABI_EBADF 8 #define CLOUDABI_EBADMSG 9 #define CLOUDABI_EBUSY 10 #define CLOUDABI_ECANCELED 11 #define CLOUDABI_ECHILD 12 #define CLOUDABI_ECONNABORTED 13 #define CLOUDABI_ECONNREFUSED 14 #define CLOUDABI_ECONNRESET 15 #define CLOUDABI_EDEADLK 16 #define CLOUDABI_EDESTADDRREQ 17 #define CLOUDABI_EDOM 18 #define CLOUDABI_EDQUOT 19 #define CLOUDABI_EEXIST 20 #define CLOUDABI_EFAULT 21 #define CLOUDABI_EFBIG 22 #define CLOUDABI_EHOSTUNREACH 23 #define CLOUDABI_EIDRM 24 #define CLOUDABI_EILSEQ 25 #define CLOUDABI_EINPROGRESS 26 #define CLOUDABI_EINTR 27 #define CLOUDABI_EINVAL 28 #define CLOUDABI_EIO 29 #define CLOUDABI_EISCONN 30 #define CLOUDABI_EISDIR 31 #define CLOUDABI_ELOOP 32 #define CLOUDABI_EMFILE 33 #define CLOUDABI_EMLINK 34 #define CLOUDABI_EMSGSIZE 35 #define CLOUDABI_EMULTIHOP 36 #define CLOUDABI_ENAMETOOLONG 37 #define CLOUDABI_ENETDOWN 38 #define CLOUDABI_ENETRESET 39 #define CLOUDABI_ENETUNREACH 40 #define CLOUDABI_ENFILE 41 #define CLOUDABI_ENOBUFS 42 #define CLOUDABI_ENODEV 43 #define CLOUDABI_ENOENT 44 #define CLOUDABI_ENOEXEC 45 #define CLOUDABI_ENOLCK 46 #define CLOUDABI_ENOLINK 47 #define CLOUDABI_ENOMEM 48 #define CLOUDABI_ENOMSG 49 #define CLOUDABI_ENOPROTOOPT 50 #define CLOUDABI_ENOSPC 51 #define CLOUDABI_ENOSYS 52 #define CLOUDABI_ENOTCONN 53 #define CLOUDABI_ENOTDIR 54 #define CLOUDABI_ENOTEMPTY 55 #define CLOUDABI_ENOTRECOVERABLE 56 #define CLOUDABI_ENOTSOCK 57 #define CLOUDABI_ENOTSUP 58 #define CLOUDABI_ENOTTY 59 #define CLOUDABI_ENXIO 60 #define CLOUDABI_EOVERFLOW 61 #define CLOUDABI_EOWNERDEAD 62 #define CLOUDABI_EPERM 63 #define CLOUDABI_EPIPE 64 #define CLOUDABI_EPROTO 65 #define CLOUDABI_EPROTONOSUPPORT 66 #define CLOUDABI_EPROTOTYPE 67 #define CLOUDABI_ERANGE 68 #define CLOUDABI_EROFS 69 #define CLOUDABI_ESPIPE 70 #define CLOUDABI_ESRCH 71 #define CLOUDABI_ESTALE 72 #define CLOUDABI_ETIMEDOUT 73 #define CLOUDABI_ETXTBSY 74 #define CLOUDABI_EXDEV 75 #define CLOUDABI_ENOTCAPABLE 76 typedef uint16_t cloudabi_eventrwflags_t; #define CLOUDABI_EVENT_FD_READWRITE_HANGUP 0x0001 typedef uint8_t cloudabi_eventtype_t; #define CLOUDABI_EVENTTYPE_CLOCK 1 #define CLOUDABI_EVENTTYPE_CONDVAR 2 #define CLOUDABI_EVENTTYPE_FD_READ 3 #define CLOUDABI_EVENTTYPE_FD_WRITE 4 #define CLOUDABI_EVENTTYPE_LOCK_RDLOCK 5 #define CLOUDABI_EVENTTYPE_LOCK_WRLOCK 6 #define CLOUDABI_EVENTTYPE_PROC_TERMINATE 7 typedef uint32_t cloudabi_exitcode_t; typedef uint32_t cloudabi_fd_t; #define CLOUDABI_PROCESS_CHILD 0xffffffff #define CLOUDABI_MAP_ANON_FD 0xffffffff typedef uint16_t cloudabi_fdflags_t; #define CLOUDABI_FDFLAG_APPEND 0x0001 #define CLOUDABI_FDFLAG_DSYNC 0x0002 #define CLOUDABI_FDFLAG_NONBLOCK 0x0004 #define CLOUDABI_FDFLAG_RSYNC 0x0008 #define CLOUDABI_FDFLAG_SYNC 0x0010 typedef uint16_t cloudabi_fdsflags_t; #define CLOUDABI_FDSTAT_FLAGS 0x0001 #define CLOUDABI_FDSTAT_RIGHTS 0x0002 typedef int64_t cloudabi_filedelta_t; typedef uint64_t cloudabi_filesize_t; typedef uint8_t cloudabi_filetype_t; #define CLOUDABI_FILETYPE_UNKNOWN 0 #define CLOUDABI_FILETYPE_BLOCK_DEVICE 16 #define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17 #define CLOUDABI_FILETYPE_DIRECTORY 32 #define CLOUDABI_FILETYPE_FIFO 48 #define CLOUDABI_FILETYPE_POLL 64 #define CLOUDABI_FILETYPE_PROCESS 80 #define CLOUDABI_FILETYPE_REGULAR_FILE 96 #define CLOUDABI_FILETYPE_SHARED_MEMORY 112 #define CLOUDABI_FILETYPE_SOCKET_DGRAM 128 #define CLOUDABI_FILETYPE_SOCKET_STREAM 130 #define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144 typedef uint16_t cloudabi_fsflags_t; #define CLOUDABI_FILESTAT_ATIM 0x0001 #define CLOUDABI_FILESTAT_ATIM_NOW 0x0002 #define CLOUDABI_FILESTAT_MTIM 0x0004 #define CLOUDABI_FILESTAT_MTIM_NOW 0x0008 #define CLOUDABI_FILESTAT_SIZE 0x0010 typedef uint64_t cloudabi_inode_t; typedef uint32_t cloudabi_linkcount_t; typedef uint32_t cloudabi_lock_t; #define CLOUDABI_LOCK_UNLOCKED 0x00000000 #define CLOUDABI_LOCK_WRLOCKED 0x40000000 #define CLOUDABI_LOCK_KERNEL_MANAGED 0x80000000 #define CLOUDABI_LOCK_BOGUS 0x80000000 typedef uint32_t cloudabi_lookupflags_t; #define CLOUDABI_LOOKUP_SYMLINK_FOLLOW 0x00000001 typedef uint8_t cloudabi_mflags_t; #define CLOUDABI_MAP_ANON 0x01 #define CLOUDABI_MAP_FIXED 0x02 #define CLOUDABI_MAP_PRIVATE 0x04 #define CLOUDABI_MAP_SHARED 0x08 typedef uint8_t cloudabi_mprot_t; #define CLOUDABI_PROT_EXEC 0x01 #define CLOUDABI_PROT_WRITE 0x02 #define CLOUDABI_PROT_READ 0x04 typedef uint8_t cloudabi_msflags_t; #define CLOUDABI_MS_ASYNC 0x01 #define CLOUDABI_MS_INVALIDATE 0x02 #define CLOUDABI_MS_SYNC 0x04 typedef uint32_t cloudabi_nthreads_t; typedef uint16_t cloudabi_oflags_t; #define CLOUDABI_O_CREAT 0x0001 #define CLOUDABI_O_DIRECTORY 0x0002 #define CLOUDABI_O_EXCL 0x0004 #define CLOUDABI_O_TRUNC 0x0008 typedef uint16_t cloudabi_riflags_t; #define CLOUDABI_SOCK_RECV_PEEK 0x0004 #define CLOUDABI_SOCK_RECV_WAITALL 0x0010 typedef uint64_t cloudabi_rights_t; -#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 -#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 -#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 -#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 -#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 -#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 -#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 -#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 -#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 -#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 -#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 -#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 -#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 -#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 -#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 -#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 -#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 -#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 -#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 -#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000 -#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000 -#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000 -#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000 -#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000 -#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000 -#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000 -#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000 -#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000 -#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000 -#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000 -#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000 -#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000 -#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000 -#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000 -#define CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY 0x0000001000000000 -#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000 -#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000 -#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000 -#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000 +#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 +#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 +#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 +#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 +#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 +#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 +#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 +#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 +#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 +#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 +#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 +#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 +#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 +#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 +#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 +#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 +#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 +#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 +#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 +#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 +#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000 +#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000 +#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000 +#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000 +#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000 +#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000 +#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000 +#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000 +#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000 +#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000 +#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000 +#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000 +#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000 +#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000 +#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000 +#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000 typedef uint16_t cloudabi_roflags_t; #define CLOUDABI_SOCK_RECV_FDS_TRUNCATED 0x0001 #define CLOUDABI_SOCK_RECV_DATA_TRUNCATED 0x0008 typedef uint8_t cloudabi_scope_t; #define CLOUDABI_SCOPE_PRIVATE 4 #define CLOUDABI_SCOPE_SHARED 8 typedef uint8_t cloudabi_sdflags_t; #define CLOUDABI_SHUT_RD 0x01 #define CLOUDABI_SHUT_WR 0x02 typedef uint16_t cloudabi_siflags_t; typedef uint8_t cloudabi_signal_t; #define CLOUDABI_SIGABRT 1 #define CLOUDABI_SIGALRM 2 #define CLOUDABI_SIGBUS 3 #define CLOUDABI_SIGCHLD 4 #define CLOUDABI_SIGCONT 5 #define CLOUDABI_SIGFPE 6 #define CLOUDABI_SIGHUP 7 #define CLOUDABI_SIGILL 8 #define CLOUDABI_SIGINT 9 #define CLOUDABI_SIGKILL 10 #define CLOUDABI_SIGPIPE 11 #define CLOUDABI_SIGQUIT 12 #define CLOUDABI_SIGSEGV 13 #define CLOUDABI_SIGSTOP 14 #define CLOUDABI_SIGSYS 15 #define CLOUDABI_SIGTERM 16 #define CLOUDABI_SIGTRAP 17 #define CLOUDABI_SIGTSTP 18 #define CLOUDABI_SIGTTIN 19 #define CLOUDABI_SIGTTOU 20 #define CLOUDABI_SIGURG 21 #define CLOUDABI_SIGUSR1 22 #define CLOUDABI_SIGUSR2 23 #define CLOUDABI_SIGVTALRM 24 #define CLOUDABI_SIGXCPU 25 #define CLOUDABI_SIGXFSZ 26 typedef uint8_t cloudabi_ssflags_t; #define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01 typedef uint32_t cloudabi_sstate_t; #define CLOUDABI_SOCKSTATE_ACCEPTCONN 0x00000001 typedef uint16_t cloudabi_subclockflags_t; #define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x0001 typedef uint16_t cloudabi_subflags_t; #define CLOUDABI_SUBSCRIPTION_ADD 0x0001 #define CLOUDABI_SUBSCRIPTION_CLEAR 0x0002 #define CLOUDABI_SUBSCRIPTION_DELETE 0x0004 #define CLOUDABI_SUBSCRIPTION_DISABLE 0x0008 #define CLOUDABI_SUBSCRIPTION_ENABLE 0x0010 #define CLOUDABI_SUBSCRIPTION_ONESHOT 0x0020 typedef uint16_t cloudabi_subrwflags_t; #define CLOUDABI_SUBSCRIPTION_FD_READWRITE_POLL 0x0001 typedef uint32_t cloudabi_tid_t; typedef uint64_t cloudabi_timestamp_t; typedef uint8_t cloudabi_ulflags_t; #define CLOUDABI_UNLINK_REMOVEDIR 0x01 typedef uint64_t cloudabi_userdata_t; typedef uint8_t cloudabi_whence_t; #define CLOUDABI_WHENCE_CUR 1 #define CLOUDABI_WHENCE_END 2 #define CLOUDABI_WHENCE_SET 3 typedef struct { _Alignas(8) cloudabi_dircookie_t d_next; _Alignas(8) cloudabi_inode_t d_ino; _Alignas(4) uint32_t d_namlen; _Alignas(1) cloudabi_filetype_t d_type; } cloudabi_dirent_t; _Static_assert(offsetof(cloudabi_dirent_t, d_next) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_dirent_t, d_ino) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi_dirent_t, d_namlen) == 16, "Incorrect layout"); _Static_assert(offsetof(cloudabi_dirent_t, d_type) == 20, "Incorrect layout"); _Static_assert(sizeof(cloudabi_dirent_t) == 24, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_dirent_t) == 8, "Incorrect layout"); typedef struct { _Alignas(1) cloudabi_filetype_t fs_filetype; _Alignas(2) cloudabi_fdflags_t fs_flags; _Alignas(8) cloudabi_rights_t fs_rights_base; _Alignas(8) cloudabi_rights_t fs_rights_inheriting; } cloudabi_fdstat_t; _Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_fdstat_t, fs_flags) == 2, "Incorrect layout"); _Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16, "Incorrect layout"); _Static_assert(sizeof(cloudabi_fdstat_t) == 24, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_fdstat_t) == 8, "Incorrect layout"); typedef struct { _Alignas(8) cloudabi_device_t st_dev; _Alignas(8) cloudabi_inode_t st_ino; _Alignas(1) cloudabi_filetype_t st_filetype; _Alignas(4) cloudabi_linkcount_t st_nlink; _Alignas(8) cloudabi_filesize_t st_size; _Alignas(8) cloudabi_timestamp_t st_atim; _Alignas(8) cloudabi_timestamp_t st_mtim; _Alignas(8) cloudabi_timestamp_t st_ctim; } cloudabi_filestat_t; _Static_assert(offsetof(cloudabi_filestat_t, st_dev) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_ino) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48, "Incorrect layout"); _Static_assert(sizeof(cloudabi_filestat_t) == 56, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_filestat_t) == 8, "Incorrect layout"); typedef struct { _Alignas(4) cloudabi_fd_t fd; _Alignas(4) cloudabi_lookupflags_t flags; } cloudabi_lookup_t; _Static_assert(offsetof(cloudabi_lookup_t, fd) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_lookup_t, flags) == 4, "Incorrect layout"); _Static_assert(sizeof(cloudabi_lookup_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_lookup_t) == 4, "Incorrect layout"); typedef struct { _Alignas(1) char ss_unused[40]; _Alignas(2) cloudabi_errno_t ss_error; _Alignas(4) cloudabi_sstate_t ss_state; } cloudabi_sockstat_t; _Static_assert(offsetof(cloudabi_sockstat_t, ss_unused) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout"); _Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout"); _Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_sockstat_t) == 4, "Incorrect layout"); #endif Index: head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S =================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S (revision 322885) @@ -1,479 +1,461 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #define ENTRY(name) \ .text; \ .p2align 2; \ .global name; \ .type name, @function; \ name: #define END(name) .size name, . - name ENTRY(cloudabi_sys_clock_res_get) str x1, [sp, #-8] mov w8, #0 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_clock_res_get) ENTRY(cloudabi_sys_clock_time_get) str x2, [sp, #-8] mov w8, #1 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_clock_time_get) ENTRY(cloudabi_sys_condvar_signal) mov w8, #2 svc #0 ret END(cloudabi_sys_condvar_signal) ENTRY(cloudabi_sys_fd_close) mov w8, #3 svc #0 ret END(cloudabi_sys_fd_close) ENTRY(cloudabi_sys_fd_create1) str x1, [sp, #-8] mov w8, #4 svc #0 ldr x2, [sp, #-8] b.cs 1f str w0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_create1) ENTRY(cloudabi_sys_fd_create2) stp x1, x2, [sp, #-16] mov w8, #5 svc #0 ldp x2, x3, [sp, #-16] b.cs 1f str w0, [x2] str w1, [x3] mov w0, wzr 1: ret END(cloudabi_sys_fd_create2) ENTRY(cloudabi_sys_fd_datasync) mov w8, #6 svc #0 ret END(cloudabi_sys_fd_datasync) ENTRY(cloudabi_sys_fd_dup) str x1, [sp, #-8] mov w8, #7 svc #0 ldr x2, [sp, #-8] b.cs 1f str w0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_dup) ENTRY(cloudabi_sys_fd_pread) str x4, [sp, #-8] mov w8, #8 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_pread) ENTRY(cloudabi_sys_fd_pwrite) str x4, [sp, #-8] mov w8, #9 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_pwrite) ENTRY(cloudabi_sys_fd_read) str x3, [sp, #-8] mov w8, #10 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_read) ENTRY(cloudabi_sys_fd_replace) mov w8, #11 svc #0 ret END(cloudabi_sys_fd_replace) ENTRY(cloudabi_sys_fd_seek) str x3, [sp, #-8] mov w8, #12 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_seek) ENTRY(cloudabi_sys_fd_stat_get) mov w8, #13 svc #0 ret END(cloudabi_sys_fd_stat_get) ENTRY(cloudabi_sys_fd_stat_put) mov w8, #14 svc #0 ret END(cloudabi_sys_fd_stat_put) ENTRY(cloudabi_sys_fd_sync) mov w8, #15 svc #0 ret END(cloudabi_sys_fd_sync) ENTRY(cloudabi_sys_fd_write) str x3, [sp, #-8] mov w8, #16 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_fd_write) ENTRY(cloudabi_sys_file_advise) mov w8, #17 svc #0 ret END(cloudabi_sys_file_advise) ENTRY(cloudabi_sys_file_allocate) mov w8, #18 svc #0 ret END(cloudabi_sys_file_allocate) ENTRY(cloudabi_sys_file_create) mov w8, #19 svc #0 ret END(cloudabi_sys_file_create) ENTRY(cloudabi_sys_file_link) mov w8, #20 svc #0 ret END(cloudabi_sys_file_link) ENTRY(cloudabi_sys_file_open) str x5, [sp, #-8] mov w8, #21 svc #0 ldr x2, [sp, #-8] b.cs 1f str w0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_file_open) ENTRY(cloudabi_sys_file_readdir) str x4, [sp, #-8] mov w8, #22 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_file_readdir) ENTRY(cloudabi_sys_file_readlink) str x5, [sp, #-8] mov w8, #23 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_file_readlink) ENTRY(cloudabi_sys_file_rename) mov w8, #24 svc #0 ret END(cloudabi_sys_file_rename) ENTRY(cloudabi_sys_file_stat_fget) mov w8, #25 svc #0 ret END(cloudabi_sys_file_stat_fget) ENTRY(cloudabi_sys_file_stat_fput) mov w8, #26 svc #0 ret END(cloudabi_sys_file_stat_fput) ENTRY(cloudabi_sys_file_stat_get) mov w8, #27 svc #0 ret END(cloudabi_sys_file_stat_get) ENTRY(cloudabi_sys_file_stat_put) mov w8, #28 svc #0 ret END(cloudabi_sys_file_stat_put) ENTRY(cloudabi_sys_file_symlink) mov w8, #29 svc #0 ret END(cloudabi_sys_file_symlink) ENTRY(cloudabi_sys_file_unlink) mov w8, #30 svc #0 ret END(cloudabi_sys_file_unlink) ENTRY(cloudabi_sys_lock_unlock) mov w8, #31 svc #0 ret END(cloudabi_sys_lock_unlock) ENTRY(cloudabi_sys_mem_advise) mov w8, #32 svc #0 ret END(cloudabi_sys_mem_advise) ENTRY(cloudabi_sys_mem_map) str x6, [sp, #-8] mov w8, #33 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_mem_map) ENTRY(cloudabi_sys_mem_protect) mov w8, #34 svc #0 ret END(cloudabi_sys_mem_protect) ENTRY(cloudabi_sys_mem_sync) mov w8, #35 svc #0 ret END(cloudabi_sys_mem_sync) ENTRY(cloudabi_sys_mem_unmap) mov w8, #36 svc #0 ret END(cloudabi_sys_mem_unmap) ENTRY(cloudabi_sys_poll) str x3, [sp, #-8] mov w8, #37 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_poll) ENTRY(cloudabi_sys_poll_fd) str x6, [sp, #-8] mov w8, #38 svc #0 ldr x2, [sp, #-8] b.cs 1f str x0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_poll_fd) ENTRY(cloudabi_sys_proc_exec) mov w8, #39 svc #0 ret END(cloudabi_sys_proc_exec) ENTRY(cloudabi_sys_proc_exit) mov w8, #40 svc #0 END(cloudabi_sys_proc_exit) ENTRY(cloudabi_sys_proc_fork) stp x0, x1, [sp, #-16] mov w8, #41 svc #0 ldp x2, x3, [sp, #-16] b.cs 1f str w0, [x2] str w1, [x3] mov w0, wzr 1: ret END(cloudabi_sys_proc_fork) ENTRY(cloudabi_sys_proc_raise) mov w8, #42 svc #0 ret END(cloudabi_sys_proc_raise) ENTRY(cloudabi_sys_random_get) mov w8, #43 svc #0 ret END(cloudabi_sys_random_get) ENTRY(cloudabi_sys_sock_accept) str x2, [sp, #-8] mov w8, #44 svc #0 ldr x2, [sp, #-8] b.cs 1f str w0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_sock_accept) -ENTRY(cloudabi_sys_sock_bind) +ENTRY(cloudabi_sys_sock_recv) mov w8, #45 svc #0 ret -END(cloudabi_sys_sock_bind) - -ENTRY(cloudabi_sys_sock_connect) - mov w8, #46 - svc #0 - ret -END(cloudabi_sys_sock_connect) - -ENTRY(cloudabi_sys_sock_listen) - mov w8, #47 - svc #0 - ret -END(cloudabi_sys_sock_listen) - -ENTRY(cloudabi_sys_sock_recv) - mov w8, #48 - svc #0 - ret END(cloudabi_sys_sock_recv) ENTRY(cloudabi_sys_sock_send) - mov w8, #49 + mov w8, #46 svc #0 ret END(cloudabi_sys_sock_send) ENTRY(cloudabi_sys_sock_shutdown) - mov w8, #50 + mov w8, #47 svc #0 ret END(cloudabi_sys_sock_shutdown) ENTRY(cloudabi_sys_sock_stat_get) - mov w8, #51 + mov w8, #48 svc #0 ret END(cloudabi_sys_sock_stat_get) ENTRY(cloudabi_sys_thread_create) str x1, [sp, #-8] - mov w8, #52 + mov w8, #49 svc #0 ldr x2, [sp, #-8] b.cs 1f str w0, [x2] mov w0, wzr 1: ret END(cloudabi_sys_thread_create) ENTRY(cloudabi_sys_thread_exit) - mov w8, #53 + mov w8, #50 svc #0 END(cloudabi_sys_thread_exit) ENTRY(cloudabi_sys_thread_yield) - mov w8, #54 + mov w8, #51 svc #0 ret END(cloudabi_sys_thread_yield) Index: head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S =================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S (revision 322885) @@ -1,439 +1,421 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #define ENTRY(name) \ .text; \ .p2align 2; \ .global name; \ .type name, %function; \ name: #define END(name) .size name, . - name ENTRY(cloudabi_sys_clock_res_get) str r1, [sp, #-4] mov ip, #0 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2, 0] strcc r1, [r2, 4] movcc r0, $0 bx lr END(cloudabi_sys_clock_res_get) ENTRY(cloudabi_sys_clock_time_get) mov ip, #1 swi 0 ldrcc r2, [sp, #0] strcc r0, [r2, 0] strcc r1, [r2, 4] movcc r0, $0 bx lr END(cloudabi_sys_clock_time_get) ENTRY(cloudabi_sys_condvar_signal) mov ip, #2 swi 0 bx lr END(cloudabi_sys_condvar_signal) ENTRY(cloudabi_sys_fd_close) mov ip, #3 swi 0 bx lr END(cloudabi_sys_fd_close) ENTRY(cloudabi_sys_fd_create1) str r1, [sp, #-4] mov ip, #4 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_create1) ENTRY(cloudabi_sys_fd_create2) str r1, [sp, #-4] str r2, [sp, #-8] mov ip, #5 swi 0 ldrcc r2, [sp, #-4] ldrcc r3, [sp, #-8] strcc r0, [r2] strcc r1, [r3] movcc r0, $0 bx lr END(cloudabi_sys_fd_create2) ENTRY(cloudabi_sys_fd_datasync) mov ip, #6 swi 0 bx lr END(cloudabi_sys_fd_datasync) ENTRY(cloudabi_sys_fd_dup) str r1, [sp, #-4] mov ip, #7 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_dup) ENTRY(cloudabi_sys_fd_pread) mov ip, #8 swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_pread) ENTRY(cloudabi_sys_fd_pwrite) mov ip, #9 swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_pwrite) ENTRY(cloudabi_sys_fd_read) str r3, [sp, #-4] mov ip, #10 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_read) ENTRY(cloudabi_sys_fd_replace) mov ip, #11 swi 0 bx lr END(cloudabi_sys_fd_replace) ENTRY(cloudabi_sys_fd_seek) mov ip, #12 swi 0 ldrcc r2, [sp, #4] strcc r0, [r2, 0] strcc r1, [r2, 4] movcc r0, $0 bx lr END(cloudabi_sys_fd_seek) ENTRY(cloudabi_sys_fd_stat_get) mov ip, #13 swi 0 bx lr END(cloudabi_sys_fd_stat_get) ENTRY(cloudabi_sys_fd_stat_put) mov ip, #14 swi 0 bx lr END(cloudabi_sys_fd_stat_put) ENTRY(cloudabi_sys_fd_sync) mov ip, #15 swi 0 bx lr END(cloudabi_sys_fd_sync) ENTRY(cloudabi_sys_fd_write) str r3, [sp, #-4] mov ip, #16 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_fd_write) ENTRY(cloudabi_sys_file_advise) mov ip, #17 swi 0 bx lr END(cloudabi_sys_file_advise) ENTRY(cloudabi_sys_file_allocate) mov ip, #18 swi 0 bx lr END(cloudabi_sys_file_allocate) ENTRY(cloudabi_sys_file_create) mov ip, #19 swi 0 bx lr END(cloudabi_sys_file_create) ENTRY(cloudabi_sys_file_link) mov ip, #20 swi 0 bx lr END(cloudabi_sys_file_link) ENTRY(cloudabi_sys_file_open) mov ip, #21 swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_file_open) ENTRY(cloudabi_sys_file_readdir) mov ip, #22 swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_file_readdir) ENTRY(cloudabi_sys_file_readlink) mov ip, #23 swi 0 ldrcc r2, [sp, #4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_file_readlink) ENTRY(cloudabi_sys_file_rename) mov ip, #24 swi 0 bx lr END(cloudabi_sys_file_rename) ENTRY(cloudabi_sys_file_stat_fget) mov ip, #25 swi 0 bx lr END(cloudabi_sys_file_stat_fget) ENTRY(cloudabi_sys_file_stat_fput) mov ip, #26 swi 0 bx lr END(cloudabi_sys_file_stat_fput) ENTRY(cloudabi_sys_file_stat_get) mov ip, #27 swi 0 bx lr END(cloudabi_sys_file_stat_get) ENTRY(cloudabi_sys_file_stat_put) mov ip, #28 swi 0 bx lr END(cloudabi_sys_file_stat_put) ENTRY(cloudabi_sys_file_symlink) mov ip, #29 swi 0 bx lr END(cloudabi_sys_file_symlink) ENTRY(cloudabi_sys_file_unlink) mov ip, #30 swi 0 bx lr END(cloudabi_sys_file_unlink) ENTRY(cloudabi_sys_lock_unlock) mov ip, #31 swi 0 bx lr END(cloudabi_sys_lock_unlock) ENTRY(cloudabi_sys_mem_advise) mov ip, #32 swi 0 bx lr END(cloudabi_sys_mem_advise) ENTRY(cloudabi_sys_mem_map) mov ip, #33 swi 0 ldrcc r2, [sp, #16] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_mem_map) ENTRY(cloudabi_sys_mem_protect) mov ip, #34 swi 0 bx lr END(cloudabi_sys_mem_protect) ENTRY(cloudabi_sys_mem_sync) mov ip, #35 swi 0 bx lr END(cloudabi_sys_mem_sync) ENTRY(cloudabi_sys_mem_unmap) mov ip, #36 swi 0 bx lr END(cloudabi_sys_mem_unmap) ENTRY(cloudabi_sys_poll) str r3, [sp, #-4] mov ip, #37 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_poll) ENTRY(cloudabi_sys_poll_fd) mov ip, #38 swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_poll_fd) ENTRY(cloudabi_sys_proc_exec) mov ip, #39 swi 0 bx lr END(cloudabi_sys_proc_exec) ENTRY(cloudabi_sys_proc_exit) mov ip, #40 swi 0 END(cloudabi_sys_proc_exit) ENTRY(cloudabi_sys_proc_fork) str r0, [sp, #-4] str r1, [sp, #-8] mov ip, #41 swi 0 ldrcc r2, [sp, #-4] ldrcc r3, [sp, #-8] strcc r0, [r2] strcc r1, [r3] movcc r0, $0 bx lr END(cloudabi_sys_proc_fork) ENTRY(cloudabi_sys_proc_raise) mov ip, #42 swi 0 bx lr END(cloudabi_sys_proc_raise) ENTRY(cloudabi_sys_random_get) mov ip, #43 swi 0 bx lr END(cloudabi_sys_random_get) ENTRY(cloudabi_sys_sock_accept) str r2, [sp, #-4] mov ip, #44 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_sock_accept) -ENTRY(cloudabi_sys_sock_bind) +ENTRY(cloudabi_sys_sock_recv) mov ip, #45 swi 0 bx lr -END(cloudabi_sys_sock_bind) - -ENTRY(cloudabi_sys_sock_connect) - mov ip, #46 - swi 0 - bx lr -END(cloudabi_sys_sock_connect) - -ENTRY(cloudabi_sys_sock_listen) - mov ip, #47 - swi 0 - bx lr -END(cloudabi_sys_sock_listen) - -ENTRY(cloudabi_sys_sock_recv) - mov ip, #48 - swi 0 - bx lr END(cloudabi_sys_sock_recv) ENTRY(cloudabi_sys_sock_send) - mov ip, #49 + mov ip, #46 swi 0 bx lr END(cloudabi_sys_sock_send) ENTRY(cloudabi_sys_sock_shutdown) - mov ip, #50 + mov ip, #47 swi 0 bx lr END(cloudabi_sys_sock_shutdown) ENTRY(cloudabi_sys_sock_stat_get) - mov ip, #51 + mov ip, #48 swi 0 bx lr END(cloudabi_sys_sock_stat_get) ENTRY(cloudabi_sys_thread_create) str r1, [sp, #-4] - mov ip, #52 + mov ip, #49 swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] movcc r0, $0 bx lr END(cloudabi_sys_thread_create) ENTRY(cloudabi_sys_thread_exit) - mov ip, #53 + mov ip, #50 swi 0 END(cloudabi_sys_thread_exit) ENTRY(cloudabi_sys_thread_yield) - mov ip, #54 + mov ip, #51 swi 0 bx lr END(cloudabi_sys_thread_yield) Index: head/sys/contrib/cloudabi/cloudabi_vdso_i686.S =================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_i686.S (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_vdso_i686.S (revision 322885) @@ -1,465 +1,447 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #define ENTRY(name) \ .text; \ .p2align 2, 0x90; \ .global name; \ .type name, @function; \ name: #define END(name) .size name, . - name ENTRY(cloudabi_sys_clock_res_get) mov $0, %eax int $0x80 jc 1f mov 8(%esp), %ecx mov %eax, 0(%ecx) mov %edx, 4(%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_clock_res_get) ENTRY(cloudabi_sys_clock_time_get) mov $1, %eax int $0x80 jc 1f mov 16(%esp), %ecx mov %eax, 0(%ecx) mov %edx, 4(%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_clock_time_get) ENTRY(cloudabi_sys_condvar_signal) mov $2, %eax int $0x80 ret END(cloudabi_sys_condvar_signal) ENTRY(cloudabi_sys_fd_close) mov $3, %eax int $0x80 ret END(cloudabi_sys_fd_close) ENTRY(cloudabi_sys_fd_create1) mov $4, %eax int $0x80 jc 1f mov 8(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_create1) ENTRY(cloudabi_sys_fd_create2) mov $5, %eax int $0x80 jc 1f mov 8(%esp), %ecx mov %eax, (%ecx) mov 12(%esp), %ecx mov %edx, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_create2) ENTRY(cloudabi_sys_fd_datasync) mov $6, %eax int $0x80 ret END(cloudabi_sys_fd_datasync) ENTRY(cloudabi_sys_fd_dup) mov $7, %eax int $0x80 jc 1f mov 8(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_dup) ENTRY(cloudabi_sys_fd_pread) mov $8, %eax int $0x80 jc 1f mov 24(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_pread) ENTRY(cloudabi_sys_fd_pwrite) mov $9, %eax int $0x80 jc 1f mov 24(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_pwrite) ENTRY(cloudabi_sys_fd_read) mov $10, %eax int $0x80 jc 1f mov 16(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_read) ENTRY(cloudabi_sys_fd_replace) mov $11, %eax int $0x80 ret END(cloudabi_sys_fd_replace) ENTRY(cloudabi_sys_fd_seek) mov $12, %eax int $0x80 jc 1f mov 20(%esp), %ecx mov %eax, 0(%ecx) mov %edx, 4(%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_seek) ENTRY(cloudabi_sys_fd_stat_get) mov $13, %eax int $0x80 ret END(cloudabi_sys_fd_stat_get) ENTRY(cloudabi_sys_fd_stat_put) mov $14, %eax int $0x80 ret END(cloudabi_sys_fd_stat_put) ENTRY(cloudabi_sys_fd_sync) mov $15, %eax int $0x80 ret END(cloudabi_sys_fd_sync) ENTRY(cloudabi_sys_fd_write) mov $16, %eax int $0x80 jc 1f mov 16(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_write) ENTRY(cloudabi_sys_file_advise) mov $17, %eax int $0x80 ret END(cloudabi_sys_file_advise) ENTRY(cloudabi_sys_file_allocate) mov $18, %eax int $0x80 ret END(cloudabi_sys_file_allocate) ENTRY(cloudabi_sys_file_create) mov $19, %eax int $0x80 ret END(cloudabi_sys_file_create) ENTRY(cloudabi_sys_file_link) mov $20, %eax int $0x80 ret END(cloudabi_sys_file_link) ENTRY(cloudabi_sys_file_open) mov $21, %eax int $0x80 jc 1f mov 28(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_file_open) ENTRY(cloudabi_sys_file_readdir) mov $22, %eax int $0x80 jc 1f mov 24(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_file_readdir) ENTRY(cloudabi_sys_file_readlink) mov $23, %eax int $0x80 jc 1f mov 24(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_file_readlink) ENTRY(cloudabi_sys_file_rename) mov $24, %eax int $0x80 ret END(cloudabi_sys_file_rename) ENTRY(cloudabi_sys_file_stat_fget) mov $25, %eax int $0x80 ret END(cloudabi_sys_file_stat_fget) ENTRY(cloudabi_sys_file_stat_fput) mov $26, %eax int $0x80 ret END(cloudabi_sys_file_stat_fput) ENTRY(cloudabi_sys_file_stat_get) mov $27, %eax int $0x80 ret END(cloudabi_sys_file_stat_get) ENTRY(cloudabi_sys_file_stat_put) mov $28, %eax int $0x80 ret END(cloudabi_sys_file_stat_put) ENTRY(cloudabi_sys_file_symlink) mov $29, %eax int $0x80 ret END(cloudabi_sys_file_symlink) ENTRY(cloudabi_sys_file_unlink) mov $30, %eax int $0x80 ret END(cloudabi_sys_file_unlink) ENTRY(cloudabi_sys_lock_unlock) mov $31, %eax int $0x80 ret END(cloudabi_sys_lock_unlock) ENTRY(cloudabi_sys_mem_advise) mov $32, %eax int $0x80 ret END(cloudabi_sys_mem_advise) ENTRY(cloudabi_sys_mem_map) mov $33, %eax int $0x80 jc 1f mov 32(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_mem_map) ENTRY(cloudabi_sys_mem_protect) mov $34, %eax int $0x80 ret END(cloudabi_sys_mem_protect) ENTRY(cloudabi_sys_mem_sync) mov $35, %eax int $0x80 ret END(cloudabi_sys_mem_sync) ENTRY(cloudabi_sys_mem_unmap) mov $36, %eax int $0x80 ret END(cloudabi_sys_mem_unmap) ENTRY(cloudabi_sys_poll) mov $37, %eax int $0x80 jc 1f mov 16(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_poll) ENTRY(cloudabi_sys_poll_fd) mov $38, %eax int $0x80 jc 1f mov 28(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_poll_fd) ENTRY(cloudabi_sys_proc_exec) mov $39, %eax int $0x80 ret END(cloudabi_sys_proc_exec) ENTRY(cloudabi_sys_proc_exit) mov $40, %eax int $0x80 END(cloudabi_sys_proc_exit) ENTRY(cloudabi_sys_proc_fork) mov $41, %eax int $0x80 jc 1f mov 4(%esp), %ecx mov %eax, (%ecx) mov 8(%esp), %ecx mov %edx, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_proc_fork) ENTRY(cloudabi_sys_proc_raise) mov $42, %eax int $0x80 ret END(cloudabi_sys_proc_raise) ENTRY(cloudabi_sys_random_get) mov $43, %eax int $0x80 ret END(cloudabi_sys_random_get) ENTRY(cloudabi_sys_sock_accept) mov $44, %eax int $0x80 jc 1f mov 12(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_sock_accept) -ENTRY(cloudabi_sys_sock_bind) +ENTRY(cloudabi_sys_sock_recv) mov $45, %eax int $0x80 ret -END(cloudabi_sys_sock_bind) - -ENTRY(cloudabi_sys_sock_connect) - mov $46, %eax - int $0x80 - ret -END(cloudabi_sys_sock_connect) - -ENTRY(cloudabi_sys_sock_listen) - mov $47, %eax - int $0x80 - ret -END(cloudabi_sys_sock_listen) - -ENTRY(cloudabi_sys_sock_recv) - mov $48, %eax - int $0x80 - ret END(cloudabi_sys_sock_recv) ENTRY(cloudabi_sys_sock_send) - mov $49, %eax + mov $46, %eax int $0x80 ret END(cloudabi_sys_sock_send) ENTRY(cloudabi_sys_sock_shutdown) - mov $50, %eax + mov $47, %eax int $0x80 ret END(cloudabi_sys_sock_shutdown) ENTRY(cloudabi_sys_sock_stat_get) - mov $51, %eax + mov $48, %eax int $0x80 ret END(cloudabi_sys_sock_stat_get) ENTRY(cloudabi_sys_thread_create) - mov $52, %eax + mov $49, %eax int $0x80 jc 1f mov 8(%esp), %ecx mov %eax, (%ecx) xor %eax, %eax 1: ret END(cloudabi_sys_thread_create) ENTRY(cloudabi_sys_thread_exit) - mov $53, %eax + mov $50, %eax int $0x80 END(cloudabi_sys_thread_exit) ENTRY(cloudabi_sys_thread_yield) - mov $54, %eax + mov $51, %eax int $0x80 ret END(cloudabi_sys_thread_yield) Index: head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S =================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S (revision 322885) @@ -1,1189 +1,1132 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #define ENTRY(name) \ .text; \ .p2align 2, 0x90; \ .global name; \ .type name, @function; \ name: #define END(name) .size name, . - name ENTRY(cloudabi_sys_clock_res_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $0, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 12(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) mov -12(%ebp), %edx mov %edx, 4(%ecx) 1: pop %ebp ret END(cloudabi_sys_clock_res_get) ENTRY(cloudabi_sys_clock_time_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) mov 16(%ebp), %ecx mov %ecx, -4(%ebp) mov $1, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 20(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) mov -12(%ebp), %edx mov %edx, 4(%ecx) 1: pop %ebp ret END(cloudabi_sys_clock_time_get) ENTRY(cloudabi_sys_condvar_signal) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $2, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_condvar_signal) ENTRY(cloudabi_sys_fd_close) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $3, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_close) ENTRY(cloudabi_sys_fd_create1) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $4, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 12(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_create1) ENTRY(cloudabi_sys_fd_create2) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $5, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 12(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) mov 16(%ebp), %ecx mov -8(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_create2) ENTRY(cloudabi_sys_fd_datasync) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $6, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_datasync) ENTRY(cloudabi_sys_fd_dup) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $7, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 12(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_dup) ENTRY(cloudabi_sys_fd_pread) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 16(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov 24(%ebp), %ecx mov %ecx, -4(%ebp) mov $8, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 test %eax, %eax jnz 1f mov 28(%ebp), %ecx mov -32(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_pread) ENTRY(cloudabi_sys_fd_pwrite) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 16(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov 24(%ebp), %ecx mov %ecx, -4(%ebp) mov $9, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 test %eax, %eax jnz 1f mov 28(%ebp), %ecx mov -32(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_pwrite) ENTRY(cloudabi_sys_fd_read) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $10, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 test %eax, %eax jnz 1f mov 20(%ebp), %ecx mov -24(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_read) ENTRY(cloudabi_sys_fd_replace) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) mov $11, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_replace) ENTRY(cloudabi_sys_fd_seek) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) mov 16(%ebp), %ecx mov %ecx, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov $12, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 test %eax, %eax jnz 1f mov 24(%ebp), %ecx mov -24(%ebp), %edx mov %edx, 0(%ecx) mov -20(%ebp), %edx mov %edx, 4(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_seek) ENTRY(cloudabi_sys_fd_stat_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $13, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_stat_get) ENTRY(cloudabi_sys_fd_stat_put) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $14, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_stat_put) ENTRY(cloudabi_sys_fd_sync) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $15, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_fd_sync) ENTRY(cloudabi_sys_fd_write) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $16, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 test %eax, %eax jnz 1f mov 20(%ebp), %ecx mov -24(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_fd_write) ENTRY(cloudabi_sys_file_advise) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) mov 16(%ebp), %ecx mov %ecx, -20(%ebp) mov 20(%ebp), %ecx mov %ecx, -16(%ebp) mov 24(%ebp), %ecx mov %ecx, -12(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) mov $17, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_advise) ENTRY(cloudabi_sys_file_allocate) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) mov 16(%ebp), %ecx mov %ecx, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov 24(%ebp), %ecx mov %ecx, -4(%ebp) mov $18, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_allocate) ENTRY(cloudabi_sys_file_create) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 16(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov $19, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_create) ENTRY(cloudabi_sys_file_link) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -48(%ebp) mov 12(%ebp), %ecx mov %ecx, -44(%ebp) mov 16(%ebp), %ecx mov %ecx, -40(%ebp) movl $0, -36(%ebp) mov 20(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 24(%ebp), %ecx mov %ecx, -24(%ebp) mov 28(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 32(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $20, %eax mov %ebp, %ecx sub $48, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_link) ENTRY(cloudabi_sys_file_open) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -40(%ebp) mov 12(%ebp), %ecx mov %ecx, -36(%ebp) mov 16(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 20(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 24(%ebp), %ecx mov %ecx, -16(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $21, %eax mov %ebp, %ecx sub $40, %ecx int $0x80 test %eax, %eax jnz 1f mov 32(%ebp), %ecx mov -40(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_file_open) ENTRY(cloudabi_sys_file_readdir) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 16(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov 24(%ebp), %ecx mov %ecx, -4(%ebp) mov $22, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 test %eax, %eax jnz 1f mov 28(%ebp), %ecx mov -32(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_file_readdir) ENTRY(cloudabi_sys_file_readlink) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -40(%ebp) mov 12(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 16(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 20(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 24(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $23, %eax mov %ebp, %ecx sub $40, %ecx int $0x80 test %eax, %eax jnz 1f mov 28(%ebp), %ecx mov -40(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_file_readlink) ENTRY(cloudabi_sys_file_rename) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -48(%ebp) mov 12(%ebp), %ecx mov %ecx, -40(%ebp) movl $0, -36(%ebp) mov 16(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 20(%ebp), %ecx mov %ecx, -24(%ebp) mov 24(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $24, %eax mov %ebp, %ecx sub $48, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_rename) ENTRY(cloudabi_sys_file_stat_fget) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $25, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_stat_fget) ENTRY(cloudabi_sys_file_stat_fput) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $26, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_stat_fput) ENTRY(cloudabi_sys_file_stat_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -28(%ebp) mov 16(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 20(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 24(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $27, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_stat_get) ENTRY(cloudabi_sys_file_stat_put) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -40(%ebp) mov 12(%ebp), %ecx mov %ecx, -36(%ebp) mov 16(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 20(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 24(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) mov $28, %eax mov %ebp, %ecx sub $40, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_stat_put) ENTRY(cloudabi_sys_file_symlink) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -40(%ebp) movl $0, -36(%ebp) mov 12(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 16(%ebp), %ecx mov %ecx, -24(%ebp) mov 20(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 24(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $29, %eax mov %ebp, %ecx sub $40, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_symlink) ENTRY(cloudabi_sys_file_unlink) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -32(%ebp) mov 12(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 16(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 20(%ebp), %ecx mov %ecx, -8(%ebp) mov $30, %eax mov %ebp, %ecx sub $32, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_file_unlink) ENTRY(cloudabi_sys_lock_unlock) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) mov $31, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_lock_unlock) ENTRY(cloudabi_sys_mem_advise) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $32, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_mem_advise) ENTRY(cloudabi_sys_mem_map) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -48(%ebp) movl $0, -44(%ebp) mov 12(%ebp), %ecx mov %ecx, -40(%ebp) movl $0, -36(%ebp) mov 16(%ebp), %ecx mov %ecx, -32(%ebp) mov 20(%ebp), %ecx mov %ecx, -24(%ebp) mov 24(%ebp), %ecx mov %ecx, -16(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) mov 32(%ebp), %ecx mov %ecx, -4(%ebp) mov $33, %eax mov %ebp, %ecx sub $48, %ecx int $0x80 test %eax, %eax jnz 1f mov 36(%ebp), %ecx mov -48(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_mem_map) ENTRY(cloudabi_sys_mem_protect) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $34, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_mem_protect) ENTRY(cloudabi_sys_mem_sync) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) mov $35, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_mem_sync) ENTRY(cloudabi_sys_mem_unmap) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $36, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_mem_unmap) ENTRY(cloudabi_sys_poll) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $37, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 test %eax, %eax jnz 1f mov 20(%ebp), %ecx mov -24(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_poll) ENTRY(cloudabi_sys_poll_fd) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -48(%ebp) mov 12(%ebp), %ecx mov %ecx, -40(%ebp) movl $0, -36(%ebp) mov 16(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 20(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 24(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 28(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $38, %eax mov %ebp, %ecx sub $48, %ecx int $0x80 test %eax, %eax jnz 1f mov 32(%ebp), %ecx mov -48(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_poll_fd) ENTRY(cloudabi_sys_proc_exec) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -40(%ebp) mov 12(%ebp), %ecx mov %ecx, -32(%ebp) movl $0, -28(%ebp) mov 16(%ebp), %ecx mov %ecx, -24(%ebp) movl $0, -20(%ebp) mov 20(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 24(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $39, %eax mov %ebp, %ecx sub $40, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_proc_exec) ENTRY(cloudabi_sys_proc_exit) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $40, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 END(cloudabi_sys_proc_exit) ENTRY(cloudabi_sys_proc_fork) push %ebp mov %esp, %ebp mov $41, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 8(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) mov 12(%ebp), %ecx mov -8(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_proc_fork) ENTRY(cloudabi_sys_proc_raise) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov $42, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_proc_raise) ENTRY(cloudabi_sys_random_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $43, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_random_get) ENTRY(cloudabi_sys_sock_accept) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) mov $44, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 16(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_sock_accept) -ENTRY(cloudabi_sys_sock_bind) - push %ebp - mov %esp, %ebp - mov 8(%ebp), %ecx - mov %ecx, -32(%ebp) - mov 12(%ebp), %ecx - mov %ecx, -24(%ebp) - mov 16(%ebp), %ecx - mov %ecx, -16(%ebp) - movl $0, -12(%ebp) - mov 20(%ebp), %ecx - mov %ecx, -8(%ebp) - movl $0, -4(%ebp) - mov $45, %eax - mov %ebp, %ecx - sub $32, %ecx - int $0x80 - pop %ebp - ret -END(cloudabi_sys_sock_bind) - -ENTRY(cloudabi_sys_sock_connect) - push %ebp - mov %esp, %ebp - mov 8(%ebp), %ecx - mov %ecx, -32(%ebp) - mov 12(%ebp), %ecx - mov %ecx, -24(%ebp) - mov 16(%ebp), %ecx - mov %ecx, -16(%ebp) - movl $0, -12(%ebp) - mov 20(%ebp), %ecx - mov %ecx, -8(%ebp) - movl $0, -4(%ebp) - mov $46, %eax - mov %ebp, %ecx - sub $32, %ecx - int $0x80 - pop %ebp - ret -END(cloudabi_sys_sock_connect) - -ENTRY(cloudabi_sys_sock_listen) - push %ebp - mov %esp, %ebp - mov 8(%ebp), %ecx - mov %ecx, -16(%ebp) - mov 12(%ebp), %ecx - mov %ecx, -8(%ebp) - mov $47, %eax - mov %ebp, %ecx - sub $16, %ecx - int $0x80 - pop %ebp - ret -END(cloudabi_sys_sock_listen) - ENTRY(cloudabi_sys_sock_recv) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) - mov $48, %eax + mov $45, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_sock_recv) ENTRY(cloudabi_sys_sock_send) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) movl $0, -4(%ebp) - mov $49, %eax + mov $46, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_sock_send) ENTRY(cloudabi_sys_sock_shutdown) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) - mov $50, %eax + mov $47, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_sock_shutdown) ENTRY(cloudabi_sys_sock_stat_get) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -24(%ebp) mov 12(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 16(%ebp), %ecx mov %ecx, -8(%ebp) - mov $51, %eax + mov $48, %eax mov %ebp, %ecx sub $24, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_sock_stat_get) ENTRY(cloudabi_sys_thread_create) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) - mov $52, %eax + mov $49, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 test %eax, %eax jnz 1f mov 12(%ebp), %ecx mov -16(%ebp), %edx mov %edx, 0(%ecx) 1: pop %ebp ret END(cloudabi_sys_thread_create) ENTRY(cloudabi_sys_thread_exit) push %ebp mov %esp, %ebp mov 8(%ebp), %ecx mov %ecx, -16(%ebp) movl $0, -12(%ebp) mov 12(%ebp), %ecx mov %ecx, -8(%ebp) - mov $53, %eax + mov $50, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 END(cloudabi_sys_thread_exit) ENTRY(cloudabi_sys_thread_yield) push %ebp mov %esp, %ebp - mov $54, %eax + mov $51, %eax mov %ebp, %ecx sub $16, %ecx int $0x80 pop %ebp ret END(cloudabi_sys_thread_yield) Index: head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S =================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S (revision 322884) +++ head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S (revision 322885) @@ -1,499 +1,479 @@ // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // This file is automatically generated. Do not edit. // // Source: https://github.com/NuxiNL/cloudabi #define ENTRY(name) \ .text; \ .p2align 4, 0x90; \ .global name; \ .type name, @function; \ name: #define END(name) .size name, . - name ENTRY(cloudabi_sys_clock_res_get) push %rsi mov $0, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_clock_res_get) ENTRY(cloudabi_sys_clock_time_get) push %rdx mov $1, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_clock_time_get) ENTRY(cloudabi_sys_condvar_signal) mov $2, %eax syscall ret END(cloudabi_sys_condvar_signal) ENTRY(cloudabi_sys_fd_close) mov $3, %eax syscall ret END(cloudabi_sys_fd_close) ENTRY(cloudabi_sys_fd_create1) push %rsi mov $4, %eax syscall pop %rcx jc 1f mov %eax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_create1) ENTRY(cloudabi_sys_fd_create2) push %rsi push %rdx mov $5, %eax syscall pop %rsi pop %rcx jc 1f mov %eax, (%rcx) mov %edx, (%rsi) xor %eax, %eax 1: ret END(cloudabi_sys_fd_create2) ENTRY(cloudabi_sys_fd_datasync) mov $6, %eax syscall ret END(cloudabi_sys_fd_datasync) ENTRY(cloudabi_sys_fd_dup) push %rsi mov $7, %eax syscall pop %rcx jc 1f mov %eax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_dup) ENTRY(cloudabi_sys_fd_pread) mov %rcx, %r10 push %r8 mov $8, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_pread) ENTRY(cloudabi_sys_fd_pwrite) mov %rcx, %r10 push %r8 mov $9, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_pwrite) ENTRY(cloudabi_sys_fd_read) push %rcx mov $10, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_read) ENTRY(cloudabi_sys_fd_replace) mov $11, %eax syscall ret END(cloudabi_sys_fd_replace) ENTRY(cloudabi_sys_fd_seek) push %rcx mov $12, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_seek) ENTRY(cloudabi_sys_fd_stat_get) mov $13, %eax syscall ret END(cloudabi_sys_fd_stat_get) ENTRY(cloudabi_sys_fd_stat_put) mov $14, %eax syscall ret END(cloudabi_sys_fd_stat_put) ENTRY(cloudabi_sys_fd_sync) mov $15, %eax syscall ret END(cloudabi_sys_fd_sync) ENTRY(cloudabi_sys_fd_write) push %rcx mov $16, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_fd_write) ENTRY(cloudabi_sys_file_advise) mov %rcx, %r10 mov $17, %eax syscall ret END(cloudabi_sys_file_advise) ENTRY(cloudabi_sys_file_allocate) mov $18, %eax syscall ret END(cloudabi_sys_file_allocate) ENTRY(cloudabi_sys_file_create) mov %rcx, %r10 mov $19, %eax syscall ret END(cloudabi_sys_file_create) ENTRY(cloudabi_sys_file_link) mov %rcx, %r10 mov $20, %eax syscall ret END(cloudabi_sys_file_link) ENTRY(cloudabi_sys_file_open) mov %rcx, %r10 push %r9 mov $21, %eax syscall pop %rcx jc 1f mov %eax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_file_open) ENTRY(cloudabi_sys_file_readdir) mov %rcx, %r10 push %r8 mov $22, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_file_readdir) ENTRY(cloudabi_sys_file_readlink) mov %rcx, %r10 push %r9 mov $23, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_file_readlink) ENTRY(cloudabi_sys_file_rename) mov %rcx, %r10 mov $24, %eax syscall ret END(cloudabi_sys_file_rename) ENTRY(cloudabi_sys_file_stat_fget) mov $25, %eax syscall ret END(cloudabi_sys_file_stat_fget) ENTRY(cloudabi_sys_file_stat_fput) mov $26, %eax syscall ret END(cloudabi_sys_file_stat_fput) ENTRY(cloudabi_sys_file_stat_get) mov %rcx, %r10 mov $27, %eax syscall ret END(cloudabi_sys_file_stat_get) ENTRY(cloudabi_sys_file_stat_put) mov %rcx, %r10 mov $28, %eax syscall ret END(cloudabi_sys_file_stat_put) ENTRY(cloudabi_sys_file_symlink) mov %rcx, %r10 mov $29, %eax syscall ret END(cloudabi_sys_file_symlink) ENTRY(cloudabi_sys_file_unlink) mov %rcx, %r10 mov $30, %eax syscall ret END(cloudabi_sys_file_unlink) ENTRY(cloudabi_sys_lock_unlock) mov $31, %eax syscall ret END(cloudabi_sys_lock_unlock) ENTRY(cloudabi_sys_mem_advise) mov $32, %eax syscall ret END(cloudabi_sys_mem_advise) ENTRY(cloudabi_sys_mem_map) mov %rcx, %r10 mov $33, %eax syscall jc 1f mov 8(%rsp), %rcx mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_mem_map) ENTRY(cloudabi_sys_mem_protect) mov $34, %eax syscall ret END(cloudabi_sys_mem_protect) ENTRY(cloudabi_sys_mem_sync) mov $35, %eax syscall ret END(cloudabi_sys_mem_sync) ENTRY(cloudabi_sys_mem_unmap) mov $36, %eax syscall ret END(cloudabi_sys_mem_unmap) ENTRY(cloudabi_sys_poll) push %rcx mov $37, %eax syscall pop %rcx jc 1f mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_poll) ENTRY(cloudabi_sys_poll_fd) mov %rcx, %r10 mov $38, %eax syscall jc 1f mov 8(%rsp), %rcx mov %rax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_poll_fd) ENTRY(cloudabi_sys_proc_exec) mov %rcx, %r10 mov $39, %eax syscall ret END(cloudabi_sys_proc_exec) ENTRY(cloudabi_sys_proc_exit) mov $40, %eax syscall END(cloudabi_sys_proc_exit) ENTRY(cloudabi_sys_proc_fork) push %rdi push %rsi mov $41, %eax syscall pop %rsi pop %rcx jc 1f mov %eax, (%rcx) mov %edx, (%rsi) xor %eax, %eax 1: ret END(cloudabi_sys_proc_fork) ENTRY(cloudabi_sys_proc_raise) mov $42, %eax syscall ret END(cloudabi_sys_proc_raise) ENTRY(cloudabi_sys_random_get) mov $43, %eax syscall ret END(cloudabi_sys_random_get) ENTRY(cloudabi_sys_sock_accept) push %rdx mov $44, %eax syscall pop %rcx jc 1f mov %eax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_sock_accept) -ENTRY(cloudabi_sys_sock_bind) - mov %rcx, %r10 +ENTRY(cloudabi_sys_sock_recv) mov $45, %eax syscall ret -END(cloudabi_sys_sock_bind) - -ENTRY(cloudabi_sys_sock_connect) - mov %rcx, %r10 - mov $46, %eax - syscall - ret -END(cloudabi_sys_sock_connect) - -ENTRY(cloudabi_sys_sock_listen) - mov $47, %eax - syscall - ret -END(cloudabi_sys_sock_listen) - -ENTRY(cloudabi_sys_sock_recv) - mov $48, %eax - syscall - ret END(cloudabi_sys_sock_recv) ENTRY(cloudabi_sys_sock_send) - mov $49, %eax + mov $46, %eax syscall ret END(cloudabi_sys_sock_send) ENTRY(cloudabi_sys_sock_shutdown) - mov $50, %eax + mov $47, %eax syscall ret END(cloudabi_sys_sock_shutdown) ENTRY(cloudabi_sys_sock_stat_get) - mov $51, %eax + mov $48, %eax syscall ret END(cloudabi_sys_sock_stat_get) ENTRY(cloudabi_sys_thread_create) push %rsi - mov $52, %eax + mov $49, %eax syscall pop %rcx jc 1f mov %eax, (%rcx) xor %eax, %eax 1: ret END(cloudabi_sys_thread_create) ENTRY(cloudabi_sys_thread_exit) - mov $53, %eax + mov $50, %eax syscall END(cloudabi_sys_thread_exit) ENTRY(cloudabi_sys_thread_yield) - mov $54, %eax + mov $51, %eax syscall ret END(cloudabi_sys_thread_yield) Index: head/sys/contrib/cloudabi/syscalls32.master =================================================================== --- head/sys/contrib/cloudabi/syscalls32.master (revision 322884) +++ head/sys/contrib/cloudabi/syscalls32.master (revision 322885) @@ -1,307 +1,291 @@ $FreeBSD$ ; Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ; SUCH DAMAGE. ; ; This file is automatically generated. Do not edit. ; ; Source: https://github.com/NuxiNL/cloudabi #include #include #include #include 0 AUE_NULL STD { cloudabi_timestamp_t \ cloudabi_sys_clock_res_get( \ cloudabi_clockid_t clock_id); } 1 AUE_NULL STD { cloudabi_timestamp_t \ cloudabi_sys_clock_time_get( \ cloudabi_clockid_t clock_id, \ cloudabi_timestamp_t precision); } 2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \ cloudabi_condvar_t *condvar, \ cloudabi_scope_t scope, \ cloudabi_nthreads_t nwaiters); } 3 AUE_NULL STD { void cloudabi_sys_fd_close( \ cloudabi_fd_t fd); } 4 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_create1( \ cloudabi_filetype_t type); } 5 AUE_NULL STD { void cloudabi_sys_fd_create2( \ cloudabi_filetype_t type); } 6 AUE_NULL STD { void cloudabi_sys_fd_datasync( \ cloudabi_fd_t fd); } 7 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_dup( \ cloudabi_fd_t from); } 8 AUE_NULL STD { size_t cloudabi32_sys_fd_pread( \ cloudabi_fd_t fd, \ const cloudabi32_iovec_t *iovs, \ size_t iovs_len, \ cloudabi_filesize_t offset); } 9 AUE_NULL STD { size_t cloudabi32_sys_fd_pwrite( \ cloudabi_fd_t fd, \ const cloudabi32_ciovec_t *iovs, \ size_t iovs_len, \ cloudabi_filesize_t offset); } 10 AUE_NULL STD { size_t cloudabi32_sys_fd_read( \ cloudabi_fd_t fd, \ const cloudabi32_iovec_t *iovs, \ size_t iovs_len); } 11 AUE_NULL STD { void cloudabi_sys_fd_replace( \ cloudabi_fd_t from, \ cloudabi_fd_t to); } 12 AUE_NULL STD { cloudabi_filesize_t \ cloudabi_sys_fd_seek( \ cloudabi_fd_t fd, \ cloudabi_filedelta_t offset, \ cloudabi_whence_t whence); } 13 AUE_NULL STD { void cloudabi_sys_fd_stat_get( \ cloudabi_fd_t fd, \ cloudabi_fdstat_t *buf); } 14 AUE_NULL STD { void cloudabi_sys_fd_stat_put( \ cloudabi_fd_t fd, \ const cloudabi_fdstat_t *buf, \ cloudabi_fdsflags_t flags); } 15 AUE_NULL STD { void cloudabi_sys_fd_sync( \ cloudabi_fd_t fd); } 16 AUE_NULL STD { size_t cloudabi32_sys_fd_write( \ cloudabi_fd_t fd, \ const cloudabi32_ciovec_t *iovs, \ size_t iovs_len); } 17 AUE_NULL STD { void cloudabi_sys_file_advise( \ cloudabi_fd_t fd, \ cloudabi_filesize_t offset, \ cloudabi_filesize_t len, \ cloudabi_advice_t advice); } 18 AUE_NULL STD { void cloudabi_sys_file_allocate( \ cloudabi_fd_t fd, \ cloudabi_filesize_t offset, \ cloudabi_filesize_t len); } 19 AUE_NULL STD { void cloudabi_sys_file_create( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ cloudabi_filetype_t type); } 20 AUE_NULL STD { void cloudabi_sys_file_link( \ cloudabi_lookup_t fd1, \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd2, \ const char *path2, \ size_t path2_len); } 21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \ cloudabi_lookup_t dirfd, \ const char *path, \ size_t path_len, \ cloudabi_oflags_t oflags, \ const cloudabi_fdstat_t *fds); } 22 AUE_NULL STD { size_t cloudabi_sys_file_readdir( \ cloudabi_fd_t fd, \ void *buf, \ size_t buf_len, \ cloudabi_dircookie_t cookie); } 23 AUE_NULL STD { size_t cloudabi_sys_file_readlink( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ char *buf, \ size_t buf_len); } 24 AUE_NULL STD { void cloudabi_sys_file_rename( \ cloudabi_fd_t fd1, \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd2, \ const char *path2, \ size_t path2_len); } 25 AUE_NULL STD { void cloudabi_sys_file_stat_fget( \ cloudabi_fd_t fd, \ cloudabi_filestat_t *buf); } 26 AUE_NULL STD { void cloudabi_sys_file_stat_fput( \ cloudabi_fd_t fd, \ const cloudabi_filestat_t *buf, \ cloudabi_fsflags_t flags); } 27 AUE_NULL STD { void cloudabi_sys_file_stat_get( \ cloudabi_lookup_t fd, \ const char *path, \ size_t path_len, \ cloudabi_filestat_t *buf); } 28 AUE_NULL STD { void cloudabi_sys_file_stat_put( \ cloudabi_lookup_t fd, \ const char *path, \ size_t path_len, \ const cloudabi_filestat_t *buf, \ cloudabi_fsflags_t flags); } 29 AUE_NULL STD { void cloudabi_sys_file_symlink( \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd, \ const char *path2, \ size_t path2_len); } 30 AUE_NULL STD { void cloudabi_sys_file_unlink( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ cloudabi_ulflags_t flags); } 31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \ cloudabi_lock_t *lock, \ cloudabi_scope_t scope); } 32 AUE_NULL STD { void cloudabi_sys_mem_advise( \ void *mapping, \ size_t mapping_len, \ cloudabi_advice_t advice); } 33 AUE_NULL STD { void cloudabi_sys_mem_map( \ void *addr, \ size_t len, \ cloudabi_mprot_t prot, \ cloudabi_mflags_t flags, \ cloudabi_fd_t fd, \ cloudabi_filesize_t off); } 34 AUE_NULL STD { void cloudabi_sys_mem_protect( \ void *mapping, \ size_t mapping_len, \ cloudabi_mprot_t prot); } 35 AUE_NULL STD { void cloudabi_sys_mem_sync( \ void *mapping, \ size_t mapping_len, \ cloudabi_msflags_t flags); } 36 AUE_NULL STD { void cloudabi_sys_mem_unmap( \ void *mapping, \ size_t mapping_len); } 37 AUE_NULL STD { size_t cloudabi32_sys_poll( \ const cloudabi32_subscription_t *in, \ cloudabi32_event_t *out, \ size_t nsubscriptions); } 38 AUE_NULL STD { size_t cloudabi32_sys_poll_fd( \ cloudabi_fd_t fd, \ const cloudabi32_subscription_t *in, \ size_t in_len, \ cloudabi32_event_t *out, \ size_t out_len, \ const cloudabi32_subscription_t *timeout); } 39 AUE_NULL STD { void cloudabi_sys_proc_exec( \ cloudabi_fd_t fd, \ const void *data, \ size_t data_len, \ const cloudabi_fd_t *fds, \ size_t fds_len); } 40 AUE_NULL STD { void cloudabi_sys_proc_exit( \ cloudabi_exitcode_t rval); } 41 AUE_NULL STD { void cloudabi_sys_proc_fork(); } 42 AUE_NULL STD { void cloudabi_sys_proc_raise( \ cloudabi_signal_t sig); } 43 AUE_NULL STD { void cloudabi_sys_random_get( \ void *buf, \ size_t buf_len); } 44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \ cloudabi_fd_t sock, \ void *unused); } -45 AUE_NULL STD { void cloudabi_sys_sock_bind( \ +45 AUE_NULL STD { void cloudabi32_sys_sock_recv( \ cloudabi_fd_t sock, \ - cloudabi_fd_t fd, \ - const char *path, \ - size_t path_len); } - -46 AUE_NULL STD { void cloudabi_sys_sock_connect( \ - cloudabi_fd_t sock, \ - cloudabi_fd_t fd, \ - const char *path, \ - size_t path_len); } - -47 AUE_NULL STD { void cloudabi_sys_sock_listen( \ - cloudabi_fd_t sock, \ - cloudabi_backlog_t backlog); } - -48 AUE_NULL STD { void cloudabi32_sys_sock_recv( \ - cloudabi_fd_t sock, \ const cloudabi32_recv_in_t *in, \ cloudabi32_recv_out_t *out); } -49 AUE_NULL STD { void cloudabi32_sys_sock_send( \ +46 AUE_NULL STD { void cloudabi32_sys_sock_send( \ cloudabi_fd_t sock, \ const cloudabi32_send_in_t *in, \ cloudabi32_send_out_t *out); } -50 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \ +47 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \ cloudabi_fd_t sock, \ cloudabi_sdflags_t how); } -51 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \ +48 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \ cloudabi_fd_t sock, \ cloudabi_sockstat_t *buf, \ cloudabi_ssflags_t flags); } -52 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \ +49 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \ cloudabi32_threadattr_t *attr); } -53 AUE_NULL STD { void cloudabi_sys_thread_exit( \ +50 AUE_NULL STD { void cloudabi_sys_thread_exit( \ cloudabi_lock_t *lock, \ cloudabi_scope_t scope); } -54 AUE_NULL STD { void cloudabi_sys_thread_yield(); } +51 AUE_NULL STD { void cloudabi_sys_thread_yield(); } Index: head/sys/contrib/cloudabi/syscalls64.master =================================================================== --- head/sys/contrib/cloudabi/syscalls64.master (revision 322884) +++ head/sys/contrib/cloudabi/syscalls64.master (revision 322885) @@ -1,307 +1,291 @@ $FreeBSD$ ; Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ; SUCH DAMAGE. ; ; This file is automatically generated. Do not edit. ; ; Source: https://github.com/NuxiNL/cloudabi #include #include #include #include 0 AUE_NULL STD { cloudabi_timestamp_t \ cloudabi_sys_clock_res_get( \ cloudabi_clockid_t clock_id); } 1 AUE_NULL STD { cloudabi_timestamp_t \ cloudabi_sys_clock_time_get( \ cloudabi_clockid_t clock_id, \ cloudabi_timestamp_t precision); } 2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \ cloudabi_condvar_t *condvar, \ cloudabi_scope_t scope, \ cloudabi_nthreads_t nwaiters); } 3 AUE_NULL STD { void cloudabi_sys_fd_close( \ cloudabi_fd_t fd); } 4 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_create1( \ cloudabi_filetype_t type); } 5 AUE_NULL STD { void cloudabi_sys_fd_create2( \ cloudabi_filetype_t type); } 6 AUE_NULL STD { void cloudabi_sys_fd_datasync( \ cloudabi_fd_t fd); } 7 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_dup( \ cloudabi_fd_t from); } 8 AUE_NULL STD { size_t cloudabi64_sys_fd_pread( \ cloudabi_fd_t fd, \ const cloudabi64_iovec_t *iovs, \ size_t iovs_len, \ cloudabi_filesize_t offset); } 9 AUE_NULL STD { size_t cloudabi64_sys_fd_pwrite( \ cloudabi_fd_t fd, \ const cloudabi64_ciovec_t *iovs, \ size_t iovs_len, \ cloudabi_filesize_t offset); } 10 AUE_NULL STD { size_t cloudabi64_sys_fd_read( \ cloudabi_fd_t fd, \ const cloudabi64_iovec_t *iovs, \ size_t iovs_len); } 11 AUE_NULL STD { void cloudabi_sys_fd_replace( \ cloudabi_fd_t from, \ cloudabi_fd_t to); } 12 AUE_NULL STD { cloudabi_filesize_t \ cloudabi_sys_fd_seek( \ cloudabi_fd_t fd, \ cloudabi_filedelta_t offset, \ cloudabi_whence_t whence); } 13 AUE_NULL STD { void cloudabi_sys_fd_stat_get( \ cloudabi_fd_t fd, \ cloudabi_fdstat_t *buf); } 14 AUE_NULL STD { void cloudabi_sys_fd_stat_put( \ cloudabi_fd_t fd, \ const cloudabi_fdstat_t *buf, \ cloudabi_fdsflags_t flags); } 15 AUE_NULL STD { void cloudabi_sys_fd_sync( \ cloudabi_fd_t fd); } 16 AUE_NULL STD { size_t cloudabi64_sys_fd_write( \ cloudabi_fd_t fd, \ const cloudabi64_ciovec_t *iovs, \ size_t iovs_len); } 17 AUE_NULL STD { void cloudabi_sys_file_advise( \ cloudabi_fd_t fd, \ cloudabi_filesize_t offset, \ cloudabi_filesize_t len, \ cloudabi_advice_t advice); } 18 AUE_NULL STD { void cloudabi_sys_file_allocate( \ cloudabi_fd_t fd, \ cloudabi_filesize_t offset, \ cloudabi_filesize_t len); } 19 AUE_NULL STD { void cloudabi_sys_file_create( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ cloudabi_filetype_t type); } 20 AUE_NULL STD { void cloudabi_sys_file_link( \ cloudabi_lookup_t fd1, \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd2, \ const char *path2, \ size_t path2_len); } 21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \ cloudabi_lookup_t dirfd, \ const char *path, \ size_t path_len, \ cloudabi_oflags_t oflags, \ const cloudabi_fdstat_t *fds); } 22 AUE_NULL STD { size_t cloudabi_sys_file_readdir( \ cloudabi_fd_t fd, \ void *buf, \ size_t buf_len, \ cloudabi_dircookie_t cookie); } 23 AUE_NULL STD { size_t cloudabi_sys_file_readlink( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ char *buf, \ size_t buf_len); } 24 AUE_NULL STD { void cloudabi_sys_file_rename( \ cloudabi_fd_t fd1, \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd2, \ const char *path2, \ size_t path2_len); } 25 AUE_NULL STD { void cloudabi_sys_file_stat_fget( \ cloudabi_fd_t fd, \ cloudabi_filestat_t *buf); } 26 AUE_NULL STD { void cloudabi_sys_file_stat_fput( \ cloudabi_fd_t fd, \ const cloudabi_filestat_t *buf, \ cloudabi_fsflags_t flags); } 27 AUE_NULL STD { void cloudabi_sys_file_stat_get( \ cloudabi_lookup_t fd, \ const char *path, \ size_t path_len, \ cloudabi_filestat_t *buf); } 28 AUE_NULL STD { void cloudabi_sys_file_stat_put( \ cloudabi_lookup_t fd, \ const char *path, \ size_t path_len, \ const cloudabi_filestat_t *buf, \ cloudabi_fsflags_t flags); } 29 AUE_NULL STD { void cloudabi_sys_file_symlink( \ const char *path1, \ size_t path1_len, \ cloudabi_fd_t fd, \ const char *path2, \ size_t path2_len); } 30 AUE_NULL STD { void cloudabi_sys_file_unlink( \ cloudabi_fd_t fd, \ const char *path, \ size_t path_len, \ cloudabi_ulflags_t flags); } 31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \ cloudabi_lock_t *lock, \ cloudabi_scope_t scope); } 32 AUE_NULL STD { void cloudabi_sys_mem_advise( \ void *mapping, \ size_t mapping_len, \ cloudabi_advice_t advice); } 33 AUE_NULL STD { void cloudabi_sys_mem_map( \ void *addr, \ size_t len, \ cloudabi_mprot_t prot, \ cloudabi_mflags_t flags, \ cloudabi_fd_t fd, \ cloudabi_filesize_t off); } 34 AUE_NULL STD { void cloudabi_sys_mem_protect( \ void *mapping, \ size_t mapping_len, \ cloudabi_mprot_t prot); } 35 AUE_NULL STD { void cloudabi_sys_mem_sync( \ void *mapping, \ size_t mapping_len, \ cloudabi_msflags_t flags); } 36 AUE_NULL STD { void cloudabi_sys_mem_unmap( \ void *mapping, \ size_t mapping_len); } 37 AUE_NULL STD { size_t cloudabi64_sys_poll( \ const cloudabi64_subscription_t *in, \ cloudabi64_event_t *out, \ size_t nsubscriptions); } 38 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \ cloudabi_fd_t fd, \ const cloudabi64_subscription_t *in, \ size_t in_len, \ cloudabi64_event_t *out, \ size_t out_len, \ const cloudabi64_subscription_t *timeout); } 39 AUE_NULL STD { void cloudabi_sys_proc_exec( \ cloudabi_fd_t fd, \ const void *data, \ size_t data_len, \ const cloudabi_fd_t *fds, \ size_t fds_len); } 40 AUE_NULL STD { void cloudabi_sys_proc_exit( \ cloudabi_exitcode_t rval); } 41 AUE_NULL STD { void cloudabi_sys_proc_fork(); } 42 AUE_NULL STD { void cloudabi_sys_proc_raise( \ cloudabi_signal_t sig); } 43 AUE_NULL STD { void cloudabi_sys_random_get( \ void *buf, \ size_t buf_len); } 44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \ cloudabi_fd_t sock, \ void *unused); } -45 AUE_NULL STD { void cloudabi_sys_sock_bind( \ +45 AUE_NULL STD { void cloudabi64_sys_sock_recv( \ cloudabi_fd_t sock, \ - cloudabi_fd_t fd, \ - const char *path, \ - size_t path_len); } - -46 AUE_NULL STD { void cloudabi_sys_sock_connect( \ - cloudabi_fd_t sock, \ - cloudabi_fd_t fd, \ - const char *path, \ - size_t path_len); } - -47 AUE_NULL STD { void cloudabi_sys_sock_listen( \ - cloudabi_fd_t sock, \ - cloudabi_backlog_t backlog); } - -48 AUE_NULL STD { void cloudabi64_sys_sock_recv( \ - cloudabi_fd_t sock, \ const cloudabi64_recv_in_t *in, \ cloudabi64_recv_out_t *out); } -49 AUE_NULL STD { void cloudabi64_sys_sock_send( \ +46 AUE_NULL STD { void cloudabi64_sys_sock_send( \ cloudabi_fd_t sock, \ const cloudabi64_send_in_t *in, \ cloudabi64_send_out_t *out); } -50 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \ +47 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \ cloudabi_fd_t sock, \ cloudabi_sdflags_t how); } -51 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \ +48 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \ cloudabi_fd_t sock, \ cloudabi_sockstat_t *buf, \ cloudabi_ssflags_t flags); } -52 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \ +49 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \ cloudabi64_threadattr_t *attr); } -53 AUE_NULL STD { void cloudabi_sys_thread_exit( \ +50 AUE_NULL STD { void cloudabi_sys_thread_exit( \ cloudabi_lock_t *lock, \ cloudabi_scope_t scope); } -54 AUE_NULL STD { void cloudabi_sys_thread_yield(); } +51 AUE_NULL STD { void cloudabi_sys_thread_yield(); } Index: head/usr.bin/truss/syscalls.c =================================================================== --- head/usr.bin/truss/syscalls.c (revision 322884) +++ head/usr.bin/truss/syscalls.c (revision 322885) @@ -1,2414 +1,2408 @@ /* * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Sean Eric Fagan * 4. Neither the name of the author may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); /* * This file has routines used to print out system calls and their * arguments. */ #include #include #include #include #include #include #include #include #define _WANT_FREEBSD11_STAT #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "truss.h" #include "extern.h" #include "syscall.h" /* * This should probably be in its own file, sorted alphabetically. */ static struct syscall decoded_syscalls[] = { /* Native ABI */ { .name = "__acl_aclcheck_fd", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_aclcheck_file", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_aclcheck_link", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_delete_fd", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Acltype, 1 } } }, { .name = "__acl_delete_file", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Acltype, 1 } } }, { .name = "__acl_delete_link", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Acltype, 1 } } }, { .name = "__acl_get_fd", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_get_file", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_get_link", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_set_fd", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_set_file", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__acl_set_link", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, { .name = "__cap_rights_get", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { CapRights | OUT, 2 } } }, { .name = "__getcwd", .ret_type = 1, .nargs = 2, .args = { { Name | OUT, 0 }, { Int, 1 } } }, { .name = "_umtx_op", .ret_type = 1, .nargs = 5, .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 }, { Ptr, 4 } } }, { .name = "accept", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "access", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, { .name = "bind", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Socklent, 2 } } }, { .name = "bindat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, { Int, 3 } } }, { .name = "break", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, { .name = "cap_fcntls_get", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, { .name = "cap_getmode", .ret_type = 1, .nargs = 1, .args = { { PUInt | OUT, 0 } } }, { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { FileFlags, 1 } } }, { .name = "chflagsat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { FileFlags, 2 }, { Atflags, 3 } } }, { .name = "chmod", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "chown", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "chroot", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "clock_gettime", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, { .name = "close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "compat11.fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat11 | OUT, 2 }, { Atflags, 3 } } }, { .name = "compat11.lstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.stat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } }, { .name = "connect", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Socklent, 2 } } }, { .name = "connectat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, { Int, 3 } } }, { .name = "dup", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "dup2", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Int, 1 } } }, { .name = "eaccess", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, { .name = "execve", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 }, { ExecEnv | IN, 2 } } }, { .name = "exit", .ret_type = 0, .nargs = 1, .args = { { Hex, 0 } } }, { .name = "extattr_delete_fd", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, { .name = "extattr_delete_file", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, { .name = "extattr_delete_link", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, { .name = "extattr_get_fd", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | OUT, 3 }, { Sizet, 4 } } }, { .name = "extattr_get_file", .ret_type = 1, .nargs = 5, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | OUT, 3 }, { Sizet, 4 } } }, { .name = "extattr_get_link", .ret_type = 1, .nargs = 5, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | OUT, 3 }, { Sizet, 4 } } }, { .name = "extattr_list_fd", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, { Sizet, 3 } } }, { .name = "extattr_list_file", .ret_type = 1, .nargs = 4, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, { Sizet, 3 } } }, { .name = "extattr_list_link", .ret_type = 1, .nargs = 4, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, { Sizet, 3 } } }, { .name = "extattr_set_fd", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | IN, 3 }, { Sizet, 4 } } }, { .name = "extattr_set_file", .ret_type = 1, .nargs = 5, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | IN, 3 }, { Sizet, 4 } } }, { .name = "extattr_set_link", .ret_type = 1, .nargs = 5, .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, { BinString | IN, 3 }, { Sizet, 4 } } }, { .name = "extattrctl", .ret_type = 1, .nargs = 5, .args = { { Name, 0 }, { Hex, 1 }, { Name, 2 }, { Extattrnamespace, 3 }, { Name, 4 } } }, { .name = "faccessat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, { Atflags, 3 } } }, { .name = "fchflags", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { FileFlags, 1 } } }, { .name = "fchmod", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Octal, 1 } } }, { .name = "fchmodat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Atflags, 3 } } }, { .name = "fchown", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "fchownat", .ret_type = 1, .nargs = 5, .args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 }, { Atflags, 4 } } }, { .name = "fcntl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } }, { .name = "flock", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Flockop, 1 } } }, { .name = "fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat | OUT, 1 } } }, { .name = "fstatat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat | OUT, 2 }, { Atflags, 3 } } }, { .name = "fstatfs", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { StatFs | OUT, 1 } } }, { .name = "ftruncate", .ret_type = 1, .nargs = 2, .args = { { Int | IN, 0 }, { QuadHex | IN, 1 } } }, { .name = "futimens", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Timespec2 | IN, 1 } } }, { .name = "futimes", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Timeval2 | IN, 1 } } }, { .name = "futimesat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } }, { .name = "getdirentries", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { PQuadHex | OUT, 3 } } }, { .name = "getfsstat", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Long, 1 }, { Getfsstatmode, 2 } } }, { .name = "getitimer", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Itimerval | OUT, 2 } } }, { .name = "getpeername", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "getpgid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getpriority", .ret_type = 1, .nargs = 2, .args = { { Priowhich, 0 }, { Int, 1 } } }, { .name = "getrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } }, { .name = "getrusage", .ret_type = 1, .nargs = 2, .args = { { RusageWho, 0 }, { Rusage | OUT, 1 } } }, { .name = "getsid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getsockname", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "getsockopt", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 }, { Ptr | OUT, 3 }, { Ptr | OUT, 4 } } }, { .name = "gettimeofday", .ret_type = 1, .nargs = 2, .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } }, { .name = "ioctl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Ioctl, 1 }, { Ptr, 2 } } }, { .name = "kevent", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } }, { .name = "kill", .ret_type = 1, .nargs = 2, .args = { { Int | IN, 0 }, { Signal | IN, 1 } } }, { .name = "kldfind", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "kldfirstmod", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "kldload", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "kldnext", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "kldstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr, 1 } } }, { .name = "kldsym", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Kldsymcmd, 1 }, { Ptr, 2 } } }, { .name = "kldunload", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "kldunloadf", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Kldunloadflags, 1 } } }, { .name = "kse_release", .ret_type = 0, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "lchflags", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { FileFlags, 1 } } }, { .name = "lchmod", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "lchown", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "link", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, { .name = "linkat", .ret_type = 1, .nargs = 5, .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 }, { Atflags, 4 } } }, { .name = "listen", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Int, 1 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, .args = { { Int, 0 }, { QuadHex, 1 }, { Whence, 2 } } }, { .name = "lstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "lutimes", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } }, { .name = "madvise", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Madvice, 2 } } }, { .name = "minherit", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Minherit, 2 } } }, { .name = "mkdir", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "mkdirat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } }, { .name = "mkfifo", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "mkfifoat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } }, { .name = "mknod", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } }, { .name = "mknodat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } }, { .name = "mlock", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "mlockall", .ret_type = 1, .nargs = 1, .args = { { Mlockall, 0 } } }, { .name = "mmap", .ret_type = 1, .nargs = 6, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { QuadHex, 5 } } }, { .name = "modfind", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "mount", .ret_type = 1, .nargs = 4, .args = { { Name, 0 }, { Name, 1 }, { Mountflags, 2 }, { Ptr, 3 } } }, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 } } }, { .name = "msync", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Msync, 2 } } }, { .name = "munlock", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "munmap", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "nanosleep", .ret_type = 1, .nargs = 1, .args = { { Timespec, 0 } } }, { .name = "nmount", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { UInt, 1 }, { Mountflags, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "openat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Open, 2 }, { Octal, 3 } } }, { .name = "pathconf", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Pathconf, 1 } } }, { .name = "pipe", .ret_type = 1, .nargs = 1, .args = { { PipeFds | OUT, 0 } } }, { .name = "pipe2", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Pipe2, 1 } } }, { .name = "poll", .ret_type = 1, .nargs = 3, .args = { { Pollfd, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "posix_fadvise", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { QuadHex, 1 }, { QuadHex, 2 }, { Fadvice, 3 } } }, { .name = "posix_openpt", .ret_type = 1, .nargs = 1, .args = { { Open, 0 } } }, { .name = "pread", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { QuadHex, 3 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, { .name = "ptrace", .ret_type = 1, .nargs = 4, .args = { { Ptraceop, 0 }, { Int, 1 }, { Ptr, 2 }, { Int, 3 } } }, { .name = "pwrite", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { QuadHex, 3 } } }, { .name = "quotactl", .ret_type = 1, .nargs = 4, .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Sizet, 3 } } }, { .name = "reboot", .ret_type = 1, .nargs = 1, .args = { { Reboothowto, 0 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } }, { .name = "recvmsg", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, { .name = "rename", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, { .name = "rmdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "rtprio", .ret_type = 1, .nargs = 3, .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, { .name = "rtprio_thread", .ret_type = 1, .nargs = 3, .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, { .name = "sched_get_priority_max", .ret_type = 1, .nargs = 1, .args = { { Schedpolicy, 0 } } }, { .name = "sched_get_priority_min", .ret_type = 1, .nargs = 1, .args = { { Schedpolicy, 0 } } }, { .name = "sched_getparam", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Schedparam | OUT, 1 } } }, { .name = "sched_getscheduler", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "sched_rr_get_interval", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, { .name = "sched_setparam", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Schedparam, 1 } } }, { .name = "sched_setscheduler", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } }, { .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { Ptr | IN, 1 }, { Int, 2 }, { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, { Ptr | OUT, 5 }, { Ptr | OUT, 6 } } }, { .name = "sctp_generic_sendmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Sockaddr | IN, 3 }, { Socklent, 4 }, { Ptr | IN, 5 }, { Msgflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, { .name = "sendmsg", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, { .name = "sendto", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | IN, 4 }, { Socklent | IN, 5 } } }, { .name = "setitimer", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } }, { .name = "setpriority", .ret_type = 1, .nargs = 3, .args = { { Priowhich, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "setrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | IN, 1 } } }, { .name = "setsockopt", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 }, { Ptr | IN, 3 }, { Socklent, 4 } } }, { .name = "shutdown", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Shutdown, 1 } } }, { .name = "sigaction", .ret_type = 1, .nargs = 3, .args = { { Signal, 0 }, { Sigaction | IN, 1 }, { Sigaction | OUT, 2 } } }, { .name = "sigpending", .ret_type = 1, .nargs = 1, .args = { { Sigset | OUT, 0 } } }, { .name = "sigprocmask", .ret_type = 1, .nargs = 3, .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } }, { .name = "sigqueue", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Signal, 1 }, { LongHex, 2 } } }, { .name = "sigreturn", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, { .name = "sigsuspend", .ret_type = 1, .nargs = 1, .args = { { Sigset | IN, 0 } } }, { .name = "sigtimedwait", .ret_type = 1, .nargs = 3, .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } }, { .name = "sigwait", .ret_type = 1, .nargs = 2, .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2, .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, { .name = "socket", .ret_type = 1, .nargs = 3, .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "statfs", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { StatFs | OUT, 1 } } }, { .name = "symlink", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, { .name = "symlinkat", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Atfd, 1 }, { Name, 2 } } }, { .name = "sysarch", .ret_type = 1, .nargs = 2, .args = { { Sysarch, 0 }, { Ptr, 1 } } }, { .name = "thr_kill", .ret_type = 1, .nargs = 2, .args = { { Long, 0 }, { Signal, 1 } } }, { .name = "thr_self", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, { .name = "truncate", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { QuadHex | IN, 1 } } }, #if 0 /* Does not exist */ { .name = "umount", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Int, 2 } } }, #endif { .name = "unlink", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "unlinkat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Mountflags, 1 } } }, { .name = "utimensat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 }, { Atflags, 3 } } }, { .name = "utimes", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } }, { .name = "utrace", .ret_type = 1, .nargs = 1, .args = { { Utrace, 0 } } }, { .name = "wait4", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { ExitStatus | OUT, 1 }, { Waitoptions, 2 }, { Rusage | OUT, 3 } } }, { .name = "wait6", .ret_type = 1, .nargs = 6, .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 }, { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, /* Linux ABI */ { .name = "linux_access", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Accessmode, 1 } } }, { .name = "linux_execve", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 }, { ExecEnv | IN, 2 } } }, { .name = "linux_lseek", .ret_type = 2, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } }, { .name = "linux_mkdir", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Int, 1 } } }, { .name = "linux_newfstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr | OUT, 1 } } }, { .name = "linux_newstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, { .name = "linux_open", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } }, { .name = "linux_readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Name | OUT, 1 }, { Sizet, 2 } } }, { .name = "linux_socketcall", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { LinuxSockArgs, 1 } } }, { .name = "linux_stat64", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, /* CloudABI system calls. */ { .name = "cloudabi_sys_clock_res_get", .ret_type = 1, .nargs = 1, .args = { { CloudABIClockID, 0 } } }, { .name = "cloudabi_sys_clock_time_get", .ret_type = 1, .nargs = 2, .args = { { CloudABIClockID, 0 }, { CloudABITimestamp, 1 } } }, { .name = "cloudabi_sys_condvar_signal", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { CloudABIMFlags, 1 }, { UInt, 2 } } }, { .name = "cloudabi_sys_fd_close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "cloudabi_sys_fd_create1", .ret_type = 1, .nargs = 1, .args = { { CloudABIFileType, 0 } } }, { .name = "cloudabi_sys_fd_create2", .ret_type = 1, .nargs = 2, .args = { { CloudABIFileType, 0 }, { PipeFds | OUT, 0 } } }, { .name = "cloudabi_sys_fd_datasync", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "cloudabi_sys_fd_dup", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "cloudabi_sys_fd_replace", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Int, 1 } } }, { .name = "cloudabi_sys_fd_seek", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { CloudABIWhence, 2 } } }, { .name = "cloudabi_sys_fd_stat_get", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CloudABIFDStat | OUT, 1 } } }, { .name = "cloudabi_sys_fd_stat_put", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { CloudABIFDStat | IN, 1 }, { ClouduABIFDSFlags, 2 } } }, { .name = "cloudabi_sys_fd_sync", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "cloudabi_sys_file_advise", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { Int, 1 }, { Int, 2 }, { CloudABIAdvice, 3 } } }, { .name = "cloudabi_sys_file_allocate", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "cloudabi_sys_file_create", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { CloudABIFileType, 3 } } }, { .name = "cloudabi_sys_file_link", .ret_type = 1, .nargs = 4, .args = { { CloudABILookup, 0 }, { BinString | IN, 1 }, { Int, 3 }, { BinString | IN, 4 } } }, { .name = "cloudabi_sys_file_open", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { CloudABIOFlags, 3 }, { CloudABIFDStat | IN, 4 } } }, { .name = "cloudabi_sys_file_readdir", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { Int, 3 } } }, { .name = "cloudabi_sys_file_readlink", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { BinString | OUT, 3 }, { Int, 4 } } }, { .name = "cloudabi_sys_file_rename", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 3 }, { BinString | IN, 4 } } }, { .name = "cloudabi_sys_file_stat_fget", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CloudABIFileStat | OUT, 1 } } }, { .name = "cloudabi_sys_file_stat_fput", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { CloudABIFileStat | IN, 1 }, { CloudABIFSFlags, 2 } } }, { .name = "cloudabi_sys_file_stat_get", .ret_type = 1, .nargs = 3, .args = { { CloudABILookup, 0 }, { BinString | IN, 1 }, { CloudABIFileStat | OUT, 3 } } }, { .name = "cloudabi_sys_file_stat_put", .ret_type = 1, .nargs = 4, .args = { { CloudABILookup, 0 }, { BinString | IN, 1 }, { CloudABIFileStat | IN, 3 }, { CloudABIFSFlags, 4 } } }, { .name = "cloudabi_sys_file_symlink", .ret_type = 1, .nargs = 3, .args = { { BinString | IN, 0 }, { Int, 2 }, { BinString | IN, 3 } } }, { .name = "cloudabi_sys_file_unlink", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { CloudABIULFlags, 3 } } }, { .name = "cloudabi_sys_lock_unlock", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { CloudABIMFlags, 1 } } }, { .name = "cloudabi_sys_mem_advise", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { CloudABIAdvice, 2 } } }, { .name = "cloudabi_sys_mem_map", .ret_type = 1, .nargs = 6, .args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMProt, 2 }, { CloudABIMFlags, 3 }, { Int, 4 }, { Int, 5 } } }, { .name = "cloudabi_sys_mem_protect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMProt, 2 } } }, { .name = "cloudabi_sys_mem_sync", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMSFlags, 2 } } }, { .name = "cloudabi_sys_mem_unmap", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Int, 1 } } }, { .name = "cloudabi_sys_proc_exec", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { IntArray, 3 }, { Int, 4 } } }, { .name = "cloudabi_sys_proc_exit", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "cloudabi_sys_proc_fork", .ret_type = 1, .nargs = 0 }, { .name = "cloudabi_sys_proc_raise", .ret_type = 1, .nargs = 1, .args = { { CloudABISignal, 0 } } }, { .name = "cloudabi_sys_random_get", .ret_type = 1, .nargs = 2, .args = { { BinString | OUT, 0 }, { Int, 1 } } }, { .name = "cloudabi_sys_sock_accept", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CloudABISockStat | OUT, 1 } } }, - { .name = "cloudabi_sys_sock_bind", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Int, 1 }, { BinString | IN, 2 } } }, - { .name = "cloudabi_sys_sock_connect", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Int, 1 }, { BinString | IN, 2 } } }, - { .name = "cloudabi_sys_sock_listen", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Int, 1 } } }, { .name = "cloudabi_sys_sock_shutdown", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CloudABISDFlags, 1 } } }, { .name = "cloudabi_sys_sock_stat_get", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { CloudABISockStat | OUT, 1 }, { CloudABISSFlags, 2 } } }, { .name = "cloudabi_sys_thread_exit", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { CloudABIMFlags, 1 } } }, { .name = "cloudabi_sys_thread_yield", .ret_type = 1, .nargs = 0 }, { .name = 0 }, }; static STAILQ_HEAD(, syscall) syscalls; /* Xlat idea taken from strace */ struct xlat { int val; const char *str; }; #define X(a) { a, #a }, #define XEND { 0, NULL } static struct xlat kevent_filters[] = { X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE) X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER) X(EVFILT_PROCDESC) X(EVFILT_FS) X(EVFILT_LIO) X(EVFILT_USER) X(EVFILT_SENDFILE) XEND }; static struct xlat kevent_flags[] = { X(EV_ADD) X(EV_DELETE) X(EV_ENABLE) X(EV_DISABLE) X(EV_ONESHOT) X(EV_CLEAR) X(EV_RECEIPT) X(EV_DISPATCH) X(EV_FORCEONESHOT) X(EV_DROP) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND }; static struct xlat kevent_user_ffctrl[] = { X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY) XEND }; static struct xlat kevent_rdwr_fflags[] = { X(NOTE_LOWAT) X(NOTE_FILE_POLL) XEND }; static struct xlat kevent_vnode_fflags[] = { X(NOTE_DELETE) X(NOTE_WRITE) X(NOTE_EXTEND) X(NOTE_ATTRIB) X(NOTE_LINK) X(NOTE_RENAME) X(NOTE_REVOKE) XEND }; static struct xlat kevent_proc_fflags[] = { X(NOTE_EXIT) X(NOTE_FORK) X(NOTE_EXEC) X(NOTE_TRACK) X(NOTE_TRACKERR) X(NOTE_CHILD) XEND }; static struct xlat kevent_timer_fflags[] = { X(NOTE_SECONDS) X(NOTE_MSECONDS) X(NOTE_USECONDS) X(NOTE_NSECONDS) XEND }; static struct xlat poll_flags[] = { X(POLLSTANDARD) X(POLLIN) X(POLLPRI) X(POLLOUT) X(POLLERR) X(POLLHUP) X(POLLNVAL) X(POLLRDNORM) X(POLLRDBAND) X(POLLWRBAND) X(POLLINIGNEOF) XEND }; static struct xlat sigaction_flags[] = { X(SA_ONSTACK) X(SA_RESTART) X(SA_RESETHAND) X(SA_NOCLDSTOP) X(SA_NODEFER) X(SA_NOCLDWAIT) X(SA_SIGINFO) XEND }; static struct xlat pathconf_arg[] = { X(_PC_LINK_MAX) X(_PC_MAX_CANON) X(_PC_MAX_INPUT) X(_PC_NAME_MAX) X(_PC_PATH_MAX) X(_PC_PIPE_BUF) X(_PC_CHOWN_RESTRICTED) X(_PC_NO_TRUNC) X(_PC_VDISABLE) X(_PC_ASYNC_IO) X(_PC_PRIO_IO) X(_PC_SYNC_IO) X(_PC_ALLOC_SIZE_MIN) X(_PC_FILESIZEBITS) X(_PC_REC_INCR_XFER_SIZE) X(_PC_REC_MAX_XFER_SIZE) X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN) X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX) X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT) X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND }; static struct xlat at_flags[] = { X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW) X(AT_REMOVEDIR) XEND }; static struct xlat sysarch_ops[] = { #if defined(__i386__) || defined(__amd64__) X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM) X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE) X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE) X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE) X(AMD64_GET_XFPUSTATE) #endif XEND }; static struct xlat linux_socketcall_ops[] = { X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN) X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME) X(LINUX_SOCKETPAIR) X(LINUX_SEND) X(LINUX_RECV) X(LINUX_SENDTO) X(LINUX_RECVFROM) X(LINUX_SHUTDOWN) X(LINUX_SETSOCKOPT) X(LINUX_GETSOCKOPT) X(LINUX_SENDMSG) X(LINUX_RECVMSG) XEND }; #undef X #define X(a) { CLOUDABI_##a, #a }, static struct xlat cloudabi_advice[] = { X(ADVICE_DONTNEED) X(ADVICE_NOREUSE) X(ADVICE_NORMAL) X(ADVICE_RANDOM) X(ADVICE_SEQUENTIAL) X(ADVICE_WILLNEED) XEND }; static struct xlat cloudabi_clockid[] = { X(CLOCK_MONOTONIC) X(CLOCK_PROCESS_CPUTIME_ID) X(CLOCK_REALTIME) X(CLOCK_THREAD_CPUTIME_ID) XEND }; static struct xlat cloudabi_errno[] = { X(E2BIG) X(EACCES) X(EADDRINUSE) X(EADDRNOTAVAIL) X(EAFNOSUPPORT) X(EAGAIN) X(EALREADY) X(EBADF) X(EBADMSG) X(EBUSY) X(ECANCELED) X(ECHILD) X(ECONNABORTED) X(ECONNREFUSED) X(ECONNRESET) X(EDEADLK) X(EDESTADDRREQ) X(EDOM) X(EDQUOT) X(EEXIST) X(EFAULT) X(EFBIG) X(EHOSTUNREACH) X(EIDRM) X(EILSEQ) X(EINPROGRESS) X(EINTR) X(EINVAL) X(EIO) X(EISCONN) X(EISDIR) X(ELOOP) X(EMFILE) X(EMLINK) X(EMSGSIZE) X(EMULTIHOP) X(ENAMETOOLONG) X(ENETDOWN) X(ENETRESET) X(ENETUNREACH) X(ENFILE) X(ENOBUFS) X(ENODEV) X(ENOENT) X(ENOEXEC) X(ENOLCK) X(ENOLINK) X(ENOMEM) X(ENOMSG) X(ENOPROTOOPT) X(ENOSPC) X(ENOSYS) X(ENOTCONN) X(ENOTDIR) X(ENOTEMPTY) X(ENOTRECOVERABLE) X(ENOTSOCK) X(ENOTSUP) X(ENOTTY) X(ENXIO) X(EOVERFLOW) X(EOWNERDEAD) X(EPERM) X(EPIPE) X(EPROTO) X(EPROTONOSUPPORT) X(EPROTOTYPE) X(ERANGE) X(EROFS) X(ESPIPE) X(ESRCH) X(ESTALE) X(ETIMEDOUT) X(ETXTBSY) X(EXDEV) X(ENOTCAPABLE) XEND }; static struct xlat cloudabi_fdflags[] = { X(FDFLAG_APPEND) X(FDFLAG_DSYNC) X(FDFLAG_NONBLOCK) X(FDFLAG_RSYNC) X(FDFLAG_SYNC) XEND }; static struct xlat cloudabi_fdsflags[] = { X(FDSTAT_FLAGS) X(FDSTAT_RIGHTS) XEND }; static struct xlat cloudabi_filetype[] = { X(FILETYPE_UNKNOWN) X(FILETYPE_BLOCK_DEVICE) X(FILETYPE_CHARACTER_DEVICE) X(FILETYPE_DIRECTORY) X(FILETYPE_FIFO) X(FILETYPE_POLL) X(FILETYPE_PROCESS) X(FILETYPE_REGULAR_FILE) X(FILETYPE_SHARED_MEMORY) X(FILETYPE_SOCKET_DGRAM) X(FILETYPE_SOCKET_STREAM) X(FILETYPE_SYMBOLIC_LINK) XEND }; static struct xlat cloudabi_fsflags[] = { X(FILESTAT_ATIM) X(FILESTAT_ATIM_NOW) X(FILESTAT_MTIM) X(FILESTAT_MTIM_NOW) X(FILESTAT_SIZE) XEND }; static struct xlat cloudabi_mflags[] = { X(MAP_ANON) X(MAP_FIXED) X(MAP_PRIVATE) X(MAP_SHARED) XEND }; static struct xlat cloudabi_mprot[] = { X(PROT_EXEC) X(PROT_WRITE) X(PROT_READ) XEND }; static struct xlat cloudabi_msflags[] = { X(MS_ASYNC) X(MS_INVALIDATE) X(MS_SYNC) XEND }; static struct xlat cloudabi_oflags[] = { X(O_CREAT) X(O_DIRECTORY) X(O_EXCL) X(O_TRUNC) XEND }; static struct xlat cloudabi_sdflags[] = { X(SHUT_RD) X(SHUT_WR) XEND }; static struct xlat cloudabi_signal[] = { X(SIGABRT) X(SIGALRM) X(SIGBUS) X(SIGCHLD) X(SIGCONT) X(SIGFPE) X(SIGHUP) X(SIGILL) X(SIGINT) X(SIGKILL) X(SIGPIPE) X(SIGQUIT) X(SIGSEGV) X(SIGSTOP) X(SIGSYS) X(SIGTERM) X(SIGTRAP) X(SIGTSTP) X(SIGTTIN) X(SIGTTOU) X(SIGURG) X(SIGUSR1) X(SIGUSR2) X(SIGVTALRM) X(SIGXCPU) X(SIGXFSZ) XEND }; static struct xlat cloudabi_ssflags[] = { X(SOCKSTAT_CLEAR_ERROR) XEND }; static struct xlat cloudabi_ssstate[] = { X(SOCKSTATE_ACCEPTCONN) XEND }; static struct xlat cloudabi_ulflags[] = { X(UNLINK_REMOVEDIR) XEND }; static struct xlat cloudabi_whence[] = { X(WHENCE_CUR) X(WHENCE_END) X(WHENCE_SET) XEND }; #undef X #undef XEND /* * Searches an xlat array for a value, and returns it if found. Otherwise * return a string representation. */ static const char * lookup(struct xlat *xlat, int val, int base) { static char tmp[16]; for (; xlat->str != NULL; xlat++) if (xlat->val == val) return (xlat->str); switch (base) { case 8: sprintf(tmp, "0%o", val); break; case 16: sprintf(tmp, "0x%x", val); break; case 10: sprintf(tmp, "%u", val); break; default: errx(1,"Unknown lookup base"); break; } return (tmp); } static const char * xlookup(struct xlat *xlat, int val) { return (lookup(xlat, val, 16)); } /* * Searches an xlat array containing bitfield values. Remaining bits * set after removing the known ones are printed at the end: * IN|0x400. */ static char * xlookup_bits(struct xlat *xlat, int val) { int len, rem; static char str[512]; len = 0; rem = val; for (; xlat->str != NULL; xlat++) { if ((xlat->val & rem) == xlat->val) { /* * Don't print the "all-bits-zero" string unless all * bits are really zero. */ if (xlat->val == 0 && val != 0) continue; len += sprintf(str + len, "%s|", xlat->str); rem &= ~(xlat->val); } } /* * If we have leftover bits or didn't match anything, print * the remainder. */ if (rem || len == 0) len += sprintf(str + len, "0x%x", rem); if (len && str[len - 1] == '|') len--; str[len] = 0; return (str); } static void print_integer_arg(const char *(*decoder)(int), FILE *fp, int value) { const char *str; str = decoder(value); if (str != NULL) fputs(str, fp); else fprintf(fp, "%d", value); } static void print_mask_arg(bool (*decoder)(FILE *, int, int *), FILE *fp, int value) { int rem; if (!decoder(fp, value, &rem)) fprintf(fp, "0x%x", rem); else if (rem != 0) fprintf(fp, "|0x%x", rem); } static void print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uint32_t *), FILE *fp, uint32_t value) { uint32_t rem; if (!decoder(fp, value, &rem)) fprintf(fp, "0x%x", rem); else if (rem != 0) fprintf(fp, "|0x%x", rem); } #ifndef __LP64__ /* * Add argument padding to subsequent system calls afater a Quad * syscall arguments as needed. This used to be done by hand in the * decoded_syscalls table which was ugly and error prone. It is * simpler to do the fixup of offsets at initalization time than when * decoding arguments. */ static void quad_fixup(struct syscall *sc) { int offset, prev; u_int i; offset = 0; prev = -1; for (i = 0; i < sc->nargs; i++) { /* This arg type is a dummy that doesn't use offset. */ if ((sc->args[i].type & ARG_MASK) == PipeFds) continue; assert(prev < sc->args[i].offset); prev = sc->args[i].offset; sc->args[i].offset += offset; switch (sc->args[i].type & ARG_MASK) { case Quad: case QuadHex: #ifdef __powerpc__ /* * 64-bit arguments on 32-bit powerpc must be * 64-bit aligned. If the current offset is * not aligned, the calling convention inserts * a 32-bit pad argument that should be skipped. */ if (sc->args[i].offset % 2 == 1) { sc->args[i].offset++; offset++; } #endif offset++; default: break; } } } #endif void init_syscalls(void) { struct syscall *sc; STAILQ_INIT(&syscalls); for (sc = decoded_syscalls; sc->name != NULL; sc++) { #ifndef __LP64__ quad_fixup(sc); #endif STAILQ_INSERT_HEAD(&syscalls, sc, entries); } } static struct syscall * find_syscall(struct procabi *abi, u_int number) { struct extra_syscall *es; if (number < nitems(abi->syscalls)) return (abi->syscalls[number]); STAILQ_FOREACH(es, &abi->extra_syscalls, entries) { if (es->number == number) return (es->sc); } return (NULL); } static void add_syscall(struct procabi *abi, u_int number, struct syscall *sc) { struct extra_syscall *es; if (number < nitems(abi->syscalls)) { assert(abi->syscalls[number] == NULL); abi->syscalls[number] = sc; } else { es = malloc(sizeof(*es)); es->sc = sc; es->number = number; STAILQ_INSERT_TAIL(&abi->extra_syscalls, es, entries); } } /* * If/when the list gets big, it might be desirable to do it * as a hash table or binary search. */ struct syscall * get_syscall(struct threadinfo *t, u_int number, u_int nargs) { struct syscall *sc; const char *name; char *new_name; u_int i; sc = find_syscall(t->proc->abi, number); if (sc != NULL) return (sc); name = sysdecode_syscallname(t->proc->abi->abi, number); if (name == NULL) { asprintf(&new_name, "#%d", number); name = new_name; } else new_name = NULL; STAILQ_FOREACH(sc, &syscalls, entries) { if (strcmp(name, sc->name) == 0) { add_syscall(t->proc->abi, number, sc); free(new_name); return (sc); } } /* It is unknown. Add it into the list. */ #if DEBUG fprintf(stderr, "unknown syscall %s -- setting args to %d\n", name, nargs); #endif sc = calloc(1, sizeof(struct syscall)); sc->name = name; if (new_name != NULL) sc->unknown = true; sc->ret_type = 1; sc->nargs = nargs; for (i = 0; i < nargs; i++) { sc->args[i].offset = i; /* Treat all unknown arguments as LongHex. */ sc->args[i].type = LongHex; } STAILQ_INSERT_HEAD(&syscalls, sc, entries); add_syscall(t->proc->abi, number, sc); return (sc); } /* * Copy a fixed amount of bytes from the process. */ static int get_struct(pid_t pid, void *offset, void *buf, int len) { struct ptrace_io_desc iorequest; iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = offset; iorequest.piod_addr = buf; iorequest.piod_len = len; if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) return (-1); return (0); } #define MAXSIZE 4096 /* * Copy a string from the process. Note that it is * expected to be a C string, but if max is set, it will * only get that much. */ static char * get_string(pid_t pid, void *addr, int max) { struct ptrace_io_desc iorequest; char *buf, *nbuf; size_t offset, size, totalsize; offset = 0; if (max) size = max + 1; else { /* Read up to the end of the current page. */ size = PAGE_SIZE - ((uintptr_t)addr % PAGE_SIZE); if (size > MAXSIZE) size = MAXSIZE; } totalsize = size; buf = malloc(totalsize); if (buf == NULL) return (NULL); for (;;) { iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = (char *)addr + offset; iorequest.piod_addr = buf + offset; iorequest.piod_len = size; if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) { free(buf); return (NULL); } if (memchr(buf + offset, '\0', size) != NULL) return (buf); offset += size; if (totalsize < MAXSIZE && max == 0) { size = MAXSIZE - totalsize; if (size > PAGE_SIZE) size = PAGE_SIZE; nbuf = realloc(buf, totalsize + size); if (nbuf == NULL) { buf[totalsize - 1] = '\0'; return (buf); } buf = nbuf; totalsize += size; } else { buf[totalsize - 1] = '\0'; return (buf); } } } static const char * strsig2(int sig) { static char tmp[32]; const char *signame; signame = sysdecode_signal(sig); if (signame == NULL) { snprintf(tmp, sizeof(tmp), "%d", sig); signame = tmp; } return (signame); } static void print_kevent(FILE *fp, struct kevent *ke, int input) { switch (ke->filter) { case EVFILT_READ: case EVFILT_WRITE: case EVFILT_VNODE: case EVFILT_PROC: case EVFILT_TIMER: case EVFILT_PROCDESC: fprintf(fp, "%ju", (uintmax_t)ke->ident); break; case EVFILT_SIGNAL: fputs(strsig2(ke->ident), fp); break; default: fprintf(fp, "%p", (void *)ke->ident); } fprintf(fp, ",%s,%s,", xlookup(kevent_filters, ke->filter), xlookup_bits(kevent_flags, ke->flags)); switch (ke->filter) { case EVFILT_READ: case EVFILT_WRITE: fputs(xlookup_bits(kevent_rdwr_fflags, ke->fflags), fp); break; case EVFILT_VNODE: fputs(xlookup_bits(kevent_vnode_fflags, ke->fflags), fp); break; case EVFILT_PROC: case EVFILT_PROCDESC: fputs(xlookup_bits(kevent_proc_fflags, ke->fflags), fp); break; case EVFILT_TIMER: fputs(xlookup_bits(kevent_timer_fflags, ke->fflags), fp); break; case EVFILT_USER: { int ctrl, data; ctrl = ke->fflags & NOTE_FFCTRLMASK; data = ke->fflags & NOTE_FFLAGSMASK; if (input) { fputs(xlookup(kevent_user_ffctrl, ctrl), fp); if (ke->fflags & NOTE_TRIGGER) fputs("|NOTE_TRIGGER", fp); if (data != 0) fprintf(fp, "|%#x", data); } else { fprintf(fp, "%#x", data); } break; } default: fprintf(fp, "%#x", ke->fflags); } fprintf(fp, ",%#jx,%p", (uintmax_t)ke->data, ke->udata); } static void print_utrace(FILE *fp, void *utrace_addr, size_t len) { unsigned char *utrace_buffer; fprintf(fp, "{ "); if (sysdecode_utrace(fp, utrace_addr, len)) { fprintf(fp, " }"); return; } utrace_buffer = utrace_addr; fprintf(fp, "%zu:", len); while (len--) fprintf(fp, " %02x", *utrace_buffer++); fprintf(fp, " }"); } /* * Converts a syscall argument into a string. Said string is * allocated via malloc(), so needs to be free()'d. sc is * a pointer to the syscall description (see above); args is * an array of all of the system call arguments. */ char * print_arg(struct syscall_args *sc, unsigned long *args, long *retval, struct trussinfo *trussinfo) { FILE *fp; char *tmp; size_t tmplen; pid_t pid; fp = open_memstream(&tmp, &tmplen); pid = trussinfo->curthread->proc->pid; switch (sc->type & ARG_MASK) { case Hex: fprintf(fp, "0x%x", (int)args[sc->offset]); break; case Octal: fprintf(fp, "0%o", (int)args[sc->offset]); break; case Int: fprintf(fp, "%d", (int)args[sc->offset]); break; case UInt: fprintf(fp, "%u", (unsigned int)args[sc->offset]); break; case PUInt: { unsigned int val; if (get_struct(pid, (void *)args[sc->offset], &val, sizeof(val)) == 0) fprintf(fp, "{ %u }", val); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case LongHex: fprintf(fp, "0x%lx", args[sc->offset]); break; case Long: fprintf(fp, "%ld", args[sc->offset]); break; case Sizet: fprintf(fp, "%zu", (size_t)args[sc->offset]); break; case Name: { /* NULL-terminated string. */ char *tmp2; tmp2 = get_string(pid, (void*)args[sc->offset], 0); fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; } case BinString: { /* * Binary block of data that might have printable characters. * XXX If type|OUT, assume that the length is the syscall's * return value. Otherwise, assume that the length of the block * is in the next syscall argument. */ int max_string = trussinfo->strsize; char tmp2[max_string + 1], *tmp3; int len; int truncated = 0; if (sc->type & OUT) len = retval[0]; else len = args[sc->offset + 1]; /* * Don't print more than max_string characters, to avoid word * wrap. If we have to truncate put some ... after the string. */ if (len > max_string) { len = max_string; truncated = 1; } if (len && get_struct(pid, (void*)args[sc->offset], &tmp2, len) != -1) { tmp3 = malloc(len * 4 + 1); while (len) { if (strvisx(tmp3, tmp2, len, VIS_CSTYLE|VIS_TAB|VIS_NL) <= max_string) break; len--; truncated = 1; } fprintf(fp, "\"%s\"%s", tmp3, truncated ? "..." : ""); free(tmp3); } else { fprintf(fp, "0x%lx", args[sc->offset]); } break; } case ExecArgs: case ExecEnv: case StringArray: { uintptr_t addr; union { char *strarray[0]; char buf[PAGE_SIZE]; } u; char *string; size_t len; u_int first, i; /* * Only parse argv[] and environment arrays from exec calls * if requested. */ if (((sc->type & ARG_MASK) == ExecArgs && (trussinfo->flags & EXECVEARGS) == 0) || ((sc->type & ARG_MASK) == ExecEnv && (trussinfo->flags & EXECVEENVS) == 0)) { fprintf(fp, "0x%lx", args[sc->offset]); break; } /* * Read a page of pointers at a time. Punt if the top-level * pointer is not aligned. Note that the first read is of * a partial page. */ addr = args[sc->offset]; if (addr % sizeof(char *) != 0) { fprintf(fp, "0x%lx", args[sc->offset]); break; } len = PAGE_SIZE - (addr & PAGE_MASK); if (get_struct(pid, (void *)addr, u.buf, len) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } fputc('[', fp); first = 1; i = 0; while (u.strarray[i] != NULL) { string = get_string(pid, u.strarray[i], 0); fprintf(fp, "%s \"%s\"", first ? "" : ",", string); free(string); first = 0; i++; if (i == len / sizeof(char *)) { addr += len; len = PAGE_SIZE; if (get_struct(pid, (void *)addr, u.buf, len) == -1) { fprintf(fp, ", "); break; } i = 0; } } fputs(" ]", fp); break; } #ifdef __LP64__ case Quad: fprintf(fp, "%ld", args[sc->offset]); break; case QuadHex: fprintf(fp, "0x%lx", args[sc->offset]); break; #else case Quad: case QuadHex: { unsigned long long ll; #if _BYTE_ORDER == _LITTLE_ENDIAN ll = (unsigned long long)args[sc->offset + 1] << 32 | args[sc->offset]; #else ll = (unsigned long long)args[sc->offset] << 32 | args[sc->offset + 1]; #endif if ((sc->type & ARG_MASK) == Quad) fprintf(fp, "%lld", ll); else fprintf(fp, "0x%llx", ll); break; } #endif case PQuadHex: { uint64_t val; if (get_struct(pid, (void *)args[sc->offset], &val, sizeof(val)) == 0) fprintf(fp, "{ 0x%jx }", (uintmax_t)val); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Ptr: fprintf(fp, "0x%lx", args[sc->offset]); break; case Readlinkres: { char *tmp2; if (retval[0] == -1) break; tmp2 = get_string(pid, (void*)args[sc->offset], retval[0]); fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; } case Ioctl: { const char *temp; unsigned long cmd; cmd = args[sc->offset]; temp = sysdecode_ioctlname(cmd); if (temp) fputs(temp, fp); else { fprintf(fp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }", cmd, cmd & IOC_OUT ? "R" : "", cmd & IOC_IN ? "W" : "", IOCGROUP(cmd), isprint(IOCGROUP(cmd)) ? (char)IOCGROUP(cmd) : '?', cmd & 0xFF, IOCPARM_LEN(cmd)); } break; } case Timespec: { struct timespec ts; if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) fprintf(fp, "{ %jd.%09ld }", (intmax_t)ts.tv_sec, ts.tv_nsec); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timespec2: { struct timespec ts[2]; const char *sep; unsigned int i; if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) != -1) { fputs("{ ", fp); sep = ""; for (i = 0; i < nitems(ts); i++) { fputs(sep, fp); sep = ", "; switch (ts[i].tv_nsec) { case UTIME_NOW: fprintf(fp, "UTIME_NOW"); break; case UTIME_OMIT: fprintf(fp, "UTIME_OMIT"); break; default: fprintf(fp, "%jd.%09ld", (intmax_t)ts[i].tv_sec, ts[i].tv_nsec); break; } } fputs(" }", fp); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timeval: { struct timeval tv; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %jd.%06ld }", (intmax_t)tv.tv_sec, tv.tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Timeval2: { struct timeval tv[2]; if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", (intmax_t)tv[0].tv_sec, tv[0].tv_usec, (intmax_t)tv[1].tv_sec, tv[1].tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Itimerval: { struct itimerval itv; if (get_struct(pid, (void *)args[sc->offset], &itv, sizeof(itv)) != -1) fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", (intmax_t)itv.it_interval.tv_sec, itv.it_interval.tv_usec, (intmax_t)itv.it_value.tv_sec, itv.it_value.tv_usec); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case LinuxSockArgs: { struct linux_socketcall_args largs; if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, sizeof(largs)) != -1) fprintf(fp, "{ %s, 0x%lx }", lookup(linux_socketcall_ops, largs.what, 10), (long unsigned int)largs.args); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Pollfd: { /* * XXX: A Pollfd argument expects the /next/ syscall argument * to be the number of fds in the array. This matches the poll * syscall. */ struct pollfd *pfd; int numfds = args[sc->offset + 1]; size_t bytes = sizeof(struct pollfd) * numfds; int i; if ((pfd = malloc(bytes)) == NULL) err(1, "Cannot malloc %zu bytes for pollfd array", bytes); if (get_struct(pid, (void *)args[sc->offset], pfd, bytes) != -1) { fputs("{", fp); for (i = 0; i < numfds; i++) { fprintf(fp, " %d/%s", pfd[i].fd, xlookup_bits(poll_flags, pfd[i].events)); } fputs(" }", fp); } else { fprintf(fp, "0x%lx", args[sc->offset]); } free(pfd); break; } case Fd_set: { /* * XXX: A Fd_set argument expects the /first/ syscall argument * to be the number of fds in the array. This matches the * select syscall. */ fd_set *fds; int numfds = args[0]; size_t bytes = _howmany(numfds, _NFDBITS) * _NFDBITS; int i; if ((fds = malloc(bytes)) == NULL) err(1, "Cannot malloc %zu bytes for fd_set array", bytes); if (get_struct(pid, (void *)args[sc->offset], fds, bytes) != -1) { fputs("{", fp); for (i = 0; i < numfds; i++) { if (FD_ISSET(i, fds)) fprintf(fp, " %d", i); } fputs(" }", fp); } else fprintf(fp, "0x%lx", args[sc->offset]); free(fds); break; } case Signal: fputs(strsig2(args[sc->offset]), fp); break; case Sigset: { long sig; sigset_t ss; int i, first; sig = args[sc->offset]; if (get_struct(pid, (void *)args[sc->offset], (void *)&ss, sizeof(ss)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } fputs("{ ", fp); first = 1; for (i = 1; i < sys_nsig; i++) { if (sigismember(&ss, i)) { fprintf(fp, "%s%s", !first ? "|" : "", strsig2(i)); first = 0; } } if (!first) fputc(' ', fp); fputc('}', fp); break; } case Sigprocmask: print_integer_arg(sysdecode_sigprocmask_how, fp, args[sc->offset]); break; case Fcntlflag: /* XXX: Output depends on the value of the previous argument. */ if (sysdecode_fcntl_arg_p(args[sc->offset - 1])) sysdecode_fcntl_arg(fp, args[sc->offset - 1], args[sc->offset], 16); break; case Open: print_mask_arg(sysdecode_open_flags, fp, args[sc->offset]); break; case Fcntl: print_integer_arg(sysdecode_fcntl_cmd, fp, args[sc->offset]); break; case Mprot: print_mask_arg(sysdecode_mmap_prot, fp, args[sc->offset]); break; case Mmapflags: print_mask_arg(sysdecode_mmap_flags, fp, args[sc->offset]); break; case Whence: print_integer_arg(sysdecode_whence, fp, args[sc->offset]); break; case Sockdomain: print_integer_arg(sysdecode_socketdomain, fp, args[sc->offset]); break; case Socktype: print_mask_arg(sysdecode_socket_type, fp, args[sc->offset]); break; case Shutdown: print_integer_arg(sysdecode_shutdown_how, fp, args[sc->offset]); break; case Resource: print_integer_arg(sysdecode_rlimit, fp, args[sc->offset]); break; case RusageWho: print_integer_arg(sysdecode_getrusage_who, fp, args[sc->offset]); break; case Pathconf: fputs(xlookup(pathconf_arg, args[sc->offset]), fp); break; case Rforkflags: print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); break; case Sockaddr: { char addr[64]; struct sockaddr_in *lsin; struct sockaddr_in6 *lsin6; struct sockaddr_un *sun; struct sockaddr *sa; socklen_t len; u_char *q; if (args[sc->offset] == 0) { fputs("NULL", fp); break; } /* * Extract the address length from the next argument. If * this is an output sockaddr (OUT is set), then the * next argument is a pointer to a socklen_t. Otherwise * the next argument contains a socklen_t by value. */ if (sc->type & OUT) { if (get_struct(pid, (void *)args[sc->offset + 1], &len, sizeof(len)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } } else len = args[sc->offset + 1]; /* If the length is too small, just bail. */ if (len < sizeof(*sa)) { fprintf(fp, "0x%lx", args[sc->offset]); break; } sa = calloc(1, len); if (get_struct(pid, (void *)args[sc->offset], sa, len) == -1) { free(sa); fprintf(fp, "0x%lx", args[sc->offset]); break; } switch (sa->sa_family) { case AF_INET: if (len < sizeof(*lsin)) goto sockaddr_short; lsin = (struct sockaddr_in *)(void *)sa; inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); fprintf(fp, "{ AF_INET %s:%d }", addr, htons(lsin->sin_port)); break; case AF_INET6: if (len < sizeof(*lsin6)) goto sockaddr_short; lsin6 = (struct sockaddr_in6 *)(void *)sa; inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, sizeof(addr)); fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, htons(lsin6->sin6_port)); break; case AF_UNIX: sun = (struct sockaddr_un *)sa; fprintf(fp, "{ AF_UNIX \"%.*s\" }", (int)(len - offsetof(struct sockaddr_un, sun_path)), sun->sun_path); break; default: sockaddr_short: fprintf(fp, "{ sa_len = %d, sa_family = %d, sa_data = {", (int)sa->sa_len, (int)sa->sa_family); for (q = (u_char *)sa->sa_data; q < (u_char *)sa + len; q++) fprintf(fp, "%s 0x%02x", q == (u_char *)sa->sa_data ? "" : ",", *q); fputs(" } }", fp); } free(sa); break; } case Sigaction: { struct sigaction sa; if (get_struct(pid, (void *)args[sc->offset], &sa, sizeof(sa)) != -1) { fputs("{ ", fp); if (sa.sa_handler == SIG_DFL) fputs("SIG_DFL", fp); else if (sa.sa_handler == SIG_IGN) fputs("SIG_IGN", fp); else fprintf(fp, "%p", sa.sa_handler); fprintf(fp, " %s ss_t }", xlookup_bits(sigaction_flags, sa.sa_flags)); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Kevent: { /* * XXX XXX: The size of the array is determined by either the * next syscall argument, or by the syscall return value, * depending on which argument number we are. This matches the * kevent syscall, but luckily that's the only syscall that uses * them. */ struct kevent *ke; int numevents = -1; size_t bytes; int i; if (sc->offset == 1) numevents = args[sc->offset+1]; else if (sc->offset == 3 && retval[0] != -1) numevents = retval[0]; if (numevents >= 0) { bytes = sizeof(struct kevent) * numevents; if ((ke = malloc(bytes)) == NULL) err(1, "Cannot malloc %zu bytes for kevent array", bytes); } else ke = NULL; if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset], ke, bytes) != -1) { fputc('{', fp); for (i = 0; i < numevents; i++) { fputc(' ', fp); print_kevent(fp, &ke[i], sc->offset == 1); } fputs(" }", fp); } else { fprintf(fp, "0x%lx", args[sc->offset]); } free(ke); break; } case Stat: { struct stat st; if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st)) != -1) { char mode[12]; strmode(st.st_mode, mode); fprintf(fp, "{ mode=%s,inode=%ju,size=%jd,blksize=%ld }", mode, (uintmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { fprintf(fp, "0x%lx", args[sc->offset]); } break; } case Stat11: { struct freebsd11_stat st; if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st)) != -1) { char mode[12]; strmode(st.st_mode, mode); fprintf(fp, "{ mode=%s,inode=%ju,size=%jd,blksize=%ld }", mode, (uintmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { fprintf(fp, "0x%lx", args[sc->offset]); } break; } case StatFs: { unsigned int i; struct statfs buf; if (get_struct(pid, (void *)args[sc->offset], &buf, sizeof(buf)) != -1) { char fsid[17]; bzero(fsid, sizeof(fsid)); if (buf.f_fsid.val[0] != 0 || buf.f_fsid.val[1] != 0) { for (i = 0; i < sizeof(buf.f_fsid); i++) snprintf(&fsid[i*2], sizeof(fsid) - (i*2), "%02x", ((u_char *)&buf.f_fsid)[i]); } fprintf(fp, "{ fstypename=%s,mntonname=%s,mntfromname=%s," "fsid=%s }", buf.f_fstypename, buf.f_mntonname, buf.f_mntfromname, fsid); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Rusage: { struct rusage ru; if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru)) != -1) { fprintf(fp, "{ u=%jd.%06ld,s=%jd.%06ld,in=%ld,out=%ld }", (intmax_t)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec, (intmax_t)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec, ru.ru_inblock, ru.ru_oublock); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Rlimit: { struct rlimit rl; if (get_struct(pid, (void *)args[sc->offset], &rl, sizeof(rl)) != -1) { fprintf(fp, "{ cur=%ju,max=%ju }", rl.rlim_cur, rl.rlim_max); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case ExitStatus: { int status; if (get_struct(pid, (void *)args[sc->offset], &status, sizeof(status)) != -1) { fputs("{ ", fp); if (WIFCONTINUED(status)) fputs("CONTINUED", fp); else if (WIFEXITED(status)) fprintf(fp, "EXITED,val=%d", WEXITSTATUS(status)); else if (WIFSIGNALED(status)) fprintf(fp, "SIGNALED,sig=%s%s", strsig2(WTERMSIG(status)), WCOREDUMP(status) ? ",cored" : ""); else fprintf(fp, "STOPPED,sig=%s", strsig2(WTERMSIG(status))); fputs(" }", fp); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Waitoptions: print_mask_arg(sysdecode_wait6_options, fp, args[sc->offset]); break; case Idtype: print_integer_arg(sysdecode_idtype, fp, args[sc->offset]); break; case Procctl: print_integer_arg(sysdecode_procctl_cmd, fp, args[sc->offset]); break; case Umtxop: print_integer_arg(sysdecode_umtx_op, fp, args[sc->offset]); break; case Atfd: print_integer_arg(sysdecode_atfd, fp, args[sc->offset]); break; case Atflags: fputs(xlookup_bits(at_flags, args[sc->offset]), fp); break; case Accessmode: print_mask_arg(sysdecode_access_mode, fp, args[sc->offset]); break; case Sysarch: fputs(xlookup(sysarch_ops, args[sc->offset]), fp); break; case PipeFds: /* * The pipe() system call in the kernel returns its * two file descriptors via return values. However, * the interface exposed by libc is that pipe() * accepts a pointer to an array of descriptors. * Format the output to match the libc API by printing * the returned file descriptors as a fake argument. * * Overwrite the first retval to signal a successful * return as well. */ fprintf(fp, "{ %ld, %ld }", retval[0], retval[1]); retval[0] = 0; break; case Utrace: { size_t len; void *utrace_addr; len = args[sc->offset + 1]; utrace_addr = calloc(1, len); if (get_struct(pid, (void *)args[sc->offset], (void *)utrace_addr, len) != -1) print_utrace(fp, utrace_addr, len); else fprintf(fp, "0x%lx", args[sc->offset]); free(utrace_addr); break; } case IntArray: { int descriptors[16]; unsigned long i, ndescriptors; bool truncated; ndescriptors = args[sc->offset + 1]; truncated = false; if (ndescriptors > nitems(descriptors)) { ndescriptors = nitems(descriptors); truncated = true; } if (get_struct(pid, (void *)args[sc->offset], descriptors, ndescriptors * sizeof(descriptors[0])) != -1) { fprintf(fp, "{"); for (i = 0; i < ndescriptors; i++) fprintf(fp, i == 0 ? " %d" : ", %d", descriptors[i]); fprintf(fp, truncated ? ", ... }" : " }"); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Pipe2: print_mask_arg(sysdecode_pipe2_flags, fp, args[sc->offset]); break; case CapFcntlRights: { uint32_t rights; if (sc->type & OUT) { if (get_struct(pid, (void *)args[sc->offset], &rights, sizeof(rights)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } } else rights = args[sc->offset]; print_mask_arg32(sysdecode_cap_fcntlrights, fp, rights); break; } case Fadvice: print_integer_arg(sysdecode_fadvice, fp, args[sc->offset]); break; case FileFlags: { fflags_t rem; if (!sysdecode_fileflags(fp, args[sc->offset], &rem)) fprintf(fp, "0x%x", rem); else if (rem != 0) fprintf(fp, "|0x%x", rem); break; } case Flockop: print_mask_arg(sysdecode_flock_operation, fp, args[sc->offset]); break; case Getfsstatmode: print_integer_arg(sysdecode_getfsstat_mode, fp, args[sc->offset]); break; case Kldsymcmd: print_integer_arg(sysdecode_kldsym_cmd, fp, args[sc->offset]); break; case Kldunloadflags: print_integer_arg(sysdecode_kldunload_flags, fp, args[sc->offset]); break; case Madvice: print_integer_arg(sysdecode_madvice, fp, args[sc->offset]); break; case Socklent: fprintf(fp, "%u", (socklen_t)args[sc->offset]); break; case Sockprotocol: { const char *temp; int domain, protocol; domain = args[sc->offset - 2]; protocol = args[sc->offset]; if (protocol == 0) { fputs("0", fp); } else { temp = sysdecode_socket_protocol(domain, protocol); if (temp) { fputs(temp, fp); } else { fprintf(fp, "%d", protocol); } } break; } case Sockoptlevel: print_integer_arg(sysdecode_sockopt_level, fp, args[sc->offset]); break; case Sockoptname: { const char *temp; int level, name; level = args[sc->offset - 1]; name = args[sc->offset]; temp = sysdecode_sockopt_name(level, name); if (temp) { fputs(temp, fp); } else { fprintf(fp, "%d", name); } break; } case Msgflags: print_mask_arg(sysdecode_msg_flags, fp, args[sc->offset]); break; case CapRights: { cap_rights_t rights; if (get_struct(pid, (void *)args[sc->offset], &rights, sizeof(rights)) != -1) { fputs("{ ", fp); sysdecode_cap_rights(fp, &rights); fputs(" }", fp); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case Acltype: print_integer_arg(sysdecode_acltype, fp, args[sc->offset]); break; case Extattrnamespace: print_integer_arg(sysdecode_extattrnamespace, fp, args[sc->offset]); break; case Minherit: print_integer_arg(sysdecode_minherit_inherit, fp, args[sc->offset]); break; case Mlockall: print_mask_arg(sysdecode_mlockall_flags, fp, args[sc->offset]); break; case Mountflags: print_mask_arg(sysdecode_mount_flags, fp, args[sc->offset]); break; case Msync: print_mask_arg(sysdecode_msync_flags, fp, args[sc->offset]); break; case Priowhich: print_integer_arg(sysdecode_prio_which, fp, args[sc->offset]); break; case Ptraceop: print_integer_arg(sysdecode_ptrace_request, fp, args[sc->offset]); break; case Quotactlcmd: if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) fprintf(fp, "%#x", (int)args[sc->offset]); break; case Reboothowto: print_mask_arg(sysdecode_reboot_howto, fp, args[sc->offset]); break; case Rtpriofunc: print_integer_arg(sysdecode_rtprio_function, fp, args[sc->offset]); break; case Schedpolicy: print_integer_arg(sysdecode_scheduler_policy, fp, args[sc->offset]); break; case Schedparam: { struct sched_param sp; if (get_struct(pid, (void *)args[sc->offset], &sp, sizeof(sp)) != -1) fprintf(fp, "{ %d }", sp.sched_priority); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp); break; case CloudABIClockID: fputs(xlookup(cloudabi_clockid, args[sc->offset]), fp); break; case ClouduABIFDSFlags: fputs(xlookup_bits(cloudabi_fdsflags, args[sc->offset]), fp); break; case CloudABIFDStat: { cloudabi_fdstat_t fds; if (get_struct(pid, (void *)args[sc->offset], &fds, sizeof(fds)) != -1) { fprintf(fp, "{ %s, ", xlookup(cloudabi_filetype, fds.fs_filetype)); fprintf(fp, "%s, ... }", xlookup_bits(cloudabi_fdflags, fds.fs_flags)); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case CloudABIFileStat: { cloudabi_filestat_t fsb; if (get_struct(pid, (void *)args[sc->offset], &fsb, sizeof(fsb)) != -1) fprintf(fp, "{ %s, %ju }", xlookup(cloudabi_filetype, fsb.st_filetype), (uintmax_t)fsb.st_size); else fprintf(fp, "0x%lx", args[sc->offset]); break; } case CloudABIFileType: fputs(xlookup(cloudabi_filetype, args[sc->offset]), fp); break; case CloudABIFSFlags: fputs(xlookup_bits(cloudabi_fsflags, args[sc->offset]), fp); break; case CloudABILookup: if ((args[sc->offset] & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0) fprintf(fp, "%d|LOOKUP_SYMLINK_FOLLOW", (int)args[sc->offset]); else fprintf(fp, "%d", (int)args[sc->offset]); break; case CloudABIMFlags: fputs(xlookup_bits(cloudabi_mflags, args[sc->offset]), fp); break; case CloudABIMProt: fputs(xlookup_bits(cloudabi_mprot, args[sc->offset]), fp); break; case CloudABIMSFlags: fputs(xlookup_bits(cloudabi_msflags, args[sc->offset]), fp); break; case CloudABIOFlags: fputs(xlookup_bits(cloudabi_oflags, args[sc->offset]), fp); break; case CloudABISDFlags: fputs(xlookup_bits(cloudabi_sdflags, args[sc->offset]), fp); break; case CloudABISignal: fputs(xlookup(cloudabi_signal, args[sc->offset]), fp); break; case CloudABISockStat: { cloudabi_sockstat_t ss; if (get_struct(pid, (void *)args[sc->offset], &ss, sizeof(ss)) != -1) { fprintf(fp, "%s, ", xlookup( cloudabi_errno, ss.ss_error)); fprintf(fp, "%s }", xlookup_bits( cloudabi_ssstate, ss.ss_state)); } else fprintf(fp, "0x%lx", args[sc->offset]); break; } case CloudABISSFlags: fputs(xlookup_bits(cloudabi_ssflags, args[sc->offset]), fp); break; case CloudABITimestamp: fprintf(fp, "%lu.%09lus", args[sc->offset] / 1000000000, args[sc->offset] % 1000000000); break; case CloudABIULFlags: fputs(xlookup_bits(cloudabi_ulflags, args[sc->offset]), fp); break; case CloudABIWhence: fputs(xlookup(cloudabi_whence, args[sc->offset]), fp); break; default: errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK); } fclose(fp); return (tmp); } /* * Print (to outfile) the system call and its arguments. */ void print_syscall(struct trussinfo *trussinfo) { struct threadinfo *t; const char *name; char **s_args; int i, len, nargs; t = trussinfo->curthread; name = t->cs.sc->name; nargs = t->cs.nargs; s_args = t->cs.s_args; len = print_line_prefix(trussinfo); len += fprintf(trussinfo->outfile, "%s(", name); for (i = 0; i < nargs; i++) { if (s_args[i] != NULL) len += fprintf(trussinfo->outfile, "%s", s_args[i]); else len += fprintf(trussinfo->outfile, ""); len += fprintf(trussinfo->outfile, "%s", i < (nargs - 1) ? "," : ""); } len += fprintf(trussinfo->outfile, ")"); for (i = 0; i < 6 - (len / 8); i++) fprintf(trussinfo->outfile, "\t"); } void print_syscall_ret(struct trussinfo *trussinfo, int errorp, long *retval) { struct timespec timediff; struct threadinfo *t; struct syscall *sc; int error; t = trussinfo->curthread; sc = t->cs.sc; if (trussinfo->flags & COUNTONLY) { timespecsubt(&t->after, &t->before, &timediff); timespecadd(&sc->time, &timediff, &sc->time); sc->ncalls++; if (errorp) sc->nerror++; return; } print_syscall(trussinfo); fflush(trussinfo->outfile); if (retval == NULL) { /* * This system call resulted in the current thread's exit, * so there is no return value or error to display. */ fprintf(trussinfo->outfile, "\n"); return; } if (errorp) { error = sysdecode_abi_to_freebsd_errno(t->proc->abi->abi, retval[0]); fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0], error == INT_MAX ? "Unknown error" : strerror(error)); } #ifndef __LP64__ else if (sc->ret_type == 2) { off_t off; #if _BYTE_ORDER == _LITTLE_ENDIAN off = (off_t)retval[1] << 32 | retval[0]; #else off = (off_t)retval[0] << 32 | retval[1]; #endif fprintf(trussinfo->outfile, " = %jd (0x%jx)\n", (intmax_t)off, (intmax_t)off); } #endif else fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval[0], retval[0]); } void print_summary(struct trussinfo *trussinfo) { struct timespec total = {0, 0}; struct syscall *sc; int ncall, nerror; fprintf(trussinfo->outfile, "%-20s%15s%8s%8s\n", "syscall", "seconds", "calls", "errors"); ncall = nerror = 0; STAILQ_FOREACH(sc, &syscalls, entries) if (sc->ncalls) { fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", sc->name, (intmax_t)sc->time.tv_sec, sc->time.tv_nsec, sc->ncalls, sc->nerror); timespecadd(&total, &sc->time, &total); ncall += sc->ncalls; nerror += sc->nerror; } fprintf(trussinfo->outfile, "%20s%15s%8s%8s\n", "", "-------------", "-------", "-------"); fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", "", (intmax_t)total.tv_sec, total.tv_nsec, ncall, nerror); }