diff options
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/sys/proc.h | 2 | ||||
-rw-r--r-- | sys/include/sys/sched.h | 2 | ||||
-rw-r--r-- | sys/include/sys/socket.h | 17 | ||||
-rw-r--r-- | sys/include/sys/syscall.h | 1 | ||||
-rw-r--r-- | sys/include/sys/sysctl.h | 5 |
5 files changed, 26 insertions, 1 deletions
diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h index 89fe638..809ee23 100644 --- a/sys/include/sys/proc.h +++ b/sys/include/sys/proc.h @@ -122,8 +122,10 @@ struct proc { #define PROC_PINNED BIT(7) /* Pinned to CPU */ struct proc *this_td(void); +struct proc *td_copy(struct proc *td); struct proc *get_child(struct proc *cur, pid_t pid); +int proc_init(struct proc *td, struct proc *parent); void proc_pin(struct proc *td, affinity_t cpu); void proc_unpin(struct proc *td); diff --git a/sys/include/sys/sched.h b/sys/include/sys/sched.h index 7a859b2..19ceb7e 100644 --- a/sys/include/sys/sched.h +++ b/sys/include/sys/sched.h @@ -33,6 +33,7 @@ #include <sys/proc.h> #include <sys/cdefs.h> #include <sys/limits.h> +#include <sys/time.h> /* * Scheduler CPU information @@ -66,6 +67,7 @@ void sched_stat(struct sched_stat *statp); void sched_init(void); void sched_yield(void); +void sched_suspend(struct proc *td, const struct timeval *tv); void sched_detach(struct proc *td); __dead void sched_enter(void); diff --git a/sys/include/sys/socket.h b/sys/include/sys/socket.h index c82ae4e..1a33108 100644 --- a/sys/include/sys/socket.h +++ b/sys/include/sys/socket.h @@ -69,6 +69,10 @@ typedef uint32_t socklen_t; /* Socket types */ #define SOCK_STREAM 1 +/* Socket option names */ +#define SO_RCVTIMEO 0 /* Max time recv(2) waits */ +#define _SO_MAX 1 /* Max socket options */ + struct sockaddr_un { sa_family_t sun_family; char sun_path[108]; @@ -149,12 +153,22 @@ struct cmsg_list { uint8_t is_init : 1; }; +/* + * Socket option that may be applied to + * sockets on the system. + */ +struct sockopt { + socklen_t len; + char data[]; +}; + struct ksocket { int sockfd; union { struct sockaddr sockaddr; struct sockaddr_un un; }; + struct sockopt *opt[_SO_MAX]; struct proc *owner; struct cmsg_list cmsg_list; struct sockbuf buf; @@ -170,10 +184,13 @@ scret_t sys_send(struct syscall_args *scargs); scret_t sys_recvmsg(struct syscall_args *scargs); scret_t sys_sendmsg(struct syscall_args *scargs); +scret_t sys_setsockopt(struct syscall_args *scargs); #endif /* _KERNEL */ int socket(int domain, int type, int protocol); int bind(int sockfd, const struct sockaddr *addr, socklen_t len); + +int setsockopt(int sockfd, int level, int name, const void *v, socklen_t len); int connect(int sockfd, const struct sockaddr *addr, socklen_t len); ssize_t send(int sockfd, const void *buf, size_t size, int flags); diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h index 9798d80..f53db8f 100644 --- a/sys/include/sys/syscall.h +++ b/sys/include/sys/syscall.h @@ -66,6 +66,7 @@ #define SYS_sendmsg 25 #define SYS_recvmsg 26 #define SYS_connect 27 +#define SYS_setsockopt 28 #if defined(_KERNEL) /* Syscall return value and arg type */ diff --git a/sys/include/sys/sysctl.h b/sys/include/sys/sysctl.h index 078135b..d13b0f8 100644 --- a/sys/include/sys/sysctl.h +++ b/sys/include/sys/sysctl.h @@ -30,9 +30,12 @@ #ifndef _SYS_SYSCTL_H_ #define _SYS_SYSCTL_H_ -#include <sys/types.h> #if defined(_KERNEL) +#include <sys/types.h> #include <sys/syscall.h> +#else +#include <stdint.h> +#include <stddef.h> #endif #include <sys/param.h> |