4.104.114.84.95
Last change
on this file since e2d79559 was
dcec5a4,
checked in by Joel Sherrill <joel.sherrill@…>, on 01/29/97 at 00:29:25
|
Merged newlib's libgloss support for rtems into this directory. This
should simplify the build process.
|
-
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 | |
---|
20 | #include "internal.h" |
---|
21 | #include "libio.h" |
---|
22 | |
---|
23 | int |
---|
24 | read(int fd, |
---|
25 | char *buf, |
---|
26 | int nbytes) |
---|
27 | { |
---|
28 | return __rtems_read(fd, buf, nbytes); |
---|
29 | } |
---|
30 | |
---|
31 | int |
---|
32 | write(int fd, |
---|
33 | char *buf, |
---|
34 | int nbytes) |
---|
35 | { |
---|
36 | return __rtems_write(fd, buf, nbytes); |
---|
37 | } |
---|
38 | |
---|
39 | int |
---|
40 | open(char *buf, |
---|
41 | int flags, |
---|
42 | int mode) |
---|
43 | { |
---|
44 | return __rtems_open(buf, flags, mode); |
---|
45 | } |
---|
46 | |
---|
47 | int |
---|
48 | close(int fd) |
---|
49 | { |
---|
50 | return __rtems_close(fd); |
---|
51 | } |
---|
52 | |
---|
53 | /* |
---|
54 | * isatty -- returns 1 if connected to a terminal device, |
---|
55 | * returns 0 if not. |
---|
56 | */ |
---|
57 | int |
---|
58 | isatty(int fd) |
---|
59 | { |
---|
60 | return __rtems_isatty(fd); |
---|
61 | } |
---|
62 | |
---|
63 | /* |
---|
64 | * lseek -- move read/write pointer. Since a serial port |
---|
65 | * is non-seekable, we return an error. |
---|
66 | */ |
---|
67 | off_t |
---|
68 | lseek(int fd, |
---|
69 | off_t offset, |
---|
70 | int whence) |
---|
71 | { |
---|
72 | return __rtems_lseek(fd, offset, whence); |
---|
73 | } |
---|
74 | |
---|
75 | /* |
---|
76 | * fstat -- get status of a file. Since we have no file |
---|
77 | * system, we just return an error. |
---|
78 | */ |
---|
79 | int |
---|
80 | fstat(int fd, |
---|
81 | struct stat *buf) |
---|
82 | { |
---|
83 | return __rtems_fstat(fd, buf); |
---|
84 | } |
---|
85 | |
---|
86 | /* |
---|
87 | * getpid and kill are provided directly by rtems |
---|
88 | */ |
---|
89 | |
---|
90 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.