]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/common/ioctl.c
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / common / ioctl.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * ioctl() for uClibc
4  *
5  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6  *
7  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8  */
9
10 #include <sys/syscall.h>
11 #include <stdarg.h>
12 #include <sys/ioctl.h>
13 #include <cancel.h>
14
15 #define __NR___syscall_ioctl __NR_ioctl
16 static __always_inline
17 _syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg)
18
19 int ioctl(int fd, unsigned long int request, ...)
20 {
21         void *arg;
22         va_list list;
23
24         va_start(list, request);
25         arg = va_arg(list, void *);
26         va_end(list);
27
28         if (SINGLE_THREAD_P)
29                 return __syscall_ioctl(fd, request, arg);
30 #ifdef __NEW_THREADS
31         int oldtype = LIBC_CANCEL_ASYNC ();
32         int result = __syscall_ioctl(fd, request, arg);
33         LIBC_CANCEL_RESET (oldtype);
34         return result;
35 #endif
36 }
37 lt_strong_alias(ioctl)
38 lt_libc_hidden(ioctl)