summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-09-13 13:23:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-09-13 13:23:37 +0000
commitbc51d7e98fa57916241751341364d0de3c05e850 (patch)
treef1864d1a492aeb58dd628c39fffa752e4644942d /cpukit/posix/src
parent986e1113578784101cad6169e0a0f5e26e3efd67 (diff)
downloadrtems-bc51d7e98fa57916241751341364d0de3c05e850.tar.bz2
2001-09-13 Joel Sherrill <joel@OARcorp.com>
* 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.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/Makefile.am10
-rw-r--r--cpukit/posix/src/getpagesize.c23
-rw-r--r--cpukit/posix/src/mprotect.c23
-rw-r--r--cpukit/posix/src/sysconf.c7
4 files changed, 58 insertions, 5 deletions
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 <unistd.h>
+
+/*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 <unistd.h>
+
+/*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;
}