projects/linux·blob master · refs

29 lines · 644 B

1/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2/*
3 * Ioctl definitions for NOLIBC
4 * Copyright (C) 2017-2021 Willy Tarreau <[email protected]>
5 */
6
7/* make sure to include all global symbols */
8#include "../nolibc.h"
9
10#ifndef _NOLIBC_SYS_IOCTL_H
11#define _NOLIBC_SYS_IOCTL_H
12
13#include "../sys.h"
14
15#include <linux/ioctl.h>
16
17/*
18 * int ioctl(int fd, unsigned long cmd, ... arg);
19 */
20
21static __attribute__((unused))
22long _sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
23{
24 return __nolibc_syscall3(__NR_ioctl, fd, cmd, arg);
25}
26
27#define ioctl(fd, cmd, arg) __sysret(_sys_ioctl(fd, cmd, (unsigned long)(arg)))
28
29#endif /* _NOLIBC_SYS_IOCTL_H */