This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Add more stubs to RTEMS dummy crt0
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "newlib at sources dot redhat dot com" <newlib at sources dot redhat dot com>
- Date: Mon, 7 May 2012 16:12:24 -0500
- Subject: Add more stubs to RTEMS dummy crt0
This patch adds more stubs to the RTEMS crt0.c so
autoconf probes for gfortran and Go are happy
with RTEMS. The crt0 stub satisfies symbols which will
really only be available when an actual RTEMS image
is linked against.
OK to apply?
2012-05-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/sys/rtems/crt0.c: Add stubs for access(), ftruncate(),
_getpid_r(), geteuid(), getgid, _getgid_r, getpid(), getppid(),
and _getpid_r().
--
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Index: newlib/libc/sys/rtems/crt0.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/rtems/crt0.c,v
retrieving revision 1.13
diff -u -r1.13 crt0.c
--- newlib/libc/sys/rtems/crt0.c 20 Aug 2011 05:34:22 -0000 1.13
+++ newlib/libc/sys/rtems/crt0.c 7 May 2012 21:04:45 -0000
@@ -50,6 +50,7 @@
#endif
/* stubs for functions RTEMS provides */
+RTEMS_STUB(int, access(const char *pathname, int mode), { return -1; })
RTEMS_STUB(int, clock_gettime(clockid_t clk_id, struct timespec *tp), { return -1; })
RTEMS_STUB(int, close (int fd), { return -1; })
RTEMS_STUB(int, dup2(int oldfd, int newfd), { return -1; })
@@ -63,6 +64,7 @@
RTEMS_STUB(struct passwd *, getpwuid(uid_t uid), { return 0; })
RTEMS_STUB(uid_t, getuid(void), { return 0; })
RTEMS_STUB(int, nanosleep(const struct timespec *req, struct timespec *rem), { return -1; })
+RTEMS_STUB(int, ftruncate(int fd, off_t length), { return -1; })
RTEMS_STUB(_off_t, lseek(int fd, _off_t offset, int whence), { return -1; })
RTEMS_STUB(int, lstat(const char *path, struct stat *buf), { return -1; })
RTEMS_STUB(int, open(const char *pathname, int flags, int mode), { return -1; })
@@ -93,7 +95,12 @@
#endif
#endif
RTEMS_STUB(int, _fstat_r (struct _reent *r, int fd, struct stat *buf), { return -1; })
-RTEMS_STUB(int, _getpid_r (struct _reent *r), { return -1; })
+RTEMS_STUB(uid_t, geteuid (), { return -1; })
+RTEMS_STUB(gid_t, getgid (), { return -1; })
+RTEMS_STUB(gid_t, _getgid_r (struct _reent *r), { return -1; })
+RTEMS_STUB(pid_t, getpid (), { return -1; })
+RTEMS_STUB(pid_t, getppid (), { return -1; })
+RTEMS_STUB(pid_t, _getpid_r (struct _reent *r), { return -1; })
RTEMS_STUB(int, _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp), { return 0; })
RTEMS_STUB(int, _isatty_r (struct _reent *r, int fd), { return isatty( fd ); })
RTEMS_STUB(int, _kill_r (struct _reent *r, int pid, int sig ), { return -1; })