source: rtems/c/src/lib/libc/newlibifr.c @ 1587af6

4.104.114.84.95
Last change on this file since 1587af6 was b1459dc, checked in by Joel Sherrill <joel.sherrill@…>, on 08/22/97 at 19:17:09

Moved reentrant wrappers into their own file.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1
2/*
3 *  This file contains the glue which maps newlib system calls onto their
4 *  RTEMS implementations.  This formerly was in the file
5 *  libgloss/rtems/iface.c which was installed as rtems.o.  Merging this
6 *  into the RTEMS source tree minimizes the files which must be linked
7 *  to build an rtems application.
8 *
9 *  $Id$
10 *
11 */
12
13#include <rtems.h>
14#if defined(RTEMS_NEWLIB)
15
16#include <sys/types.h>
17#include <sys/stat.h>
18#include <errno.h>
19#include <reent.h>
20
21#include <termios.h>
22
23#include "internal.h"
24#include "libio.h"
25
26_ssize_t
27_read_r(struct _reent *ptr,
28     int fd,
29     void *buf,
30     size_t nbytes)
31{
32    return __rtems_read(fd, buf, nbytes);
33}
34
35long
36_write_r(struct _reent *ptr,
37     int fd,
38     const void *buf,
39     size_t nbytes
40)
41{
42    return __rtems_write(fd, buf, nbytes);
43}
44
45int
46_open_r(struct _reent *ptr,
47     const char *buf,
48     int flags,
49     int mode)
50{
51    return __rtems_open(buf, flags, mode);
52}
53
54int
55_close_r(struct _reent *ptr,
56    int fd)
57{
58    return __rtems_close(fd);
59}
60
61off_t
62_lseek_r(struct _reent *ptr,
63      int fd,
64      off_t offset,
65      int whence)
66{
67    return __rtems_lseek(fd, offset, whence);
68}
69
70int
71_fstat_r(struct _reent *ptr,
72      int fd,
73      struct stat *buf)
74{
75    return __rtems_fstat(fd, buf);
76}
77
78pid_t _getpid_r(struct _reent *ptr)
79{
80  pid_t __getpid();
81  return __getpid();
82}
83
84int _kill_r( struct _reent *ptr, pid_t pid, int sig )
85{
86  int __kill();
87  return __kill(pid, sig);
88}
89#endif
Note: See TracBrowser for help on using the repository browser.