summaryrefslogtreecommitdiff
path: root/sys/kern/kern_socket.c
AgeCommit message (Collapse)Author
3 dayskernel: socket: Fix typo in commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel & libc: Add POSIX setsockopt syscallIan Moffett
This commit implements the POSIX setsockopt syscall so that user programs may be able to configure sockets they have created. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Implement recv() timeoutIan Moffett
This commit implements proper timeout handling for recv(). Previously, the recv() syscall would yield the current process forver until data is available to be read. Obviously, that is not the most ideal as it is not uncommon for programs to try seeing if any data exists on the socket before deferring to perform some other task until data arrives. The basics of how this work is that we try reading data off of some specified socket. However, if no data is present, we must wait for the given timeout value before attempting to read again. While this is pretty effective and works perfectly fine as of now, it might be worth optimizing this later to allow that timeout period to be somehow "interrupted" by data arriving at a socket so that the program does not have to defer execution for the full wait-period. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Add POSIX setsockopt()Ian Moffett
This commit introduces the kernel-side implementation of setsockopt() for setting options on a socket file descriptor. See POSIX setsockopt() for more information. https://pubs.opengroup.org/onlinepubs/9690949499/functions/setsockopt.html Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Fix typo in code commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Refactor recv() implIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Zero newly allocated 'ksock'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: Add SYS_connect syscallIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Implement connect()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Improve control message logicIan Moffett
- Zero new control buffer before usage - Block if the control message queue is empty Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Block is recv queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Block if cmsg queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Log socket owner PID on SCM_RIGHTSIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Create a socket file in /tmp/Ian Moffett
This commit adds logic to socket() that creates a temp file that represents it. Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Keep track of socket ownerIan Moffett
Keep track of the process that created a socket. Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: descrip: Add 'td' parameter to fd routinesIan Moffett
Update the signature of 'fd_get()', 'fd_alloc()' and 'fd_dup()' to include a pointer to the process to target. This improves the flexibility of the file descriptor API. Signed-off-by: Ian Moffett <ian@osmora.org>
9 dayskernel: socket: Ensure AF_UNIX in recvmsg()Ian Moffett
Ensure that the file descriptor represented by 'socket' is of type AF_UNIX before performing the rest of recvmsg() Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: Add SYS_sendmsg and SYS_recvmsgIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: socket: Add initial SCM + CMSG implIan Moffett
Introduce initial implementation for out-of-band socket control messages and an SCM_RIGHTS stub. Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: net: Add socket syscallsIan Moffett
Introduce the following syscalls: - SYS_socket - SYS_bind - SYS_recv - SYS_send Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: net: Introduce initial socket implIan Moffett
Introduce initial support for POSIX sockets. This commit currently implements the AF_UNIX family for IPC. Signed-off-by: Ian Moffett <ian@osmora.org>