summaryrefslogtreecommitdiff
path: root/test/mmap/mmap2.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:29:21 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:31:55 +0200
commit99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch)
tree2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/mmap/mmap2.c
parent543308f6c46cf2edf8a524bc9c631e472570fe72 (diff)
test: remove test suite
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/mmap/mmap2.c')
-rw-r--r--test/mmap/mmap2.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/test/mmap/mmap2.c b/test/mmap/mmap2.c
deleted file mode 100644
index 1d5f5db5e..000000000
--- a/test/mmap/mmap2.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap
- * returns -EOVERFLOW.
- *
- * Since off_t is defined as a long int and the sign bit is set in the address,
- * the shift operation shifts in ones instead of zeroes
- * from the left. This results the offset sent to the kernel function becomes
- * 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12.
- */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
- __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
-
-#define MAP_SIZE sysconf(_SC_PAGESIZE)
-#define MAP_MASK (MAP_SIZE - 1)
-
-int main(int argc, char **argv) {
- void* map_base = 0;
- int fd;
- off_t target = 0xfffff000;
- if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) {
- /* skip test for non-root users */
- if (errno == EACCES)
- return 0;
- FATAL;
- }
- printf("/dev/mem opened.\n");
- fflush(stdout);
-
- /* Map one page */
- map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
- fd, target & ~MAP_MASK);
- if(map_base == (void *) -1) FATAL;
- printf("Memory mapped at address %p.\n", map_base);
- fflush(stdout);
- if(munmap(map_base, MAP_SIZE) == -1) FATAL;
- close(fd);
- return 0;
-}