URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/linux/uClibc/test/mmap
- from Rev 1325 to Rev 1765
- ↔ Reverse comparison
Rev 1325 → Rev 1765
/mmap.c
0,0 → 1,27
|
/* 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 = mmap(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); |
} |
|
/Makefile
0,0 → 1,40
# Makefile for uClibc |
# |
# Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org> |
# |
# This program is free software; you can redistribute it and/or modify it under |
# the terms of the GNU Library General Public License as published by the Free |
# Software Foundation; either version 2 of the License, or (at your option) any |
# later version. |
# |
# This program is distributed in the hope that it will be useful, but WITHOUT |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more |
# details. |
# |
# You should have received a copy of the GNU Library General Public License |
# along with this program; if not, write to the Free Software Foundation, Inc., |
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
TESTDIR=../ |
include $(TESTDIR)/Rules.mak |
|
|
TARGETS=mmap |
all: $(TARGETS) |
|
mmap: mmap.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak |
-@ echo "-------" |
-@ echo " " |
-@ echo "Compiling vs uClibc: " |
-@ echo " " |
$(CC) $(CFLAGS) -c $< -o $@.o |
$(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS) |
$(STRIPTOOL) -x -R .note -R .comment $@ |
-./$@ |
-@ echo " " |
|
clean: |
$(RM) *.[oa] *~ core $(TARGETS) |
|
|
.
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+mmap
+mmap.o