summaryrefslogtreecommitdiff
path: root/lib/libc/devctl/posix_devctl.c
blob: 594978333c574e0e488d551da26968ee81bfb44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <devctl.h>
#include <sys/cdefs.h>
#include <syscall.h>

int posix_devctl(int fildes, int dcmd, void *restrict dev_data_ptr, size_t __unused nbyte, int *restrict dev_info_ptr)
{
	int r;

	r = syscall(ioctl, fildes, dcmd, dev_data_ptr);
	if (r < 0)
		return errno;

	*dev_info_ptr = r;

	return 0;
}