+
+/* extern (.*) ([^ ]*) _PARAMS \(\(struct _reent \*(,*)(.*)\)\); */
+/* \1 \2 (struct _reent *\3\4) { return \2(\4);} */
+
+struct _reent;
+
+int _close_r(struct _reent *reent, int file)
+{ return _close(file);}
+/*
+ int _fcntl_r(struct _reent *, int, int, int)
+ { return _fcntl( int, int, int);}
+*/
+int _fstat_r(struct _reent *reent, int file, struct stat *st);
+int _fstat_r(struct _reent *reent, int file, struct stat *st)
+{ return _fstat(file, st);}
+
+int _getpid_r(struct _reent *reent);
+int _getpid_r(struct _reent *reent)
+{ return _getpid();}
+
+int _kill_r(struct _reent *reent, int n, int m);
+int _kill_r(struct _reent *reent, int n, int m)
+{ return _kill(n, m);}
+
+int _link_r(struct _reent *reent, const char *path1, const char *path2);
+int _link_r(struct _reent *reent, const char *path1, const char *path2)
+{ return _link(path1, path2);}
+
+_off_t _lseek_r(struct _reent *reent, int file, _off_t pos, int dir);
+_off_t _lseek_r(struct _reent *reent, int file, _off_t pos, int dir)
+{ return _lseek(file, pos, dir);}
+
+int _open_r(struct _reent *reent, const char *path, int flags, int opts);
+int _open_r(struct _reent *reent, const char *path, int flags, int opts)
+{ return _open(path, flags, opts);}
+
+_ssize_t _read_r(struct _reent *reent, int file, void *ptr, size_t len);
+_ssize_t _read_r(struct _reent *reent, int file, void *ptr, size_t len)
+{ return _read(file, ptr, len);}
+
+void *_sbrk_r(struct _reent *reent, ptrdiff_t incr);
+void *_sbrk_r(struct _reent *reent, ptrdiff_t incr)
+{ return _sbrk(incr);}
+
+int _stat_r(struct _reent *reent, const char *path, struct stat *st);
+int _stat_r(struct _reent *reent, const char *path, struct stat *st)
+{ return _stat(path, st);}
+
+int _unlink_r(struct _reent *reent, const char *path);
+int _unlink_r(struct _reent *reent, const char *path)
+{ return _unlink(path);}
+
+_ssize_t _write_r(struct _reent *reent, int file, const void *ptr, size_t len);
+_ssize_t _write_r(struct _reent *reent, int file, const void *ptr, size_t len)
+{ return _write(file, ptr, len);}
+
+/* FIXME: TDK added dummy functions. Need to implement. */
+int _isatty(int fd);
+int _isatty(int fd)
+{
+ return -1;
+}
+
+int _swistat(int fd, struct stat *st);
+int _swistat(int fd, struct stat *st)
+{
+ return -1;
+}
+
+/* Return a clock that ticks at 100Hz. */
+clock_t _clock(void);
+clock_t _clock(void)
+{
+ clock_t timeval=0;
+ return timeval;
+}
+
+int _swiclose(int fh);
+int _swiclose(int fh)
+{
+ return -1;
+}
+
+int _swiopen(const char *path, int flags);
+int _swiopen(const char *path, int flags)
+{
+ return -1;
+}
+
+int _swiwrite(int fh, char *ptr, int len);
+int _swiwrite(int fh, char *ptr, int len)
+{
+ return -1;
+}
+
+int _swilseek(int fd, int ptr, int dir);
+int _swilseek(int fd, int ptr, int dir)
+{
+ return -1;
+}
+
+int _swiread(int fh, char *ptr, int len);
+int _swiread(int fh, char *ptr, int len)
+{
+ return -1;
+}
+
+void initialise_monitor_handles(void);
+void initialise_monitor_handles(void)
+{
+}