summaryrefslogtreecommitdiff
path: root/userland/libc/sys/socket/sendto.c
diff options
context:
space:
mode:
Diffstat (limited to 'userland/libc/sys/socket/sendto.c')
-rw-r--r--userland/libc/sys/socket/sendto.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/userland/libc/sys/socket/sendto.c b/userland/libc/sys/socket/sendto.c
new file mode 100644
index 0000000..73437ab
--- /dev/null
+++ b/userland/libc/sys/socket/sendto.c
@@ -0,0 +1,16 @@
+#include <sys/socket.h>
+#include <syscall.h>
+
+struct two_args {
+ uint32_t a;
+ uint32_t b;
+};
+
+size_t sendto(int socket, const void *message, size_t length, int flags,
+ const struct sockaddr *dest_addr, socklen_t dest_len) {
+ struct two_args extra = {
+ .a = dest_addr,
+ .b = dest_len,
+ };
+ return syscall(SYS_SENDTO, socket, message, length, flags, &extra);
+}