svn commit: trunk/uClibc: include include/sys libc/sysdeps/linux/c etc...

andersen at uclibc.org andersen at uclibc.org
Tue Oct 4 22:26:12 UTC 2005


Author: andersen
Date: 2005-10-04 15:26:07 -0700 (Tue, 04 Oct 2005)
New Revision: 11757

Log:
Do not stub out functions for mmu-less systems.  Hide all
prototypes for functions disabled on mmu-less systems.


Modified:
   trunk/uClibc/include/sys/mman.h
   trunk/uClibc/include/unistd.h
   trunk/uClibc/libc/sysdeps/linux/common/fork.c
   trunk/uClibc/libc/sysdeps/linux/common/ioperm.c
   trunk/uClibc/libc/sysdeps/linux/common/iopl.c
   trunk/uClibc/libc/sysdeps/linux/common/mlock.c
   trunk/uClibc/libc/sysdeps/linux/common/mlockall.c
   trunk/uClibc/libc/sysdeps/linux/common/munlock.c
   trunk/uClibc/libc/unistd/Makefile
   trunk/uClibc/libc/unistd/daemon.c


Changeset:
Modified: trunk/uClibc/include/sys/mman.h
===================================================================
--- trunk/uClibc/include/sys/mman.h	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/include/sys/mman.h	2005-10-04 22:26:07 UTC (rev 11757)
@@ -96,6 +96,7 @@
 extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
 #endif
 
+#if defined __ARCH_HAS_MMU__
 /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
    be memory resident.  */
 extern int mlock (__const void *__addr, size_t __len) __THROW;
@@ -111,6 +112,7 @@
 /* All currently mapped pages of the process' address space become
    unlocked.  */
 extern int munlockall (void) __THROW;
+#endif
 
 #ifdef __USE_MISC
 /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length

Modified: trunk/uClibc/include/unistd.h
===================================================================
--- trunk/uClibc/include/unistd.h	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/include/unistd.h	2005-10-04 22:26:07 UTC (rev 11757)
@@ -632,10 +632,12 @@
 #endif
 
 
+#ifdef __ARCH_HAS_MMU__
 /* Clone the calling process, creating an exact copy.
    Return -1 for errors, 0 to the new process,
    and the process ID of the new process to the old process.  */
 extern __pid_t fork (void) __THROW;
+#endif
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Clone the calling process, but without copying the whole address space.
@@ -752,10 +754,12 @@
 extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
 
 
+#if defined __ARCH_HAS_MMU__
 /* Put the program in the background, and dissociate from the controlling
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    redirects stdin, stdout, and stderr to /dev/null.  */
 extern int daemon (int __nochdir, int __noclose) __THROW;
+#endif
 #endif /* Use BSD || X/Open.  */
 
 

Modified: trunk/uClibc/libc/sysdeps/linux/common/fork.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/fork.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/fork.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -13,11 +13,5 @@
 #ifdef __ARCH_HAS_MMU__
 #define __NR___libc_fork __NR_fork
 _syscall0(pid_t, __libc_fork);
-#else
-pid_t __libc_fork(void)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
-#endif
 weak_alias(__libc_fork, fork);
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/ioperm.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/ioperm.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/ioperm.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -10,10 +10,4 @@
 #include "syscalls.h"
 #if defined __ARCH_HAS_MMU__ && defined __NR_ioperm
 _syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on);
-#else
-int ioperm(unsigned long from, unsigned long num, int turn_on)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/iopl.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/iopl.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/iopl.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -11,10 +11,4 @@
 /* Tuns out the m68k unistd.h kernel header is broken */
 #if defined __ARCH_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__))
 _syscall1(int, iopl, int, level);
-#else
-int iopl(int level)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/mlock.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/mlock.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/mlock.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_mlock
+#if defined __ARCH_HAS_MMU__ && defined __NR_mlock
 _syscall2(int, mlock, const void *, addr, size_t, len);
-#	endif
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/mlockall.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/mlockall.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/mlockall.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_mlockall
+#if defined __ARCH_HAS_MMU__ && defined __NR_mlockall
 _syscall1(int, mlockall, int, flags);
-#	endif
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/munlock.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/munlock.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/sysdeps/linux/common/munlock.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#	if defined __ARCH_HAS_MMU__ && defined __NR_munlock
+#if defined __ARCH_HAS_MMU__ && defined __NR_munlock
 _syscall2(int, munlock, const void *, addr, size_t, len);
-#	endif
+#endif

Modified: trunk/uClibc/libc/unistd/Makefile
===================================================================
--- trunk/uClibc/libc/unistd/Makefile	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/unistd/Makefile	2005-10-04 22:26:07 UTC (rev 11757)
@@ -27,9 +27,7 @@
 	fpathconf.c confstr.c pathconf.c swab.c usershell.c \
 	getsubopt.c
 
-ifeq ($(strip $(ARCH_HAS_MMU)),y)
-	CSRC += daemon.c
-else
+ifneq ($(strip $(ARCH_HAS_MMU)),y)
 	MOBJ1 += __exec_alloc.o
 endif
 

Modified: trunk/uClibc/libc/unistd/daemon.c
===================================================================
--- trunk/uClibc/libc/unistd/daemon.c	2005-10-04 17:09:50 UTC (rev 11756)
+++ trunk/uClibc/libc/unistd/daemon.c	2005-10-04 22:26:07 UTC (rev 11757)
@@ -29,8 +29,7 @@
 #include <paths.h>
 #include <unistd.h>
 
-/* Note that this file should not be compiled in 
- * unless __ARCH_HAS_MMU__ is defined */
+#if defined __ARCH_HAS_MMU__
 
 int daemon( int nochdir, int noclose )
 {
@@ -66,8 +65,8 @@
 	return(0);
 }
 
+#endif
 
-
 /*-
  * Copyright (c) 1990, 1993
  *	The Regents of the University of California.  All rights reserved.




More information about the uClibc-cvs mailing list