mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:37:42 +00:00
Net: Add a basic sys$shutdown() implementation
Calling shutdown prevents further reads and/or writes on a socket. We should do a few more things based on the type of socket, but this initial implementation just puts the basic mechanism in place. Work towards #428.
This commit is contained in:
parent
a3f39fe789
commit
2b0b7cc5a4
8 changed files with 60 additions and 2 deletions
|
@ -62,6 +62,12 @@ int connect(int sockfd, const sockaddr* addr, socklen_t addrlen)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int shutdown(int sockfd, int how)
|
||||
{
|
||||
int rc = syscall(SC_shutdown, sockfd, how);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
ssize_t sendto(int sockfd, const void* data, size_t data_length, int flags, const struct sockaddr* addr, socklen_t addr_length)
|
||||
{
|
||||
Syscall::SC_sendto_params params { sockfd, { data, data_length }, flags, addr, addr_length };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue