1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:07:44 +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);

View file

@ -138,6 +138,7 @@ int getsockopt(int sockfd, int level, int option, void*, socklen_t*);
int setsockopt(int sockfd, int level, int option, const void*, socklen_t);
int getsockname(int sockfd, struct sockaddr*, socklen_t*);
int getpeername(int sockfd, struct sockaddr*, socklen_t*);
int socketpair(int domain, int type, int protocol, int sv[2]);
int sendfd(int sockfd, int fd);
int recvfd(int sockfd, int options);