OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [libgloss/] [mep/] [write.c] - Blame information for rev 308

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/* write.c -- write characters to file, with hook.
2
 *
3
 * Copyright (c) 2003  Red Hat, Inc. All rights reserved.
4
 *
5
 * This copyrighted material is made available to anyone wishing to use, modify,
6
 * copy, or redistribute it subject to the terms and conditions of the BSD
7
 * License.  This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY expressed or implied, including the implied
9
 * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  A copy
10
 * of this license is available at http://www.opensource.org/licenses. Any
11
 * Red Hat trademarks that are incorporated in the source code or documentation
12
 * are not subject to the BSD License and may only be used or replicated with
13
 * the express permission of Red Hat, Inc.
14
 */
15
 
16
extern int __mep_write(int, unsigned char *, int);
17
extern void _ioOut(int) __attribute__((weak));
18
 
19
int
20
write(int fd, unsigned char *buf, int count)
21
{
22
  if ((fd == 1 || fd == 2) && &_ioOut)
23
    {
24
      int c = count;
25
      while (c > 0)
26
        {
27
          c --;
28
          _ioOut(*buf++);
29
        }
30
      return count;
31
    }
32
  return __mep_write(fd, buf, count);
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.