From bc51d7e98fa57916241751341364d0de3c05e850 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 13 Sep 2001 13:23:37 +0000 Subject: 2001-09-13 Joel Sherrill * src/mprotect.c: New file. Stub required by some gcc's to pass tests. In particular, about 350 ACATS tests fail if this is not present. * src/getpagesize.c: Ditto. * src/sysconf.c: Addition of Solaris value for _SC_STACK_PROT required to pass about 350 ACATS test cases. * src/Makefile.am: Added new files. --- cpukit/posix/ChangeLog | 9 +++++++++ cpukit/posix/src/Makefile.am | 10 ++++++---- cpukit/posix/src/getpagesize.c | 23 +++++++++++++++++++++++ cpukit/posix/src/mprotect.c | 23 +++++++++++++++++++++++ cpukit/posix/src/sysconf.c | 7 ++++++- 5 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 cpukit/posix/src/getpagesize.c create mode 100644 cpukit/posix/src/mprotect.c (limited to 'cpukit/posix') diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog index f7cccea68b..65cde9f685 100644 --- a/cpukit/posix/ChangeLog +++ b/cpukit/posix/ChangeLog @@ -1,3 +1,12 @@ +2001-09-13 Joel Sherrill + + * src/mprotect.c: New file. Stub required by some gcc's to pass tests. + In particular, about 350 ACATS tests fail if this is not present. + * src/getpagesize.c: Ditto. + * src/sysconf.c: Addition of Solaris value for _SC_STACK_PROT required + to pass about 350 ACATS test cases. + * src/Makefile.am: Added new files. + 2001-08-30 Joel Sherrill * macros/rtems/posix/mqueue.inl: Add cast so negation works. diff --git a/cpukit/posix/src/Makefile.am b/cpukit/posix/src/Makefile.am index 3df5b47f38..c841f96353 100644 --- a/cpukit/posix/src/Makefile.am +++ b/cpukit/posix/src/Makefile.am @@ -29,6 +29,8 @@ ID_C_FILES = getegid.c geteuid.c getgid.c getgroups.c getlogin.c getpgrp.c \ KEY_C_FILES = key.c keycreate.c keydelete.c keygetspecific.c \ keyrundestructors.c keysetspecific.c +MEMORY_C_FILES = getpagesize.c mprotect.c + MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ mqueuedeletesupp.c mqueuegetattr.c mqueuenametoid.c mqueuenotify.c \ mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ @@ -77,10 +79,10 @@ TIME_C_FILES = time.c posixtimespecsubtract.c posixtimespectointerval.c \ TIMER_C_FILES = ptimer.c ptimer1.c C_FILES = adasupp.c $(CANCEL_C_FILES) $(CONDITION_VARIABLE_C_FILES) \ - $(ID_C_FILES) $(KEY_C_FILES) $(MESSAGE_QUEUE_C_FILES) $(MUTEX_C_FILES) \ - $(PTHREAD_C_FILES) $(PSIGNAL_C_FILES) sched.c $(SEMAPHORE_C_FILES) \ - sysconf.c $(TIME_C_FILES) $(TIMER_C_FILES) types.c $(ENOSYS_C_FILES) \ - $(BUILD_FOR_NOW_C_FILES) utsname.c + $(ID_C_FILES) $(KEY_C_FILES) $(MEMORY_C_FILES) $(MESSAGE_QUEUE_C_FILES) \ + $(MUTEX_C_FILES) $(PTHREAD_C_FILES) $(PSIGNAL_C_FILES) sched.c \ + $(SEMAPHORE_C_FILES) sysconf.c $(TIME_C_FILES) $(TIMER_C_FILES) types.c \ + $(ENOSYS_C_FILES) $(BUILD_FOR_NOW_C_FILES) utsname.c C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) OBJS = $(C_O_FILES) diff --git a/cpukit/posix/src/getpagesize.c b/cpukit/posix/src/getpagesize.c new file mode 100644 index 0000000000..806c500a9b --- /dev/null +++ b/cpukit/posix/src/getpagesize.c @@ -0,0 +1,23 @@ +/* + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +/*PAGE + * + * Get System Page Size (from SVR4 and 4.2+ BSD) + * + * This is not a functional version but the SPARC backend for at least + * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and + * return a reasonable value. + */ + +size_t getpagesize(void) +{ + return 4096; +} diff --git a/cpukit/posix/src/mprotect.c b/cpukit/posix/src/mprotect.c new file mode 100644 index 0000000000..60740615b5 --- /dev/null +++ b/cpukit/posix/src/mprotect.c @@ -0,0 +1,23 @@ +/* + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +/*PAGE + * + * 12.2.3 Change Memory Protection, P1003.1b-1996, p. 277. + * + * This is not a functional version but the SPARC backend for at least + * gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and + * return 0. + */ + +int mprotect(const void *addr, size_t len, int prot) +{ + return 0; +} diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c index ac7a4104c5..534689892b 100644 --- a/cpukit/posix/src/sysconf.c +++ b/cpukit/posix/src/sysconf.c @@ -26,11 +26,16 @@ long sysconf( case _SC_CLK_TCK: return _TOD_Ticks_per_second; - case _SC_OPEN_MAX: { +o case _SC_OPEN_MAX: { extern unsigned32 rtems_libio_number_iops; return rtems_libio_number_iops; } +#if defined(__sparc__) + case 515: /* Solaris _SC_STACK_PROT */ + return 0; +#endif + default: break; } -- cgit v1.2.3