Catch up with changes to structure member names.
Pointer/length pairs are now always named ${name} and ${name}_len.
This commit is contained in:
parent
6b2747eca6
commit
be72efbdd4
@ -181,7 +181,7 @@ cloudabi32_thread_setregs(struct thread *td,
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size - sizeof(args);
|
||||
stack.ss_size = attr->stack_len - sizeof(args);
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
|
@ -164,7 +164,7 @@ cloudabi64_thread_setregs(struct thread *td,
|
||||
* from the top of the stack to store a single element array,
|
||||
* containing a pointer to the TCB. %fs base will point to this.
|
||||
*/
|
||||
tcbptr = rounddown(attr->stack + attr->stack_size - sizeof(tcbptr),
|
||||
tcbptr = rounddown(attr->stack + attr->stack_len - sizeof(tcbptr),
|
||||
_Alignof(tcbptr));
|
||||
error = copyout(&tcb, (void *)tcbptr, sizeof(tcb));
|
||||
if (error != 0)
|
||||
|
@ -148,7 +148,7 @@ cloudabi32_thread_setregs(struct thread *td,
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size;
|
||||
stack.ss_size = attr->stack_len;
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
|
@ -140,7 +140,7 @@ cloudabi64_thread_setregs(struct thread *td,
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size;
|
||||
stack.ss_size = attr->stack_len;
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
|
@ -146,7 +146,7 @@ cloudabi_sys_file_create(struct thread *td,
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -177,10 +177,10 @@ cloudabi_sys_file_link(struct thread *td,
|
||||
char *path1, *path2;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path1, uap->path1len, &path1);
|
||||
error = copyin_path(uap->path1, uap->path1_len, &path1);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = copyin_path(uap->path2, uap->path2len, &path2);
|
||||
error = copyin_path(uap->path2, uap->path2_len, &path2);
|
||||
if (error != 0) {
|
||||
cloudabi_freestr(path1);
|
||||
return (error);
|
||||
@ -261,7 +261,7 @@ cloudabi_sys_file_open(struct thread *td,
|
||||
fp->f_flag = fflags & FMASK;
|
||||
|
||||
/* Open path. */
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0) {
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
@ -380,7 +380,7 @@ cloudabi_sys_file_readdir(struct thread *td,
|
||||
{
|
||||
struct iovec iov = {
|
||||
.iov_base = uap->buf,
|
||||
.iov_len = uap->nbyte
|
||||
.iov_len = uap->buf_len
|
||||
};
|
||||
struct uio uio = {
|
||||
.uio_iov = &iov,
|
||||
@ -494,7 +494,7 @@ cloudabi_sys_file_readdir(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Return number of bytes copied to userspace. */
|
||||
td->td_retval[0] = uap->nbyte - uio.uio_resid;
|
||||
td->td_retval[0] = uap->buf_len - uio.uio_resid;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -505,12 +505,12 @@ cloudabi_sys_file_readlink(struct thread *td,
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE,
|
||||
uap->buf, UIO_USERSPACE, uap->bufsize);
|
||||
uap->buf, UIO_USERSPACE, uap->buf_len);
|
||||
cloudabi_freestr(path);
|
||||
return (error);
|
||||
}
|
||||
@ -522,16 +522,16 @@ cloudabi_sys_file_rename(struct thread *td,
|
||||
char *old, *new;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->old, uap->oldlen, &old);
|
||||
error = copyin_path(uap->path1, uap->path1_len, &old);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = copyin_path(uap->new, uap->newlen, &new);
|
||||
error = copyin_path(uap->path2, uap->path2_len, &new);
|
||||
if (error != 0) {
|
||||
cloudabi_freestr(old);
|
||||
return (error);
|
||||
}
|
||||
|
||||
error = kern_renameat(td, uap->oldfd, old, uap->newfd, new,
|
||||
error = kern_renameat(td, uap->fd1, old, uap->fd2, new,
|
||||
UIO_SYSSPACE);
|
||||
cloudabi_freestr(old);
|
||||
cloudabi_freestr(new);
|
||||
@ -653,7 +653,7 @@ cloudabi_sys_file_stat_get(struct thread *td,
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -707,7 +707,7 @@ cloudabi_sys_file_stat_put(struct thread *td,
|
||||
error = copyin(uap->buf, &fs, sizeof(fs));
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -726,10 +726,10 @@ cloudabi_sys_file_symlink(struct thread *td,
|
||||
char *path1, *path2;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path1, uap->path1len, &path1);
|
||||
error = copyin_path(uap->path1, uap->path1_len, &path1);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = copyin_path(uap->path2, uap->path2len, &path2);
|
||||
error = copyin_path(uap->path2, uap->path2_len, &path2);
|
||||
if (error != 0) {
|
||||
cloudabi_freestr(path1);
|
||||
return (error);
|
||||
@ -748,7 +748,7 @@ cloudabi_sys_file_unlink(struct thread *td,
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
error = copyin_path(uap->path, uap->pathlen, &path);
|
||||
error = copyin_path(uap->path, uap->path_len, &path);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
|
@ -63,8 +63,8 @@ cloudabi_sys_mem_advise(struct thread *td,
|
||||
struct cloudabi_sys_mem_advise_args *uap)
|
||||
{
|
||||
struct madvise_args madvise_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
switch (uap->advice) {
|
||||
@ -94,8 +94,8 @@ int
|
||||
cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap)
|
||||
{
|
||||
struct mlock_args mlock_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_mlock(td, &mlock_args));
|
||||
@ -135,8 +135,8 @@ cloudabi_sys_mem_protect(struct thread *td,
|
||||
struct cloudabi_sys_mem_protect_args *uap)
|
||||
{
|
||||
struct mprotect_args mprotect_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len,
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len,
|
||||
};
|
||||
int error;
|
||||
|
||||
@ -152,8 +152,8 @@ int
|
||||
cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap)
|
||||
{
|
||||
struct msync_args msync_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len,
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len,
|
||||
};
|
||||
|
||||
/* Convert flags. */
|
||||
@ -178,8 +178,8 @@ cloudabi_sys_mem_unlock(struct thread *td,
|
||||
struct cloudabi_sys_mem_unlock_args *uap)
|
||||
{
|
||||
struct munlock_args munlock_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_munlock(td, &munlock_args));
|
||||
@ -190,8 +190,8 @@ cloudabi_sys_mem_unmap(struct thread *td,
|
||||
struct cloudabi_sys_mem_unmap_args *uap)
|
||||
{
|
||||
struct munmap_args munmap_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_munmap(td, &munmap_args));
|
||||
|
@ -53,8 +53,8 @@ cloudabi_sys_proc_exec(struct thread *td,
|
||||
error = pre_execve(td, &oldvmspace);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = exec_copyin_data_fds(td, &args, uap->data, uap->datalen,
|
||||
uap->fds, uap->fdslen);
|
||||
error = exec_copyin_data_fds(td, &args, uap->data, uap->data_len,
|
||||
uap->fds, uap->fds_len);
|
||||
if (error == 0) {
|
||||
args.fd = uap->fd;
|
||||
error = kern_execve(td, &args, NULL);
|
||||
|
@ -38,7 +38,7 @@ cloudabi_sys_random_get(struct thread *td,
|
||||
{
|
||||
struct iovec iov = {
|
||||
.iov_base = uap->buf,
|
||||
.iov_len = uap->nbyte
|
||||
.iov_len = uap->buf_len
|
||||
};
|
||||
struct uio uio = {
|
||||
.uio_iov = &iov,
|
||||
|
@ -141,7 +141,7 @@ cloudabi_sys_sock_bind(struct thread *td,
|
||||
struct sockaddr_un sun;
|
||||
int error;
|
||||
|
||||
error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
|
||||
error = copyin_sockaddr_un(uap->path, uap->path_len, &sun);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun));
|
||||
@ -154,7 +154,7 @@ cloudabi_sys_sock_connect(struct thread *td,
|
||||
struct sockaddr_un sun;
|
||||
int error;
|
||||
|
||||
error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
|
||||
error = copyin_sockaddr_un(uap->path, uap->path_len, &sun);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
return (kern_connectat(td, uap->fd, uap->sock,
|
||||
|
@ -71,8 +71,8 @@ cloudabi32_copyinuio(const cloudabi32_iovec_t *iovp, size_t iovcnt,
|
||||
free(uio, M_IOV);
|
||||
return (error);
|
||||
}
|
||||
iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
iov[i].iov_len = iovobj.iov_len;
|
||||
iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
iov[i].iov_len = iovobj.buf_len;
|
||||
if (iov[i].iov_len > INT32_MAX - uio->uio_resid) {
|
||||
free(uio, M_IOV);
|
||||
return (EINVAL);
|
||||
@ -91,7 +91,7 @@ cloudabi32_sys_fd_pread(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio);
|
||||
error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_preadv(td, uap->fd, uio, uap->offset);
|
||||
@ -106,7 +106,7 @@ cloudabi32_sys_fd_pwrite(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
|
||||
error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_pwritev(td, uap->fd, uio, uap->offset);
|
||||
@ -121,7 +121,7 @@ cloudabi32_sys_fd_read(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio);
|
||||
error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_readv(td, uap->fd, uio);
|
||||
@ -136,7 +136,7 @@ cloudabi32_sys_fd_write(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
|
||||
error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_writev(td, uap->fd, uio);
|
||||
|
@ -398,11 +398,11 @@ cloudabi32_sys_poll_fd(struct thread *td,
|
||||
return (EINVAL);
|
||||
timeout.tv_sec = subtimo.clock.timeout / 1000000000;
|
||||
timeout.tv_nsec = subtimo.clock.timeout % 1000000000;
|
||||
return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops,
|
||||
&timeout));
|
||||
return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
|
||||
©ops, &timeout));
|
||||
} else {
|
||||
/* Poll without a timeout. */
|
||||
return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops,
|
||||
NULL));
|
||||
return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
|
||||
©ops, NULL));
|
||||
}
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ cloudabi32_sys_sock_recv(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Convert results in cloudabi_recv_in_t to struct msghdr. */
|
||||
if (ri.ri_datalen > UIO_MAXIOV)
|
||||
if (ri.ri_data_len > UIO_MAXIOV)
|
||||
return (EINVAL);
|
||||
msghdr.msg_iovlen = ri.ri_datalen;
|
||||
msghdr.msg_iovlen = ri.ri_data_len;
|
||||
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
|
||||
M_SOCKET, M_WAITOK);
|
||||
user_iov = TO_PTR(ri.ri_data);
|
||||
@ -74,8 +74,8 @@ cloudabi32_sys_sock_recv(struct thread *td,
|
||||
free(msghdr.msg_iov, M_SOCKET);
|
||||
return (error);
|
||||
}
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.iov_len;
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.buf_len;
|
||||
}
|
||||
msghdr.msg_name = &ss;
|
||||
msghdr.msg_namelen = sizeof(ss);
|
||||
@ -115,9 +115,9 @@ cloudabi32_sys_sock_send(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Convert results in cloudabi_send_in_t to struct msghdr. */
|
||||
if (si.si_datalen > UIO_MAXIOV)
|
||||
if (si.si_data_len > UIO_MAXIOV)
|
||||
return (EINVAL);
|
||||
msghdr.msg_iovlen = si.si_datalen;
|
||||
msghdr.msg_iovlen = si.si_data_len;
|
||||
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
|
||||
M_SOCKET, M_WAITOK);
|
||||
user_iov = TO_PTR(si.si_data);
|
||||
@ -127,8 +127,8 @@ cloudabi32_sys_sock_send(struct thread *td,
|
||||
free(msghdr.msg_iov, M_SOCKET);
|
||||
return (error);
|
||||
}
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.iov_len;
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.buf_len;
|
||||
}
|
||||
|
||||
flags = MSG_NOSIGNAL;
|
||||
|
@ -65,9 +65,9 @@ cloudabi32_sys_thread_create(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Remove some space on the top of the stack for the TCB. */
|
||||
args.tcb = rounddown(args.attr.stack + args.attr.stack_size -
|
||||
args.tcb = rounddown(args.attr.stack + args.attr.stack_len -
|
||||
sizeof(cloudabi32_tcb_t), _Alignof(cloudabi32_tcb_t));
|
||||
args.attr.stack_size = args.tcb - args.attr.stack;
|
||||
args.attr.stack_len = args.tcb - args.attr.stack;
|
||||
|
||||
error = thread_create(td, NULL, initialize_thread, &args);
|
||||
if (error != 0)
|
||||
|
@ -71,8 +71,8 @@ cloudabi64_copyinuio(const cloudabi64_iovec_t *iovp, size_t iovcnt,
|
||||
free(uio, M_IOV);
|
||||
return (error);
|
||||
}
|
||||
iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
iov[i].iov_len = iovobj.iov_len;
|
||||
iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
iov[i].iov_len = iovobj.buf_len;
|
||||
if (iov[i].iov_len > INT64_MAX - uio->uio_resid) {
|
||||
free(uio, M_IOV);
|
||||
return (EINVAL);
|
||||
@ -91,7 +91,7 @@ cloudabi64_sys_fd_pread(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio);
|
||||
error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_preadv(td, uap->fd, uio, uap->offset);
|
||||
@ -106,7 +106,7 @@ cloudabi64_sys_fd_pwrite(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
|
||||
error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_pwritev(td, uap->fd, uio, uap->offset);
|
||||
@ -121,7 +121,7 @@ cloudabi64_sys_fd_read(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio);
|
||||
error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_readv(td, uap->fd, uio);
|
||||
@ -136,7 +136,7 @@ cloudabi64_sys_fd_write(struct thread *td,
|
||||
struct uio *uio;
|
||||
int error;
|
||||
|
||||
error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio);
|
||||
error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_writev(td, uap->fd, uio);
|
||||
|
@ -398,11 +398,11 @@ cloudabi64_sys_poll_fd(struct thread *td,
|
||||
return (EINVAL);
|
||||
timeout.tv_sec = subtimo.clock.timeout / 1000000000;
|
||||
timeout.tv_nsec = subtimo.clock.timeout % 1000000000;
|
||||
return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops,
|
||||
&timeout));
|
||||
return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
|
||||
©ops, &timeout));
|
||||
} else {
|
||||
/* Poll without a timeout. */
|
||||
return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops,
|
||||
NULL));
|
||||
return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len,
|
||||
©ops, NULL));
|
||||
}
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ cloudabi64_sys_sock_recv(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Convert results in cloudabi_recv_in_t to struct msghdr. */
|
||||
if (ri.ri_datalen > UIO_MAXIOV)
|
||||
if (ri.ri_data_len > UIO_MAXIOV)
|
||||
return (EINVAL);
|
||||
msghdr.msg_iovlen = ri.ri_datalen;
|
||||
msghdr.msg_iovlen = ri.ri_data_len;
|
||||
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
|
||||
M_SOCKET, M_WAITOK);
|
||||
user_iov = TO_PTR(ri.ri_data);
|
||||
@ -74,8 +74,8 @@ cloudabi64_sys_sock_recv(struct thread *td,
|
||||
free(msghdr.msg_iov, M_SOCKET);
|
||||
return (error);
|
||||
}
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.iov_len;
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.buf_len;
|
||||
}
|
||||
msghdr.msg_name = &ss;
|
||||
msghdr.msg_namelen = sizeof(ss);
|
||||
@ -115,9 +115,9 @@ cloudabi64_sys_sock_send(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Convert results in cloudabi_send_in_t to struct msghdr. */
|
||||
if (si.si_datalen > UIO_MAXIOV)
|
||||
if (si.si_data_len > UIO_MAXIOV)
|
||||
return (EINVAL);
|
||||
msghdr.msg_iovlen = si.si_datalen;
|
||||
msghdr.msg_iovlen = si.si_data_len;
|
||||
msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec),
|
||||
M_SOCKET, M_WAITOK);
|
||||
user_iov = TO_PTR(si.si_data);
|
||||
@ -127,8 +127,8 @@ cloudabi64_sys_sock_send(struct thread *td,
|
||||
free(msghdr.msg_iov, M_SOCKET);
|
||||
return (error);
|
||||
}
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.iov_len;
|
||||
msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf);
|
||||
msghdr.msg_iov[i].iov_len = iovobj.buf_len;
|
||||
}
|
||||
|
||||
flags = MSG_NOSIGNAL;
|
||||
|
@ -65,9 +65,9 @@ cloudabi64_sys_thread_create(struct thread *td,
|
||||
return (error);
|
||||
|
||||
/* Remove some space on the top of the stack for the TCB. */
|
||||
args.tcb = rounddown(args.attr.stack + args.attr.stack_size -
|
||||
args.tcb = rounddown(args.attr.stack + args.attr.stack_len -
|
||||
sizeof(cloudabi64_tcb_t), _Alignof(cloudabi64_tcb_t));
|
||||
args.attr.stack_size = args.tcb - args.attr.stack;
|
||||
args.attr.stack_len = args.tcb - args.attr.stack;
|
||||
|
||||
error = thread_create(td, NULL, initialize_thread, &args);
|
||||
if (error != 0)
|
||||
|
@ -156,7 +156,7 @@ cloudabi32_thread_setregs(struct thread *td,
|
||||
|
||||
/* Perform standard register initialization. */
|
||||
stack.ss_sp = TO_PTR(attr->stack);
|
||||
stack.ss_size = attr->stack_size - sizeof(args);
|
||||
stack.ss_size = attr->stack_len - sizeof(args);
|
||||
cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user