source: rtems/cpukit/libcsupport/src/read.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[07a3253d]1/*
2 *  read() - POSIX 1003.1b 6.4.1 - Read From a File
3 *
[58f3fab]4 *  COPYRIGHT (c) 1989-2011.
[07a3253d]5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
[0eae36c7]9 *  http://www.rtems.com/license/LICENSE.
[07a3253d]10 */
11
[9c49db4]12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
[3ba74c73]16#include <rtems/libio_.h>
[a02224e]17#include <rtems/seterr.h>
[07a3253d]18
[e22d644]19ssize_t read(
[07a3253d]20  int         fd,
21  void       *buffer,
[e22d644]22  size_t      count
[07a3253d]23)
24{
[7192476f]25  ssize_t      rc;
[07a3253d]26  rtems_libio_t *iop;
27
[cca4400]28  rtems_libio_check_fd( fd );
29  iop = rtems_libio_iop( fd );
[682a8ffa]30  rtems_libio_check_is_open( iop );
[cca4400]31  rtems_libio_check_buffer( buffer );
32  rtems_libio_check_count( count );
[58f3fab]33  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
[cca4400]34
[07a3253d]35  /*
36   *  Now process the read().
37   */
[fd2b1634]38  rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
[07a3253d]39
40  if ( rc > 0 )
41    iop->offset += rc;
42
43  return rc;
44}
45
46/*
47 *  _read_r
48 *
49 *  This is the Newlib dependent reentrant version of read().
50 */
51
[346725cc]52#if defined(RTEMS_NEWLIB) && !defined(HAVE__READ_R)
[07a3253d]53
54#include <reent.h>
55
[7192476f]56ssize_t _read_r(
[9e14ca2]57  struct _reent *ptr __attribute__((unused)),
[07a3253d]58  int            fd,
59  void          *buf,
60  size_t         nbytes
61)
62{
63  return read( fd, buf, nbytes );
64}
65#endif
Note: See TracBrowser for help on using the repository browser.