source: trunk/libs/newlib/src/libgloss/i960/mon960.c @ 609

Last change on this file since 609 was 444, checked in by satin@…, 7 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 973 bytes
RevLine 
[444]1#include <sys/types.h>
2#include <sys/stat.h>
3
4static char *heap_end = 0;
5
6int
7brk (void *ptr)
8{
9  heap_end = ptr;
10  return 0;
11}
12
13caddr_t
14sbrk (int amt)
15{
16  extern char end;
17  char *prev_heap_end;
18
19  if (heap_end == 0) 
20    heap_end = &end;
21  prev_heap_end = heap_end;
22  heap_end += amt;
23  return ((caddr_t) prev_heap_end);
24}
25
26int
27isatty (int file)
28{
29  return file<3;
30}
31
32int
33fstat (int file, struct stat *st)
34{
35  st->st_mode = S_IFCHR;
36  return 0;
37}
38
39int
40stat (const char *__restrict filename, struct stat *__restrict st)
41{
42  st->st_mode = S_IFCHR;
43  return 0;
44}
45
46int
47lseek (int fd, off_t offset, int type)
48{
49  return _sys_lseek (fd, offset, type);
50}
51
52int
53open (char *file, int mode, int perms)
54{
55  return _sys_open (file, mode, perms);
56}
57
58int
59close (int fd)
60{
61  return _sys_close (fd);
62}
63
64int
65getpid ()
66{
67  return -1;
68}
69
70int
71kill (int pid, int signal)
72{
73  exit (signal);
74}
75
76#if 0
77/* This conflicts with the abort defined in newlib.  */
78void
79abort ()
80{
81  exit (6);
82}
83#endif
Note: See TracBrowser for help on using the repository browser.