From 8d7a1d76e2d19cb77df60a14889ded1c445c28dd Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 18 Jun 1996 19:06:58 +0000 Subject: [PATCH] minor changes to insure the few posix-ish routines needed in non-posix mode have stubs. --- c/src/exec/libcsupport/src/newlibc.c | 31 ++++++++++++++++++++++------ c/src/lib/libc/newlibc.c | 31 ++++++++++++++++++++++------ cpukit/libcsupport/src/newlibc.c | 31 ++++++++++++++++++++++------ 3 files changed, 75 insertions(+), 18 deletions(-) diff --git a/c/src/exec/libcsupport/src/newlibc.c b/c/src/exec/libcsupport/src/newlibc.c index 2509221d58..e57f537ff5 100644 --- a/c/src/exec/libcsupport/src/newlibc.c +++ b/c/src/exec/libcsupport/src/newlibc.c @@ -35,6 +35,7 @@ #include /* for memset() */ #include /* for extern of _REENT (aka _impure_ptr) */ +#include /* * NOTE: When using RTEMS fake stat, fstat, and isatty, all output @@ -289,6 +290,14 @@ libc_init(int reentrant) } } +/* + * Routines required by the gnat runtime. + */ + +int get_errno() +{ + return errno; +} /* * Function: _exit @@ -338,19 +347,30 @@ void exit(int status) * These are directly supported (and completely correct) in the posix api. */ -#ifndef RTEMS_POSIX_API - -#include +#if !defined(__RTEMS_POSIX_API__) pid_t __getpid(void) { - assert( 0 ); return 0; } +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +pid_t getpid(void) +{ + return __getpid(); +} +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +int kill( pid_t pid, int sig ) +{ + return 0; +} +#endif int __kill( pid_t pid, int sig ) { - assert( 0 ); return 0; } @@ -379,6 +399,5 @@ unsigned int sleep( return 0; } -#endif #endif diff --git a/c/src/lib/libc/newlibc.c b/c/src/lib/libc/newlibc.c index 2509221d58..e57f537ff5 100644 --- a/c/src/lib/libc/newlibc.c +++ b/c/src/lib/libc/newlibc.c @@ -35,6 +35,7 @@ #include /* for memset() */ #include /* for extern of _REENT (aka _impure_ptr) */ +#include /* * NOTE: When using RTEMS fake stat, fstat, and isatty, all output @@ -289,6 +290,14 @@ libc_init(int reentrant) } } +/* + * Routines required by the gnat runtime. + */ + +int get_errno() +{ + return errno; +} /* * Function: _exit @@ -338,19 +347,30 @@ void exit(int status) * These are directly supported (and completely correct) in the posix api. */ -#ifndef RTEMS_POSIX_API - -#include +#if !defined(__RTEMS_POSIX_API__) pid_t __getpid(void) { - assert( 0 ); return 0; } +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +pid_t getpid(void) +{ + return __getpid(); +} +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +int kill( pid_t pid, int sig ) +{ + return 0; +} +#endif int __kill( pid_t pid, int sig ) { - assert( 0 ); return 0; } @@ -379,6 +399,5 @@ unsigned int sleep( return 0; } -#endif #endif diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c index 2509221d58..e57f537ff5 100644 --- a/cpukit/libcsupport/src/newlibc.c +++ b/cpukit/libcsupport/src/newlibc.c @@ -35,6 +35,7 @@ #include /* for memset() */ #include /* for extern of _REENT (aka _impure_ptr) */ +#include /* * NOTE: When using RTEMS fake stat, fstat, and isatty, all output @@ -289,6 +290,14 @@ libc_init(int reentrant) } } +/* + * Routines required by the gnat runtime. + */ + +int get_errno() +{ + return errno; +} /* * Function: _exit @@ -338,19 +347,30 @@ void exit(int status) * These are directly supported (and completely correct) in the posix api. */ -#ifndef RTEMS_POSIX_API - -#include +#if !defined(__RTEMS_POSIX_API__) pid_t __getpid(void) { - assert( 0 ); return 0; } +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +pid_t getpid(void) +{ + return __getpid(); +} +#endif + +#if !defined(__RTEMS_POSIX_API__) && !defined(__GO32__) +int kill( pid_t pid, int sig ) +{ + return 0; +} +#endif int __kill( pid_t pid, int sig ) { - assert( 0 ); return 0; } @@ -379,6 +399,5 @@ unsigned int sleep( return 0; } -#endif #endif