ioctl.h 636 B

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