source: rtems/cpukit/libcsupport/src/ioctl.c @ 92119ed

4.115
Last change on this file since 92119ed was 92119ed, checked in by Jennifer Averett <Jennifer.Averett@…>, on 07/01/10 at 15:12:38

2010-07-01 Jennifer Averett <Jennifer.Averett@…>

  • libcsupport/src/chdir.c, libcsupport/src/chmod.c, libcsupport/src/chown.c, libcsupport/src/close.c, libcsupport/src/eval.c, libcsupport/src/fchdir.c, libcsupport/src/fchmod.c, libcsupport/src/fchown.c, libcsupport/src/fcntl.c, libcsupport/src/fdatasync.c, libcsupport/src/freenode.c, libcsupport/src/fstat.c, libcsupport/src/fsync.c, libcsupport/src/ftruncate.c, libcsupport/src/ioctl.c, libcsupport/src/link.c, libcsupport/src/lseek.c, libcsupport/src/mknod.c, libcsupport/src/mount.c, libcsupport/src/open.c, libcsupport/src/read.c, libcsupport/src/readlink.c, libcsupport/src/readv.c, libcsupport/src/rmdir.c, libcsupport/src/stat.c, libcsupport/src/statvfs.c, libcsupport/src/symlink.c, libcsupport/src/unlink.c, libcsupport/src/unmount.c, libcsupport/src/write.c: Removed filesystem checks for NULL methods checks from the main posix rountines. These are now required to have at a miminum default routines in the tables.
  • Property mode set to 100644
File size: 995 bytes
Line 
1/*
2 *  ioctl() system call
3 *
4 *  This routine is not defined in the POSIX 1003.1b standard but is
5 *  commonly supported on most UNIX and POSIX systems.
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <stdarg.h>
22
23#include <rtems/libio_.h>
24#include <rtems/seterr.h>
25
26#include <unistd.h>
27
28int ioctl(
29  int  fd,
30  ioctl_command_t  command,
31  ...
32)
33{
34  va_list            ap;
35  rtems_status_code  rc;
36  rtems_libio_t     *iop;
37  void              *buffer;
38
39  rtems_libio_check_fd( fd );
40  iop = rtems_libio_iop( fd );
41  rtems_libio_check_is_open(iop);
42
43  va_start(ap, command);
44
45  buffer = va_arg(ap, void *);
46
47  /*
48   *  Now process the ioctl().
49   */
50  rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
51
52  return rc;
53}
Note: See TracBrowser for help on using the repository browser.