Import the new automatically generated system call table for CloudABI.

Now that we've switched over to using the vDSO on CloudABI, it becomes a
lot easier for us to phase out old features. System call numbering is no
longer something that's part of the ABI. It's fully based on names. As
long as the numbering used by the kernel and the vDSO is consistent
(which it always is), it's all right.

Let's put this to the test by removing a system call (thread_tcb_set())
that's already unused for quite some time now, but was only left intact
to serve as a placeholder. Sync in the new system call table that uses
alphabetic sorting of system calls.

Obtained from:	https://github.com/NuxiNL/cloudabi
This commit is contained in:
ed 2016-08-19 17:49:35 +00:00
parent 66478f22b3
commit 3b685ef4b9
14 changed files with 2914 additions and 3728 deletions

View File

@ -59,14 +59,6 @@ cloudabi_sys_thread_exit(struct thread *td,
/* NOTREACHED */
}
int
cloudabi_sys_thread_tcb_set(struct thread *td,
struct cloudabi_sys_thread_tcb_set_args *uap)
{
return (cpu_set_user_tls(td, uap->tcb));
}
int
cloudabi_sys_thread_yield(struct thread *td,
struct cloudabi_sys_thread_yield_args *uap)

View File

@ -8,7 +8,7 @@ sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \
cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \
cloudabi64_syscalls.c cloudabi64_systrace_args.c: \
../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \
../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \
syscalls.conf
sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \
sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \
syscalls.conf

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed
* created from FreeBSD
*/
#ifndef _CLOUDABI64_SYSPROTO_H_
@ -236,6 +236,14 @@ struct cloudabi64_sys_poll_args {
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 nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)];
char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)];
char nout_l_[PADL_(size_t)]; size_t nout; char nout_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 *)];
@ -302,20 +310,9 @@ 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_tcb_set_args {
char tcb_l_[PADL_(void *)]; void * tcb; char tcb_r_[PADR_(void *)];
};
struct cloudabi_sys_thread_yield_args {
register_t dummy;
};
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 nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)];
char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)];
char nout_l_[PADL_(size_t)]; size_t nout; char nout_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 *)];
};
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 *);
@ -356,6 +353,7 @@ int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *);
int cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_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 *);
@ -371,9 +369,7 @@ int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdow
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_tcb_set(struct thread *, struct cloudabi_sys_thread_tcb_set_args *);
int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *);
int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *);
#ifdef COMPAT_43
@ -398,6 +394,12 @@ int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *
#endif /* COMPAT_FREEBSD7 */
#ifdef COMPAT_FREEBSD10
#endif /* COMPAT_FREEBSD10 */
#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
@ -438,6 +440,7 @@ int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unlock 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
@ -453,9 +456,7 @@ int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *
#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_tcb_set AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL
#undef PAD_
#undef PADL_

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed
* created from FreeBSD
*/
#define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0
@ -46,22 +46,21 @@
#define CLOUDABI64_SYS_cloudabi_sys_mem_unlock 37
#define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 38
#define CLOUDABI64_SYS_cloudabi64_sys_poll 39
#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 40
#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 41
#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 42
#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 43
#define CLOUDABI64_SYS_cloudabi_sys_random_get 44
#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 45
#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 46
#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 47
#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 48
#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 49
#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 50
#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 51
#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 52
#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 53
#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 54
#define CLOUDABI64_SYS_cloudabi_sys_thread_tcb_set 55
#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 40
#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 41
#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 42
#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 43
#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 44
#define CLOUDABI64_SYS_cloudabi_sys_random_get 45
#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 46
#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 47
#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 48
#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 49
#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 50
#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 51
#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 52
#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 53
#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 54
#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 55
#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 56
#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 57
#define CLOUDABI64_SYS_MAXSYSCALL 58
#define CLOUDABI64_SYS_MAXSYSCALL 57

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed
* created from FreeBSD
*/
const char *cloudabi64_syscallnames[] = {
@ -47,22 +47,21 @@ const char *cloudabi64_syscallnames[] = {
"cloudabi_sys_mem_unlock", /* 37 = cloudabi_sys_mem_unlock */
"cloudabi_sys_mem_unmap", /* 38 = cloudabi_sys_mem_unmap */
"cloudabi64_sys_poll", /* 39 = cloudabi64_sys_poll */
"cloudabi_sys_proc_exec", /* 40 = cloudabi_sys_proc_exec */
"cloudabi_sys_proc_exit", /* 41 = cloudabi_sys_proc_exit */
"cloudabi_sys_proc_fork", /* 42 = cloudabi_sys_proc_fork */
"cloudabi_sys_proc_raise", /* 43 = cloudabi_sys_proc_raise */
"cloudabi_sys_random_get", /* 44 = cloudabi_sys_random_get */
"cloudabi_sys_sock_accept", /* 45 = cloudabi_sys_sock_accept */
"cloudabi_sys_sock_bind", /* 46 = cloudabi_sys_sock_bind */
"cloudabi_sys_sock_connect", /* 47 = cloudabi_sys_sock_connect */
"cloudabi_sys_sock_listen", /* 48 = cloudabi_sys_sock_listen */
"cloudabi64_sys_sock_recv", /* 49 = cloudabi64_sys_sock_recv */
"cloudabi64_sys_sock_send", /* 50 = cloudabi64_sys_sock_send */
"cloudabi_sys_sock_shutdown", /* 51 = cloudabi_sys_sock_shutdown */
"cloudabi_sys_sock_stat_get", /* 52 = cloudabi_sys_sock_stat_get */
"cloudabi64_sys_thread_create", /* 53 = cloudabi64_sys_thread_create */
"cloudabi_sys_thread_exit", /* 54 = cloudabi_sys_thread_exit */
"cloudabi_sys_thread_tcb_set", /* 55 = cloudabi_sys_thread_tcb_set */
"cloudabi64_sys_poll_fd", /* 40 = cloudabi64_sys_poll_fd */
"cloudabi_sys_proc_exec", /* 41 = cloudabi_sys_proc_exec */
"cloudabi_sys_proc_exit", /* 42 = cloudabi_sys_proc_exit */
"cloudabi_sys_proc_fork", /* 43 = cloudabi_sys_proc_fork */
"cloudabi_sys_proc_raise", /* 44 = cloudabi_sys_proc_raise */
"cloudabi_sys_random_get", /* 45 = cloudabi_sys_random_get */
"cloudabi_sys_sock_accept", /* 46 = cloudabi_sys_sock_accept */
"cloudabi_sys_sock_bind", /* 47 = cloudabi_sys_sock_bind */
"cloudabi_sys_sock_connect", /* 48 = cloudabi_sys_sock_connect */
"cloudabi_sys_sock_listen", /* 49 = cloudabi_sys_sock_listen */
"cloudabi64_sys_sock_recv", /* 50 = cloudabi64_sys_sock_recv */
"cloudabi64_sys_sock_send", /* 51 = cloudabi64_sys_sock_send */
"cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */
"cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */
"cloudabi64_sys_thread_create", /* 54 = cloudabi64_sys_thread_create */
"cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */
"cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */
"cloudabi64_sys_poll_fd", /* 57 = cloudabi64_sys_poll_fd */
};

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed
* created from FreeBSD
*/
#include <sys/sysent.h>
@ -55,22 +55,21 @@ struct sysent cloudabi64_sysent[] = {
{ AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */
{ AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = 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 }, /* 39 = cloudabi64_sys_poll */
{ AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = 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 }, /* 41 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = 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 }, /* 43 = 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 }, /* 44 = 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 }, /* 45 = 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 }, /* 46 = 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 }, /* 47 = 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 }, /* 48 = 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 }, /* 49 = 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 }, /* 50 = 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 }, /* 51 = 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 }, /* 52 = 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 }, /* 53 = 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 }, /* 54 = cloudabi_sys_thread_exit */
{ AS(cloudabi_sys_thread_tcb_set_args), (sy_call_t *)cloudabi_sys_thread_tcb_set, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_tcb_set */
{ AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = 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 }, /* 41 = 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 }, /* 42 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = 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 }, /* 44 = 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 }, /* 45 = 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 }, /* 46 = 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 }, /* 47 = 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 }, /* 48 = 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 }, /* 49 = 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 }, /* 50 = 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 }, /* 51 = 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 }, /* 52 = 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 }, /* 53 = 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 }, /* 54 = 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 }, /* 55 = cloudabi_sys_thread_exit */
{ 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */
{ AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 57 = cloudabi64_sys_poll_fd */
};

View File

@ -373,8 +373,20 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
/* cloudabi_sys_proc_exec */
/* cloudabi64_sys_poll_fd */
case 40: {
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->nin; /* size_t */
uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */
uarg[4] = p->nout; /* size_t */
uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */
*n_args = 6;
break;
}
/* cloudabi_sys_proc_exec */
case 41: {
struct cloudabi_sys_proc_exec_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->data; /* const void * */
@ -385,26 +397,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_proc_exit */
case 41: {
case 42: {
struct cloudabi_sys_proc_exit_args *p = params;
iarg[0] = p->rval; /* cloudabi_exitcode_t */
*n_args = 1;
break;
}
/* cloudabi_sys_proc_fork */
case 42: {
case 43: {
*n_args = 0;
break;
}
/* cloudabi_sys_proc_raise */
case 43: {
case 44: {
struct cloudabi_sys_proc_raise_args *p = params;
iarg[0] = p->sig; /* cloudabi_signal_t */
*n_args = 1;
break;
}
/* cloudabi_sys_random_get */
case 44: {
case 45: {
struct cloudabi_sys_random_get_args *p = params;
uarg[0] = (intptr_t) p->buf; /* void * */
uarg[1] = p->nbyte; /* size_t */
@ -412,7 +424,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_accept */
case 45: {
case 46: {
struct cloudabi_sys_sock_accept_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */
@ -420,7 +432,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_bind */
case 46: {
case 47: {
struct cloudabi_sys_sock_bind_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -430,7 +442,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_connect */
case 47: {
case 48: {
struct cloudabi_sys_sock_connect_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -440,7 +452,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_listen */
case 48: {
case 49: {
struct cloudabi_sys_sock_listen_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->backlog; /* cloudabi_backlog_t */
@ -448,7 +460,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_sock_recv */
case 49: {
case 50: {
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 * */
@ -457,7 +469,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_sock_send */
case 50: {
case 51: {
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 * */
@ -466,7 +478,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_shutdown */
case 51: {
case 52: {
struct cloudabi_sys_sock_shutdown_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->how; /* cloudabi_sdflags_t */
@ -474,7 +486,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_stat_get */
case 52: {
case 53: {
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 * */
@ -483,44 +495,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_thread_create */
case 53: {
case 54: {
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 54: {
case 55: {
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_tcb_set */
case 55: {
struct cloudabi_sys_thread_tcb_set_args *p = params;
uarg[0] = (intptr_t) p->tcb; /* void * */
*n_args = 1;
break;
}
/* cloudabi_sys_thread_yield */
case 56: {
*n_args = 0;
break;
}
/* cloudabi64_sys_poll_fd */
case 57: {
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->nin; /* size_t */
uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */
uarg[4] = p->nout; /* size_t */
uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */
*n_args = 6;
break;
}
default:
*n_args = 0;
break;
@ -1177,227 +1170,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_proc_exec */
case 40:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const void *";
break;
case 2:
p = "size_t";
break;
case 3:
p = "const cloudabi_fd_t *";
break;
case 4:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_proc_exit */
case 41:
switch(ndx) {
case 0:
p = "cloudabi_exitcode_t";
break;
default:
break;
};
break;
/* cloudabi_sys_proc_fork */
case 42:
break;
/* cloudabi_sys_proc_raise */
case 43:
switch(ndx) {
case 0:
p = "cloudabi_signal_t";
break;
default:
break;
};
break;
/* cloudabi_sys_random_get */
case 44:
switch(ndx) {
case 0:
p = "void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_accept */
case 45:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_sockstat_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_bind */
case 46:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_fd_t";
break;
case 2:
p = "const char *";
break;
case 3:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_connect */
case 47:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_fd_t";
break;
case 2:
p = "const char *";
break;
case 3:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_listen */
case 48:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_backlog_t";
break;
default:
break;
};
break;
/* cloudabi64_sys_sock_recv */
case 49:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const cloudabi64_recv_in_t *";
break;
case 2:
p = "cloudabi64_recv_out_t *";
break;
default:
break;
};
break;
/* cloudabi64_sys_sock_send */
case 50:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const cloudabi64_send_in_t *";
break;
case 2:
p = "cloudabi64_send_out_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_shutdown */
case 51:
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 52:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_sockstat_t *";
break;
case 2:
p = "cloudabi_ssflags_t";
break;
default:
break;
};
break;
/* cloudabi64_sys_thread_create */
case 53:
switch(ndx) {
case 0:
p = "cloudabi64_threadattr_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_thread_exit */
case 54:
switch(ndx) {
case 0:
p = "cloudabi_lock_t *";
break;
case 1:
p = "cloudabi_scope_t";
break;
default:
break;
};
break;
/* cloudabi_sys_thread_tcb_set */
case 55:
switch(ndx) {
case 0:
p = "void *";
break;
default:
break;
};
break;
/* cloudabi_sys_thread_yield */
case 56:
break;
/* cloudabi64_sys_poll_fd */
case 57:
case 40:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1421,6 +1195,215 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_proc_exec */
case 41:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const void *";
break;
case 2:
p = "size_t";
break;
case 3:
p = "const cloudabi_fd_t *";
break;
case 4:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_proc_exit */
case 42:
switch(ndx) {
case 0:
p = "cloudabi_exitcode_t";
break;
default:
break;
};
break;
/* cloudabi_sys_proc_fork */
case 43:
break;
/* cloudabi_sys_proc_raise */
case 44:
switch(ndx) {
case 0:
p = "cloudabi_signal_t";
break;
default:
break;
};
break;
/* cloudabi_sys_random_get */
case 45:
switch(ndx) {
case 0:
p = "void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_accept */
case 46:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_sockstat_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_bind */
case 47:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_fd_t";
break;
case 2:
p = "const char *";
break;
case 3:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_connect */
case 48:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_fd_t";
break;
case 2:
p = "const char *";
break;
case 3:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_listen */
case 49:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_backlog_t";
break;
default:
break;
};
break;
/* cloudabi64_sys_sock_recv */
case 50:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const cloudabi64_recv_in_t *";
break;
case 2:
p = "cloudabi64_recv_out_t *";
break;
default:
break;
};
break;
/* cloudabi64_sys_sock_send */
case 51:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "const cloudabi64_send_in_t *";
break;
case 2:
p = "cloudabi64_send_out_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_shutdown */
case 52:
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 53:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "cloudabi_sockstat_t *";
break;
case 2:
p = "cloudabi_ssflags_t";
break;
default:
break;
};
break;
/* cloudabi64_sys_thread_create */
case 54:
switch(ndx) {
case 0:
p = "cloudabi64_threadattr_t *";
break;
default:
break;
};
break;
/* cloudabi_sys_thread_exit */
case 55:
switch(ndx) {
case 0:
p = "cloudabi_lock_t *";
break;
case 1:
p = "cloudabi_scope_t";
break;
default:
break;
};
break;
/* cloudabi_sys_thread_yield */
case 56:
break;
default:
break;
};
@ -1632,90 +1615,85 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
/* cloudabi_sys_proc_exec */
/* cloudabi64_sys_poll_fd */
case 40:
if (ndx == 0 || ndx == 1)
p = "void";
p = "size_t";
break;
/* cloudabi_sys_proc_exit */
/* cloudabi_sys_proc_exec */
case 41:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_proc_fork */
/* cloudabi_sys_proc_exit */
case 42:
/* cloudabi_sys_proc_raise */
case 43:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_random_get */
/* cloudabi_sys_proc_fork */
case 43:
/* cloudabi_sys_proc_raise */
case 44:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_accept */
/* cloudabi_sys_random_get */
case 45:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_accept */
case 46:
if (ndx == 0 || ndx == 1)
p = "cloudabi_fd_t";
break;
/* cloudabi_sys_sock_bind */
case 46:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_connect */
case 47:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_listen */
/* cloudabi_sys_sock_connect */
case 48:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_sock_recv */
/* cloudabi_sys_sock_listen */
case 49:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_sock_send */
/* cloudabi64_sys_sock_recv */
case 50:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_shutdown */
/* cloudabi64_sys_sock_send */
case 51:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_stat_get */
/* cloudabi_sys_sock_shutdown */
case 52:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_thread_create */
/* cloudabi_sys_sock_stat_get */
case 53:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_thread_create */
case 54:
if (ndx == 0 || ndx == 1)
p = "cloudabi_tid_t";
break;
/* cloudabi_sys_thread_exit */
case 54:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_thread_tcb_set */
case 55:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_thread_yield */
case 56:
/* cloudabi64_sys_poll_fd */
case 57:
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
default:
break;
};

View File

@ -31,11 +31,11 @@
#include "cloudabi_types_common.h"
typedef struct {
_Alignas(4) cloudabi_auxtype_t a_type;
union {
_Alignas(8) uint64_t a_val;
_Alignas(8) uint64_t a_ptr;
};
_Alignas(4) cloudabi_auxtype_t a_type;
union {
_Alignas(8) uint64_t a_val;
_Alignas(8) uint64_t a_ptr;
};
} cloudabi64_auxv_t;
_Static_assert(offsetof(cloudabi64_auxv_t, a_type) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_auxv_t, a_val) == 8, "Incorrect layout");
@ -44,58 +44,68 @@ _Static_assert(sizeof(cloudabi64_auxv_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t iov_base;
_Alignas(8) uint64_t iov_len;
_Alignas(8) uint64_t iov_base;
_Alignas(8) uint64_t iov_len;
} cloudabi64_ciovec_t;
_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_errno_t error;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
} clock;
struct {
_Alignas(8) uint64_t condvar;
} condvar;
struct {
_Alignas(8) cloudabi_filesize_t nbytes;
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_eventrwflags_t flags;
} fd_readwrite;
struct {
_Alignas(8) uint64_t lock;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(1) cloudabi_signal_t signal;
_Alignas(4) cloudabi_exitcode_t exitcode;
} proc_terminate;
};
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_errno_t error;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
} clock;
struct {
_Alignas(8) uint64_t condvar;
} condvar;
struct {
_Alignas(8) cloudabi_filesize_t nbytes;
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_eventrwflags_t flags;
} fd_readwrite;
struct {
_Alignas(8) uint64_t lock;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(1) cloudabi_signal_t signal;
_Alignas(4) cloudabi_exitcode_t exitcode;
} proc_terminate;
};
} cloudabi64_event_t;
_Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t iov_base;
_Alignas(8) uint64_t iov_len;
_Alignas(8) uint64_t iov_base;
_Alignas(8) uint64_t iov_len;
} cloudabi64_iovec_t;
_Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout");
@ -105,96 +115,120 @@ _Static_assert(_Alignof(cloudabi64_iovec_t) == 8, "Incorrect layout");
typedef void cloudabi64_processentry_t(uint64_t auxv);
typedef struct {
_Alignas(8) uint64_t ri_data;
_Alignas(8) uint64_t ri_datalen;
_Alignas(8) uint64_t ri_fds;
_Alignas(8) uint64_t ri_fdslen;
_Alignas(2) cloudabi_msgflags_t ri_flags;
_Alignas(8) uint64_t ri_data;
_Alignas(8) uint64_t ri_datalen;
_Alignas(8) uint64_t ri_fds;
_Alignas(8) uint64_t ri_fdslen;
_Alignas(2) cloudabi_msgflags_t ri_flags;
} cloudabi64_recv_in_t;
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t si_data;
_Alignas(8) uint64_t si_datalen;
_Alignas(8) uint64_t si_fds;
_Alignas(8) uint64_t si_fdslen;
_Alignas(2) cloudabi_msgflags_t si_flags;
_Alignas(8) uint64_t si_data;
_Alignas(8) uint64_t si_datalen;
_Alignas(8) uint64_t si_fds;
_Alignas(8) uint64_t si_fdslen;
_Alignas(2) cloudabi_msgflags_t si_flags;
} cloudabi64_send_in_t;
_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t so_datalen;
} cloudabi64_send_out_t;
_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout");
typedef struct { _Alignas(8) uint64_t so_datalen; } cloudabi64_send_out_t;
_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_subflags_t flags;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
_Alignas(4) cloudabi_clockid_t clock_id;
_Alignas(8) cloudabi_timestamp_t timeout;
_Alignas(8) cloudabi_timestamp_t precision;
_Alignas(2) cloudabi_subclockflags_t flags;
} clock;
struct {
_Alignas(8) uint64_t condvar;
_Alignas(8) uint64_t lock;
_Alignas(1) cloudabi_scope_t condvar_scope;
_Alignas(1) cloudabi_scope_t lock_scope;
} condvar;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_subrwflags_t flags;
} fd_readwrite;
struct {
_Alignas(8) uint64_t lock;
_Alignas(1) cloudabi_scope_t lock_scope;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
} proc_terminate;
};
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_subflags_t flags;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
_Alignas(4) cloudabi_clockid_t clock_id;
_Alignas(8) cloudabi_timestamp_t timeout;
_Alignas(8) cloudabi_timestamp_t precision;
_Alignas(2) cloudabi_subclockflags_t flags;
} clock;
struct {
_Alignas(8) uint64_t condvar;
_Alignas(8) uint64_t lock;
_Alignas(1) cloudabi_scope_t condvar_scope;
_Alignas(1) cloudabi_scope_t lock_scope;
} condvar;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_subrwflags_t flags;
} fd_readwrite;
struct {
_Alignas(8) uint64_t lock;
_Alignas(1) cloudabi_scope_t lock_scope;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
} proc_terminate;
};
} cloudabi64_subscription_t;
_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_subscription_t) == 56, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_subscription_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t parent;
} cloudabi64_tcb_t;
typedef struct { _Alignas(8) uint64_t parent; } cloudabi64_tcb_t;
_Static_assert(offsetof(cloudabi64_tcb_t, parent) == 0, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_tcb_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_tcb_t) == 8, "Incorrect layout");
@ -202,30 +236,39 @@ _Static_assert(_Alignof(cloudabi64_tcb_t) == 8, "Incorrect layout");
typedef void cloudabi64_threadentry_t(cloudabi_tid_t tid, uint64_t aux);
typedef struct {
_Alignas(8) uint64_t ro_datalen;
_Alignas(8) uint64_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
_Alignas(8) uint64_t ro_datalen;
_Alignas(8) uint64_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
} cloudabi64_recv_out_t;
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t entry_point;
_Alignas(8) uint64_t stack;
_Alignas(8) uint64_t stack_size;
_Alignas(8) uint64_t argument;
_Alignas(8) uint64_t entry_point;
_Alignas(8) uint64_t stack;
_Alignas(8) uint64_t stack_size;
_Alignas(8) uint64_t argument;
} cloudabi64_threadattr_t;
_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, stack_size) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, stack_size) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24,
"Incorrect layout");
_Static_assert(sizeof(cloudabi64_threadattr_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_threadattr_t) == 8, "Incorrect layout");

View File

@ -31,243 +31,383 @@
#include "cloudabi_types_common.h"
typedef struct {
_Alignas(4) cloudabi_auxtype_t a_type;
union {
size_t a_val;
void *a_ptr;
};
_Alignas(4) cloudabi_auxtype_t a_type;
union {
size_t a_val;
void *a_ptr;
};
} cloudabi_auxv_t;
_Static_assert(offsetof(cloudabi_auxv_t, a_type) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_val) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_val) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_ptr) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_ptr) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_auxv_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_auxv_t) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_auxv_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_auxv_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_val) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_val) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_auxv_t, a_ptr) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_auxv_t, a_ptr) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_auxv_t) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_auxv_t) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_auxv_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_auxv_t) == 8,
"Incorrect layout");
typedef struct {
const void *iov_base;
size_t iov_len;
const void *iov_base;
size_t iov_len;
} cloudabi_ciovec_t;
_Static_assert(offsetof(cloudabi_ciovec_t, iov_base) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_ciovec_t, iov_len) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_ciovec_t, iov_len) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_ciovec_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_ciovec_t) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_ciovec_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_ciovec_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_ciovec_t, iov_len) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_ciovec_t, iov_len) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_ciovec_t) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_ciovec_t) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_ciovec_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_ciovec_t) == 8,
"Incorrect layout");
typedef struct {
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_errno_t error;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
} clock;
struct {
_Atomic(cloudabi_condvar_t) *condvar;
} condvar;
struct {
_Alignas(8) cloudabi_filesize_t nbytes;
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_eventrwflags_t flags;
} fd_readwrite;
struct {
_Atomic(cloudabi_lock_t) *lock;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(1) cloudabi_signal_t signal;
_Alignas(4) cloudabi_exitcode_t exitcode;
} proc_terminate;
};
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_errno_t error;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
} clock;
struct {
_Atomic(cloudabi_condvar_t) * condvar;
} condvar;
struct {
_Alignas(8) cloudabi_filesize_t nbytes;
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_eventrwflags_t flags;
} fd_readwrite;
struct {
_Atomic(cloudabi_lock_t) * lock;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(1) cloudabi_signal_t signal;
_Alignas(4) cloudabi_exitcode_t exitcode;
} proc_terminate;
};
} cloudabi_event_t;
_Static_assert(offsetof(cloudabi_event_t, userdata) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, error) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, type) == 10, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, clock.identifier) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, condvar.condvar) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.fd) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.flags) == 28, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, clock.identifier) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, condvar.condvar) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.nbytes) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.fd) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.flags) == 28,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, lock.lock) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.signal) == 20, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.exitcode) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.fd) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.signal) == 20,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_event_t, proc_terminate.exitcode) == 24,
"Incorrect layout");
_Static_assert(sizeof(cloudabi_event_t) == 32, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_event_t) == 8, "Incorrect layout");
typedef struct {
void *iov_base;
size_t iov_len;
void *iov_base;
size_t iov_len;
} cloudabi_iovec_t;
_Static_assert(offsetof(cloudabi_iovec_t, iov_base) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_iovec_t, iov_len) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_iovec_t, iov_len) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_iovec_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_iovec_t) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_iovec_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_iovec_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_iovec_t, iov_len) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_iovec_t, iov_len) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_iovec_t) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_iovec_t) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_iovec_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_iovec_t) == 8,
"Incorrect layout");
typedef void cloudabi_processentry_t(const cloudabi_auxv_t *auxv);
typedef struct {
const cloudabi_iovec_t *ri_data;
size_t ri_datalen;
cloudabi_fd_t *ri_fds;
size_t ri_fdslen;
_Alignas(2) cloudabi_msgflags_t ri_flags;
const cloudabi_iovec_t *ri_data;
size_t ri_datalen;
cloudabi_fd_t *ri_fds;
size_t ri_fdslen;
_Alignas(2) cloudabi_msgflags_t ri_flags;
} cloudabi_recv_in_t;
_Static_assert(offsetof(cloudabi_recv_in_t, ri_data) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_datalen) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_datalen) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_fds) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_fds) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_fdslen) == 12, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_fdslen) == 24, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_flags) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_in_t, ri_flags) == 32, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_in_t) == 20, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_in_t) == 40, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_in_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_in_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_in_t, ri_datalen) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_in_t, ri_datalen) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_in_t, ri_fds) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_in_t, ri_fds) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_in_t, ri_fdslen) == 12,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_in_t, ri_fdslen) == 24,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_in_t, ri_flags) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_in_t, ri_flags) == 32,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_in_t) == 20,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_in_t) == 40,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_in_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_in_t) == 8,
"Incorrect layout");
typedef struct {
const cloudabi_ciovec_t *si_data;
size_t si_datalen;
const cloudabi_fd_t *si_fds;
size_t si_fdslen;
_Alignas(2) cloudabi_msgflags_t si_flags;
const cloudabi_ciovec_t *si_data;
size_t si_datalen;
const cloudabi_fd_t *si_fds;
size_t si_fdslen;
_Alignas(2) cloudabi_msgflags_t si_flags;
} cloudabi_send_in_t;
_Static_assert(offsetof(cloudabi_send_in_t, si_data) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_datalen) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_datalen) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_fds) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_fds) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_fdslen) == 12, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_fdslen) == 24, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_flags) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_send_in_t, si_flags) == 32, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_in_t) == 20, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_in_t) == 40, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_in_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_in_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_send_in_t, si_datalen) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_send_in_t, si_datalen) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_send_in_t, si_fds) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_send_in_t, si_fds) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_send_in_t, si_fdslen) == 12,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_send_in_t, si_fdslen) == 24,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_send_in_t, si_flags) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_send_in_t, si_flags) == 32,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_in_t) == 20,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_in_t) == 40,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_in_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_in_t) == 8,
"Incorrect layout");
typedef struct { size_t so_datalen; } cloudabi_send_out_t;
_Static_assert(offsetof(cloudabi_send_out_t, so_datalen) == 0,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_out_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_out_t) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_out_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_out_t) == 8,
"Incorrect layout");
typedef struct {
size_t so_datalen;
} cloudabi_send_out_t;
_Static_assert(offsetof(cloudabi_send_out_t, so_datalen) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_send_out_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_send_out_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_send_out_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_send_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_subflags_t flags;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
_Alignas(4) cloudabi_clockid_t clock_id;
_Alignas(8) cloudabi_timestamp_t timeout;
_Alignas(8) cloudabi_timestamp_t precision;
_Alignas(2) cloudabi_subclockflags_t flags;
} clock;
struct {
_Atomic(cloudabi_condvar_t) *condvar;
_Atomic(cloudabi_lock_t) *lock;
_Alignas(1) cloudabi_scope_t condvar_scope;
_Alignas(1) cloudabi_scope_t lock_scope;
} condvar;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_subrwflags_t flags;
} fd_readwrite;
struct {
_Atomic(cloudabi_lock_t) *lock;
_Alignas(1) cloudabi_scope_t lock_scope;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
} proc_terminate;
};
_Alignas(8) cloudabi_userdata_t userdata;
_Alignas(2) cloudabi_subflags_t flags;
_Alignas(1) cloudabi_eventtype_t type;
union {
struct {
_Alignas(8) cloudabi_userdata_t identifier;
_Alignas(4) cloudabi_clockid_t clock_id;
_Alignas(8) cloudabi_timestamp_t timeout;
_Alignas(8) cloudabi_timestamp_t precision;
_Alignas(2) cloudabi_subclockflags_t flags;
} clock;
struct {
_Atomic(cloudabi_condvar_t) * condvar;
_Atomic(cloudabi_lock_t) * lock;
_Alignas(1) cloudabi_scope_t condvar_scope;
_Alignas(1) cloudabi_scope_t lock_scope;
} condvar;
struct {
_Alignas(4) cloudabi_fd_t fd;
_Alignas(2) cloudabi_subrwflags_t flags;
} fd_readwrite;
struct {
_Atomic(cloudabi_lock_t) * lock;
_Alignas(1) cloudabi_scope_t lock_scope;
} lock;
struct {
_Alignas(4) cloudabi_fd_t fd;
} proc_terminate;
};
} cloudabi_subscription_t;
_Static_assert(offsetof(cloudabi_subscription_t, userdata) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, flags) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, type) == 10, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.identifier) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.clock_id) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.timeout) == 32, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.precision) == 40, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.flags) == 48, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, condvar.condvar) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.lock) == 20, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.lock) == 24, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.condvar_scope) == 24, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, condvar.lock_scope) == 25, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, condvar.lock_scope) == 33, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, lock.lock) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_subscription_t, lock.lock_scope) == 20, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_subscription_t, lock.lock_scope) == 24, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, proc_terminate.fd) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, userdata) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, flags) == 8,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, type) == 10,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.identifier) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.clock_id) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.timeout) == 32,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.precision) == 40,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, clock.flags) == 48,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, condvar.condvar) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_subscription_t, condvar.lock) == 20,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_subscription_t, condvar.lock) == 24,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_subscription_t, condvar.condvar_scope) ==
24,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_subscription_t, condvar.condvar_scope) ==
32,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_subscription_t, condvar.lock_scope) == 25,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_subscription_t, condvar.lock_scope) == 33,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.fd) == 16,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, fd_readwrite.flags) == 20,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, lock.lock) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_subscription_t, lock.lock_scope) == 20,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_subscription_t, lock.lock_scope) == 24,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_subscription_t, proc_terminate.fd) == 16,
"Incorrect layout");
_Static_assert(sizeof(cloudabi_subscription_t) == 56, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_subscription_t) == 8, "Incorrect layout");
typedef struct {
void *parent;
} cloudabi_tcb_t;
typedef struct { void *parent; } cloudabi_tcb_t;
_Static_assert(offsetof(cloudabi_tcb_t, parent) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_tcb_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_tcb_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_tcb_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_tcb_t) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_tcb_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_tcb_t) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_tcb_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_tcb_t) == 8,
"Incorrect layout");
typedef void cloudabi_threadentry_t(cloudabi_tid_t tid, void *aux);
typedef struct {
size_t ro_datalen;
size_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
size_t ro_datalen;
size_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
} cloudabi_recv_out_t;
_Static_assert(offsetof(cloudabi_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_fdslen) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_fdslen) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_sockname) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_sockname) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_peername) == 28, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_peername) == 36, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_recv_out_t, ro_flags) == 48, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_recv_out_t, ro_flags) == 56, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_out_t) == 52, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_out_t) == 64, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_out_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_out_t) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi_recv_out_t, ro_datalen) == 0,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_out_t, ro_fdslen) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_out_t, ro_fdslen) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_out_t, ro_sockname) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_out_t, ro_sockname) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_out_t, ro_peername) == 28,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_out_t, ro_peername) == 36,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_recv_out_t, ro_flags) == 48,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_recv_out_t, ro_flags) == 56,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_recv_out_t) == 52,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_recv_out_t) == 64,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_recv_out_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_recv_out_t) == 8,
"Incorrect layout");
typedef struct {
cloudabi_threadentry_t *entry_point;
void *stack;
size_t stack_size;
void *argument;
cloudabi_threadentry_t *entry_point;
void *stack;
size_t stack_size;
void *argument;
} cloudabi_threadattr_t;
_Static_assert(offsetof(cloudabi_threadattr_t, entry_point) == 0, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, stack) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, stack) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, stack_size) == 8, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, stack_size) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || offsetof(cloudabi_threadattr_t, argument) == 12, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || offsetof(cloudabi_threadattr_t, argument) == 24, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_threadattr_t) == 16, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_threadattr_t) == 32, "Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_threadattr_t) == 4, "Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_threadattr_t) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi_threadattr_t, entry_point) == 0,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_threadattr_t, stack) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_threadattr_t, stack) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_threadattr_t, stack_size) == 8,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_threadattr_t, stack_size) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 ||
offsetof(cloudabi_threadattr_t, argument) == 12,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 ||
offsetof(cloudabi_threadattr_t, argument) == 24,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || sizeof(cloudabi_threadattr_t) == 16,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || sizeof(cloudabi_threadattr_t) == 32,
"Incorrect layout");
_Static_assert(sizeof(void *) != 4 || _Alignof(cloudabi_threadattr_t) == 4,
"Incorrect layout");
_Static_assert(sizeof(void *) != 8 || _Alignof(cloudabi_threadattr_t) == 8,
"Incorrect layout");
#endif

