source: rtems/cpukit/libfs/src/devfs/devwrite.c @ ec9e8a9

4.104.115
Last change on this file since ec9e8a9 was ec9e8a9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/18/08 at 13:21:49

2008-09-18 Miao Yan <yanmiaobest@…>

  • libfs/src/devfs/devclose.c, libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c, libfs/src/devfs/devwrite.c: Fix warnings.
  • Property mode set to 100644
File size: 900 bytes
Line 
1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
4 *  http://www.rtems.com/license/LICENSE.
5 *
6 *  $Id$
7 */
8
9#if HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <rtems.h>
14#include <rtems/io.h>
15
16#include "devfs.h"
17
18ssize_t devFS_write(
19  rtems_libio_t *iop,
20  const void    *buffer,
21  size_t         count
22)
23{
24  rtems_libio_rw_args_t   args;
25  rtems_status_code       status;
26  rtems_device_name_t    *np;
27
28  np           = (rtems_device_name_t *)iop->file_info;
29
30  args.iop         = iop;
31  args.offset      = iop->offset;
32  args.buffer      = (void *) buffer;
33  args.count       = count;
34  args.flags       = iop->flags;
35  args.bytes_moved = 0;
36
37  status = rtems_io_write(
38    np->major,
39    np->minor,
40    (void *) &args
41  );
42
43  if ( status )
44    return rtems_deviceio_errno(status);
45
46  return (ssize_t) args.bytes_moved;
47}
48
Note: See TracBrowser for help on using the repository browser.