summaryrefslogtreecommitdiff
path: root/userland/libc/sys/socket
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-06-26 01:41:28 +0200
committerAnton Kling <anton@kling.gg>2024-06-26 01:41:28 +0200
commit33e1b11555d3557a36bd69d63f5bf0c290b5d462 (patch)
tree7690db8310fc26f70b3cb96c8d2241969303cfe7 /userland/libc/sys/socket
parent3bed68592da11f2d013f76534220275739dd7556 (diff)
LibC: Fix printf formatting
Previously %02x would not print out padding if the given value was zero.
Diffstat (limited to 'userland/libc/sys/socket')
-rw-r--r--userland/libc/sys/socket/getpeername.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/userland/libc/sys/socket/getpeername.c b/userland/libc/sys/socket/getpeername.c
new file mode 100644
index 0000000..25a56b1
--- /dev/null
+++ b/userland/libc/sys/socket/getpeername.c
@@ -0,0 +1,7 @@
+#include <sys/socket.h>
+#include <syscall.h>
+
+int getpeername(int sockfd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen) {
+ RC_ERRNO(syscall(SYS_GETPEERNAME, sockfd, addr, addrlen, 0, 0));
+}