summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonatan Goldschmidt <yon.goldschmidt@gmail.com>2020-05-10 01:48:27 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-10 01:04:10 +0200
commit2ac3d33c63800f9a2fef4b0fe1947fb0d55d720b (patch)
tree0c5e706cbb9add38828912638dd1213e55a49943
parent9e74793ce2a6993016306a45e37bb91c20a0d9bd (diff)
downloadserenity-2ac3d33c63800f9a2fef4b0fe1947fb0d55d720b.zip
LibC: Fix get{sock,peer}name to match their kernel-side prototypes
In f4302b58fb0, the kernel-side syscalls (e.g Process::sys$getsockname) were updated to use SC_get{sock,peer}name_params, but the libc functions were not updated.
-rw-r--r--Libraries/LibC/sys/socket.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibC/sys/socket.cpp b/Libraries/LibC/sys/socket.cpp
index b604c688c2..81e83aaed7 100644
--- a/Libraries/LibC/sys/socket.cpp
+++ b/Libraries/LibC/sys/socket.cpp
@@ -108,13 +108,15 @@ int setsockopt(int sockfd, int level, int option, const void* value, socklen_t v
int getsockname(int sockfd, struct sockaddr* addr, socklen_t* addrlen)
{
- int rc = syscall(SC_getsockname, sockfd, addr, addrlen);
+ Syscall::SC_getsockname_params params { sockfd, addr, addrlen };
+ int rc = syscall(SC_getsockname, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen)
{
- int rc = syscall(SC_getpeername, sockfd, addr, addrlen);
+ Syscall::SC_getpeername_params params { sockfd, addr, addrlen };
+ int rc = syscall(SC_getpeername, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}