xref: /linux/tools/include/nolibc/sys/ioctl.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1*7281be58SThomas Weißschuh /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2*7281be58SThomas Weißschuh /*
3*7281be58SThomas Weißschuh  * Ioctl definitions for NOLIBC
4*7281be58SThomas Weißschuh  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5*7281be58SThomas Weißschuh  */
6*7281be58SThomas Weißschuh 
7*7281be58SThomas Weißschuh /* make sure to include all global symbols */
8*7281be58SThomas Weißschuh #include "../nolibc.h"
9*7281be58SThomas Weißschuh 
10*7281be58SThomas Weißschuh #ifndef _NOLIBC_SYS_IOCTL_H
11*7281be58SThomas Weißschuh #define _NOLIBC_SYS_IOCTL_H
12*7281be58SThomas Weißschuh 
13*7281be58SThomas Weißschuh #include "../sys.h"
14*7281be58SThomas Weißschuh 
15*7281be58SThomas Weißschuh #include <linux/ioctl.h>
16*7281be58SThomas Weißschuh 
17*7281be58SThomas Weißschuh /*
18*7281be58SThomas Weißschuh  * int ioctl(int fd, unsigned long cmd, ... arg);
19*7281be58SThomas Weißschuh  */
20*7281be58SThomas Weißschuh 
21*7281be58SThomas Weißschuh static __attribute__((unused))
sys_ioctl(unsigned int fd,unsigned int cmd,unsigned long arg)22*7281be58SThomas Weißschuh long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
23*7281be58SThomas Weißschuh {
24*7281be58SThomas Weißschuh 	return my_syscall3(__NR_ioctl, fd, cmd, arg);
25*7281be58SThomas Weißschuh }
26*7281be58SThomas Weißschuh 
27*7281be58SThomas Weißschuh #define ioctl(fd, cmd, arg) __sysret(sys_ioctl(fd, cmd, (unsigned long)(arg)))
28*7281be58SThomas Weißschuh 
29*7281be58SThomas Weißschuh #endif /* _NOLIBC_SYS_IOCTL_H */
30