View File

@ -38,34 +38,34 @@
#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_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
#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_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
#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_MONOTONIC 1
#define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2
#define CLOUDABI_CLOCK_REALTIME 3
#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4
#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
@ -76,110 +76,110 @@ 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_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_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
#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_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
#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_APPEND 0x0001
#define CLOUDABI_FDFLAG_DSYNC 0x0002
#define CLOUDABI_FDFLAG_NONBLOCK 0x0004
#define CLOUDABI_FDFLAG_RSYNC 0x0008
#define CLOUDABI_FDFLAG_SYNC 0x0010
#define CLOUDABI_FDFLAG_RSYNC 0x0008
#define CLOUDABI_FDFLAG_SYNC 0x0010
typedef uint16_t cloudabi_fdsflags_t;
#define CLOUDABI_FDSTAT_FLAGS 0x0001
#define CLOUDABI_FDSTAT_FLAGS 0x0001
#define CLOUDABI_FDSTAT_RIGHTS 0x0002
typedef int64_t cloudabi_filedelta_t;
@ -187,155 +187,155 @@ 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_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_SEQPACKET 129
#define CLOUDABI_FILETYPE_SOCKET_STREAM 130
#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144
#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 0x0001
#define CLOUDABI_FILESTAT_ATIM_NOW 0x0002
#define CLOUDABI_FILESTAT_MTIM 0x0004
#define CLOUDABI_FILESTAT_MTIM 0x0004
#define CLOUDABI_FILESTAT_MTIM_NOW 0x0008
#define CLOUDABI_FILESTAT_SIZE 0x0010
#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_UNLOCKED 0x00000000
#define CLOUDABI_LOCK_WRLOCKED 0x40000000
#define CLOUDABI_LOCK_KERNEL_MANAGED 0x80000000
#define CLOUDABI_LOCK_BOGUS 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_ANON 0x01
#define CLOUDABI_MAP_FIXED 0x02
#define CLOUDABI_MAP_PRIVATE 0x04
#define CLOUDABI_MAP_SHARED 0x08
#define CLOUDABI_MAP_SHARED 0x08
typedef uint8_t cloudabi_mprot_t;
#define CLOUDABI_PROT_EXEC 0x01
#define CLOUDABI_PROT_EXEC 0x01
#define CLOUDABI_PROT_WRITE 0x02
#define CLOUDABI_PROT_READ 0x04
#define CLOUDABI_PROT_READ 0x04
typedef uint8_t cloudabi_msflags_t;
#define CLOUDABI_MS_ASYNC 0x01
#define CLOUDABI_MS_ASYNC 0x01
#define CLOUDABI_MS_INVALIDATE 0x02
#define CLOUDABI_MS_SYNC 0x04
#define CLOUDABI_MS_SYNC 0x04
typedef uint16_t cloudabi_msgflags_t;
#define CLOUDABI_MSG_CTRUNC 0x0001
#define CLOUDABI_MSG_EOR 0x0002
#define CLOUDABI_MSG_PEEK 0x0004
#define CLOUDABI_MSG_TRUNC 0x0008
#define CLOUDABI_MSG_CTRUNC 0x0001
#define CLOUDABI_MSG_EOR 0x0002
#define CLOUDABI_MSG_PEEK 0x0004
#define CLOUDABI_MSG_TRUNC 0x0008
#define CLOUDABI_MSG_WAITALL 0x0010
typedef uint32_t cloudabi_nthreads_t;
typedef uint16_t cloudabi_oflags_t;
#define CLOUDABI_O_CREAT 0x0001
#define CLOUDABI_O_CREAT 0x0001
#define CLOUDABI_O_DIRECTORY 0x0002
#define CLOUDABI_O_EXCL 0x0004
#define CLOUDABI_O_TRUNC 0x0008
#define CLOUDABI_O_EXCL 0x0004
#define CLOUDABI_O_TRUNC 0x0008
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_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_SOCK_CONNECT_SOCKET 0x0000002000000000
#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000
#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000
#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000
typedef uint8_t cloudabi_sa_family_t;
#define CLOUDABI_AF_UNSPEC 0
#define CLOUDABI_AF_INET 1
#define CLOUDABI_AF_INET6 2
#define CLOUDABI_AF_UNIX 3
#define CLOUDABI_AF_INET 1
#define CLOUDABI_AF_INET6 2
#define CLOUDABI_AF_UNIX 3
typedef uint8_t cloudabi_scope_t;
#define CLOUDABI_SCOPE_PRIVATE 4
#define CLOUDABI_SCOPE_SHARED 8
#define CLOUDABI_SCOPE_SHARED 8
typedef uint8_t cloudabi_sdflags_t;
#define CLOUDABI_SHUT_RD 0x01
#define CLOUDABI_SHUT_WR 0x02
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_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
#define CLOUDABI_SIGXCPU 25
#define CLOUDABI_SIGXFSZ 26
typedef uint8_t cloudabi_ssflags_t;
#define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01
@ -347,11 +347,11 @@ 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_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_ENABLE 0x0010
#define CLOUDABI_SUBSCRIPTION_ONESHOT 0x0020
typedef uint16_t cloudabi_subrwflags_t;
@ -372,10 +372,10 @@ typedef uint8_t cloudabi_whence_t;
#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;
_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");
@ -385,42 +385,51 @@ _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;
_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_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(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;
_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(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;
_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");
@ -428,36 +437,45 @@ _Static_assert(sizeof(cloudabi_lookup_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_lookup_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(1) cloudabi_sa_family_t sa_family;
union {
struct {
_Alignas(1) uint8_t addr[4];
_Alignas(2) uint16_t port;
} sa_inet;
struct {
_Alignas(1) uint8_t addr[16];
_Alignas(2) uint16_t port;
} sa_inet6;
};
_Alignas(1) cloudabi_sa_family_t sa_family;
union {
struct {
_Alignas(1) uint8_t addr[4];
_Alignas(2) uint16_t port;
} sa_inet;
struct {
_Alignas(1) uint8_t addr[16];
_Alignas(2) uint16_t port;
} sa_inet6;
};
} cloudabi_sockaddr_t;
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18,
"Incorrect layout");
_Static_assert(sizeof(cloudabi_sockaddr_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_sockaddr_t) == 2, "Incorrect layout");
typedef struct {
_Alignas(2) cloudabi_sockaddr_t ss_sockname;
_Alignas(2) cloudabi_sockaddr_t ss_peername;
_Alignas(2) cloudabi_errno_t ss_error;
_Alignas(4) cloudabi_sstate_t ss_state;
_Alignas(2) cloudabi_sockaddr_t ss_sockname;
_Alignas(2) cloudabi_sockaddr_t ss_peername;
_Alignas(2) cloudabi_errno_t ss_error;
_Alignas(4) cloudabi_sstate_t ss_state;
} cloudabi_sockstat_t;
_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20, "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(offsetof(cloudabi_sockstat_t, ss_sockname) == 0,
"Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20,
"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");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -239,80 +239,77 @@
cloudabi64_event_t *out, \
size_t nsubscriptions); }
40 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
size_t datalen, \
const cloudabi_fd_t *fds, \
size_t fdslen); }
41 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
42 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
43 AUE_NULL STD { void cloudabi_sys_proc_raise( \
cloudabi_signal_t sig); }
44 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
size_t nbyte); }
45 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf); }
46 AUE_NULL STD { void cloudabi_sys_sock_bind( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t pathlen); }
47 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t pathlen); }
48 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
cloudabi_backlog_t backlog); }
49 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi64_recv_in_t *in, \
cloudabi64_recv_out_t *out); }
50 AUE_NULL STD { void cloudabi64_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi64_send_in_t *in, \
cloudabi64_send_out_t *out); }
51 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
52 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf, \
cloudabi_ssflags_t flags); }
53 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
cloudabi64_threadattr_t *attr); }
54 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
55 AUE_NULL STD { void cloudabi_sys_thread_tcb_set( \
void *tcb); }
56 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
57 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \
40 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \
cloudabi_fd_t fd, \
const cloudabi64_subscription_t *in, \
size_t nin, \
cloudabi64_event_t *out, \
size_t nout, \
const cloudabi64_subscription_t *timeout); }
41 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
size_t datalen, \
const cloudabi_fd_t *fds, \
size_t fdslen); }
42 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
43 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
44 AUE_NULL STD { void cloudabi_sys_proc_raise( \
cloudabi_signal_t sig); }
45 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
size_t nbyte); }
46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf); }
47 AUE_NULL STD { void cloudabi_sys_sock_bind( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t pathlen); }
48 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t pathlen); }
49 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
cloudabi_backlog_t backlog); }
50 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi64_recv_in_t *in, \
cloudabi64_recv_out_t *out); }
51 AUE_NULL STD { void cloudabi64_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi64_send_in_t *in, \
cloudabi64_send_out_t *out); }
52 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
53 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf, \
cloudabi_ssflags_t flags); }
54 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
cloudabi64_threadattr_t *attr); }
55 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
56 AUE_NULL STD { void cloudabi_sys_thread_yield(); }

View File

@ -495,8 +495,6 @@ static struct syscall decoded_syscalls[] = {
{ CloudABISSFlags, 2 } } },
{ .name = "cloudabi_sys_thread_exit", .ret_type = 1, .nargs = 2,
.args = { { Ptr, 0 }, { CloudABIMFlags, 1 } } },
{ .name = "cloudabi_sys_thread_tcb_set", .ret_type = 1, .nargs = 1,
.args = { { Ptr, 0 } } },
{ .name = "cloudabi_sys_thread_yield", .ret_type = 1, .nargs = 0 },
{ .name = 0 },