source: rtems/cpukit/libcsupport/src/ioctl.c @ e02d5dd9

4.115
Last change on this file since e02d5dd9 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief ioctl() system call
5 * @ingroup libcsupport
6 */
7
8/*
9 *  This routine is not defined in the POSIX 1003.1b standard but is
10 *  commonly supported on most UNIX and POSIX systems.
11 *
12 *  COPYRIGHT (c) 1989-1999.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include <stdarg.h>
25
26#include <rtems/libio_.h>
27#include <rtems/seterr.h>
28
29#include <unistd.h>
30
31int ioctl(
32  int  fd,
33  ioctl_command_t  command,
34  ...
35)
36{
37  va_list            ap;
38  int                rc;
39  rtems_libio_t     *iop;
40  void              *buffer;
41
42  rtems_libio_check_fd( fd );
43  iop = rtems_libio_iop( fd );
44  rtems_libio_check_is_open(iop);
45
46  va_start(ap, command);
47
48  buffer = va_arg(ap, void *);
49
50  /*
51   *  Now process the ioctl().
52   */
53  rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer );
54
55  va_end( ap );
56  return rc;
57}
Note: See TracBrowser for help on using the repository browser.