summaryrefslogtreecommitdiffstats
path: root/test/mmap/mmap64.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-25 03:34:19 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-25 03:34:19 +0000
commit883d76b183f3a7ca12e11a7171bc5f087c68b77a (patch)
treeead64dc870ebc6107e23254183dabf0524f42dae /test/mmap/mmap64.c
parent6e43cc2ba236f4b032db1d02034baaf09caa2ec7 (diff)
downloaduClibc-alpine-883d76b183f3a7ca12e11a7171bc5f087c68b77a.tar.bz2
uClibc-alpine-883d76b183f3a7ca12e11a7171bc5f087c68b77a.tar.xz
Hopefully this will work.
Diffstat (limited to 'test/mmap/mmap64.c')
-rw-r--r--test/mmap/mmap64.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/mmap/mmap64.c b/test/mmap/mmap64.c
new file mode 100644
index 000000000..066d03c24
--- /dev/null
+++ b/test/mmap/mmap64.c
@@ -0,0 +1,24 @@
+
+/* The mmap test is useful, since syscalls with 6 arguments
+ * (as mmap) are done differently on various architectures.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+int main(int argc, char **argv)
+{
+ void *ptr;
+
+ ptr = mmap64(NULL, 4096, PROT_READ|PROT_WRITE,
+ MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
+
+ if (ptr == MAP_FAILED) {
+ perror("mmap");
+ exit(1);
+ }
+ printf("mmap returned %p\n", ptr);
+ exit(0);
+}