OSDN Git Service

51f83a3724b06d7d1f946254dc8c5daf94ef721b
[uclinux-h8/uClibc.git] / 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
14 libc_hidden_proto(ioctl)
15
16 #define __NR___syscall_ioctl __NR_ioctl
17 static __always_inline
18 _syscall3(int, __syscall_ioctl, int, fd, int, request, void *, arg)
19
20 int ioctl(int fd, unsigned long int request, ...)
21 {
22     void *arg;
23     va_list list;
24
25     va_start(list, request);
26     arg = va_arg(list, void *);
27     va_end(list);
28
29     return __syscall_ioctl(fd, request, arg);
30 }
31 libc_hidden_def(ioctl)