1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

Kernel+LibC: Implement the socketpair() syscall

This commit is contained in:
Gunnar Beutner 2021-04-28 12:39:12 +02:00 committed by Andreas Kling
parent c841012f56
commit aa792062cb
11 changed files with 100 additions and 91 deletions

View file

@ -125,6 +125,13 @@ int getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int socketpair(int domain, int type, int protocol, int sv[2])
{
Syscall::SC_socketpair_params params { domain, type, protocol, sv };
int rc = syscall(SC_socketpair, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int sendfd(int sockfd, int fd)
{
int rc = syscall(SC_sendfd, sockfd, fd);