source: rtems/cpukit/libfs/src/imfs/deviceio.c @ a397c7d8

5
Last change on this file since a397c7d8 was a397c7d8, checked in by Sebastian Huber <sebastian.huber@…>, on 12/13/17 at 07:00:02

IMFS: Include <rtems/imfs.h>

Prepare for header file move to common include directory.

Update #3254.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @brief IMFS Device Node Handlers
5 * @ingroup IMFS
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2012.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18  #include "config.h"
19#endif
20
21#include <rtems/imfs.h>
22
23#include <rtems/deviceio.h>
24
25int device_open(
26  rtems_libio_t *iop,
27  const char    *pathname,
28  int            oflag,
29  mode_t         mode
30)
31{
32  const IMFS_device_t *device = IMFS_iop_to_device( iop );
33
34  return rtems_deviceio_open(
35    iop,
36    pathname,
37    oflag,
38    mode,
39    device->major,
40    device->minor
41  );
42}
43
44int device_close(
45  rtems_libio_t *iop
46)
47{
48  const IMFS_device_t *device = IMFS_iop_to_device( iop );
49
50  return rtems_deviceio_close(
51    iop,
52    device->major,
53    device->minor
54  );
55}
56
57ssize_t device_read(
58  rtems_libio_t *iop,
59  void          *buffer,
60  size_t         count
61)
62{
63  const IMFS_device_t *device = IMFS_iop_to_device( iop );
64
65  return rtems_deviceio_read(
66    iop,
67    buffer,
68    count,
69    device->major,
70    device->minor
71  );
72}
73
74ssize_t device_write(
75  rtems_libio_t *iop,
76  const void    *buffer,
77  size_t         count
78)
79{
80  const IMFS_device_t *device = IMFS_iop_to_device( iop );
81
82  return rtems_deviceio_write(
83    iop,
84    buffer,
85    count,
86    device->major,
87    device->minor
88  );
89}
90
91int device_ioctl(
92  rtems_libio_t   *iop,
93  ioctl_command_t  command,
94  void            *buffer
95)
96{
97  const IMFS_device_t *device = IMFS_iop_to_device( iop );
98
99  return rtems_deviceio_control(
100    iop,
101    command,
102    buffer,
103    device->major,
104    device->minor
105  );
106}
107
108int device_ftruncate(
109  rtems_libio_t *iop,
110  off_t          length
111)
112{
113  return 0;
114}
Note: See TracBrowser for help on using the repository browser.