about summary refs log tree commit diff
path: root/src/network/sendto.c
blob: 5d224b0b14fa9048be6a0456860f54b4bdd9bc59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <sys/socket.h>
#include "syscall.h"
#include "socketcall.h"
#include "libc.h"

ssize_t sendto(int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen)
{
	unsigned long args[] = {
		fd, (unsigned long)buf, len, flags,
		(unsigned long)addr, alen
	};
	ssize_t r;
	CANCELPT_BEGIN;
	r = syscall2(__NR_socketcall, SYS_SENDTO, (long)args);
	CANCELPT_END;
	return r;
}