svn commit: trunk/uClibc/libc: inet pwd_grp stdio stdlib string string/ etc...

psm at uclibc.org psm at uclibc.org
Thu Mar 23 11:17:44 UTC 2006


Author: psm
Date: 2006-03-23 03:17:41 -0800 (Thu, 23 Mar 2006)
New Revision: 14624

Log:
Mark some functions as BSD only

Modified:
   trunk/uClibc/libc/inet/hostid.c
   trunk/uClibc/libc/pwd_grp/pwd_grp.c
   trunk/uClibc/libc/stdio/setbuffer.c
   trunk/uClibc/libc/stdio/setlinebuf.c
   trunk/uClibc/libc/stdlib/mkdtemp.c
   trunk/uClibc/libc/string/generic/strsep.c
   trunk/uClibc/libc/string/strsep.c
   trunk/uClibc/libc/sysdeps/linux/common/acct.c
   trunk/uClibc/libc/sysdeps/linux/common/chroot.c
   trunk/uClibc/libc/sysdeps/linux/common/getdnnm.c
   trunk/uClibc/libc/sysdeps/linux/common/madvise.c
   trunk/uClibc/libc/sysdeps/linux/common/setdomainname.c
   trunk/uClibc/libc/sysdeps/linux/common/setgroups.c
   trunk/uClibc/libc/sysdeps/linux/common/sethostname.c
   trunk/uClibc/libc/sysdeps/linux/common/settimeofday.c
   trunk/uClibc/libc/sysdeps/linux/common/vhangup.c
   trunk/uClibc/libc/termios/cfmakeraw.c
   trunk/uClibc/libc/termios/cfsetspeed.c
   trunk/uClibc/libc/unistd/daemon.c
   trunk/uClibc/libc/unistd/getpass.c
   trunk/uClibc/libc/unistd/usershell.c


Changeset:
Modified: trunk/uClibc/libc/inet/hostid.c
===================================================================
--- trunk/uClibc/libc/inet/hostid.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/inet/hostid.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -27,6 +27,7 @@
 
 #define HOSTID "/etc/hostid"
 
+#ifdef __USE_BSD
 int sethostid(long int new_id)
 {
 	int fd;
@@ -39,6 +40,7 @@
 	close (fd);
 	return ret;
 }
+#endif
 
 long int gethostid(void)
 {

Modified: trunk/uClibc/libc/pwd_grp/pwd_grp.c
===================================================================
--- trunk/uClibc/libc/pwd_grp/pwd_grp.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/pwd_grp/pwd_grp.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -42,7 +42,6 @@
 libc_hidden_proto(strcmp)
 libc_hidden_proto(strcpy)
 libc_hidden_proto(strlen)
-libc_hidden_proto(setgroups)
 libc_hidden_proto(strtoul)
 libc_hidden_proto(rewind)
 libc_hidden_proto(fgets_unlocked)
@@ -702,6 +701,10 @@
 /**********************************************************************/
 #ifdef L_initgroups
 
+#ifdef __USE_BSD
+
+libc_hidden_proto(setgroups)
+
 int initgroups(const char *user, gid_t gid)
 {
 	FILE *grfile;
@@ -755,6 +758,7 @@
 	free(group_list);
 	return rv;
 }
+#endif
 
 #endif
 /**********************************************************************/

Modified: trunk/uClibc/libc/stdio/setbuffer.c
===================================================================
--- trunk/uClibc/libc/stdio/setbuffer.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/stdio/setbuffer.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -7,6 +7,8 @@
 
 #include "_stdio.h"
 
+#ifdef __USE_BSD
+
 libc_hidden_proto(setvbuf)
 
 /* A BSD function.  The implementation matches the linux man page,
@@ -21,3 +23,4 @@
 	setvbuf(stream, buf, (buf ? _IOFBF : _IONBF), size);
 #endif
 }
+#endif

Modified: trunk/uClibc/libc/stdio/setlinebuf.c
===================================================================
--- trunk/uClibc/libc/stdio/setlinebuf.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/stdio/setlinebuf.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -7,6 +7,8 @@
 
 #include "_stdio.h"
 
+#ifdef __USE_BSD
+
 libc_hidden_proto(setvbuf)
 
 /* A BSD function.  The implementation matches the linux man page,
@@ -20,3 +22,4 @@
 	setvbuf(stream, NULL, _IOLBF, (size_t) 0);
 #endif
 }
+#endif

Modified: trunk/uClibc/libc/stdlib/mkdtemp.c
===================================================================
--- trunk/uClibc/libc/stdlib/mkdtemp.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/stdlib/mkdtemp.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include "../misc/internals/tempname.h"
 
+#ifdef __USE_BSD
 /* Generate a unique temporary directory name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.
@@ -34,3 +35,4 @@
 
     return template;
 }
+#endif

Modified: trunk/uClibc/libc/string/generic/strsep.c
===================================================================
--- trunk/uClibc/libc/string/generic/strsep.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/string/generic/strsep.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -18,10 +18,12 @@
 
 #include <string.h>
 
-libc_hidden_proto(strsep)
+#ifdef __USE_BSD
+
 libc_hidden_proto(strchr)
 libc_hidden_proto(strpbrk)
 
+libc_hidden_proto(strsep)
 char *strsep (char **stringp, const char *delim)
 {
   char *begin, *end;
@@ -66,3 +68,4 @@
   return begin;
 }
 libc_hidden_def(strsep)
+#endif

Modified: trunk/uClibc/libc/string/strsep.c
===================================================================
--- trunk/uClibc/libc/string/strsep.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/string/strsep.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -7,10 +7,12 @@
 
 #include "_string.h"
 
-libc_hidden_proto(strsep)
+#ifdef __USE_BSD
+
 libc_hidden_proto(strpbrk)
 libc_hidden_proto(strcspn)
 
+libc_hidden_proto(strsep)
 char *strsep(char ** __restrict s1, const char * __restrict s2)
 {
 	register char *s = *s1;
@@ -32,3 +34,4 @@
 	return s;
 }
 libc_hidden_def(strsep)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/acct.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/acct.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/acct.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -9,4 +9,6 @@
 
 #include "syscalls.h"
 #include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 _syscall1(int, acct, const char *, filename);
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/chroot.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/chroot.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/chroot.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <sys/param.h>
 
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 #define __NR___syscall_chroot __NR_chroot
 static inline _syscall1(int, __syscall_chroot, const char *, path);
 
@@ -19,3 +20,4 @@
 {
 	return __syscall_chroot(path);
 }
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/getdnnm.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/getdnnm.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/getdnnm.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -11,14 +11,13 @@
 #include <errno.h>
 #include <sys/utsname.h>
 
-libc_hidden_proto(getdomainname)
-
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 libc_hidden_proto(strlen)
 libc_hidden_proto(strcpy)
 libc_hidden_proto(uname)
 
-int
-getdomainname(char *name, size_t len)
+libc_hidden_proto(getdomainname)
+int getdomainname(char *name, size_t len)
 {
   struct utsname uts;
 
@@ -45,3 +44,4 @@
   return 0;
 }
 libc_hidden_def(getdomainname)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/madvise.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/madvise.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/madvise.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -9,6 +9,6 @@
 
 #include "syscalls.h"
 #include <sys/mman.h>
-#ifdef __NR_madvise
+#if defined __NR_madvise && defined __USE_BSD
 _syscall3(int, madvise, void *, __addr, size_t, __len, int, __advice);
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/setdomainname.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/setdomainname.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/setdomainname.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -9,4 +9,6 @@
 
 #include "syscalls.h"
 #include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 _syscall2(int, setdomainname, const char *, name, size_t, len);
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/setgroups.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/setgroups.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/setgroups.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -12,6 +12,8 @@
 #include <unistd.h>
 #include <grp.h>
 
+#ifdef __USE_BSD
+
 libc_hidden_proto(setgroups)
 
 #if defined(__NR_setgroups32)
@@ -62,3 +64,4 @@
 #endif
 
 libc_hidden_def(setgroups)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/sethostname.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/sethostname.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/sethostname.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -9,4 +9,6 @@
 
 #include "syscalls.h"
 #include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 _syscall2(int, sethostname, const char *, name, size_t, len);
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/settimeofday.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/settimeofday.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/settimeofday.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -10,8 +10,11 @@
 #include "syscalls.h"
 #include <sys/time.h>
 
+#ifdef __USE_BSD
+
 libc_hidden_proto(settimeofday)
 
 _syscall2(int, settimeofday, const struct timeval *, tv,
 		  const struct timezone *, tz);
 libc_hidden_def(settimeofday)
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/vhangup.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/vhangup.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/sysdeps/linux/common/vhangup.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -9,4 +9,6 @@
 
 #include "syscalls.h"
 #include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 _syscall0(int, vhangup);
+#endif

Modified: trunk/uClibc/libc/termios/cfmakeraw.c
===================================================================
--- trunk/uClibc/libc/termios/cfmakeraw.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/termios/cfmakeraw.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -18,6 +18,7 @@
 
 #include <termios.h>
 
+#ifdef __USE_BSD
 /* Set *T to indicate raw mode.  */
 void cfmakeraw (struct termios *t)
 {
@@ -29,3 +30,4 @@
   t->c_cc[VMIN] = 1;		/* read returns when one char is available.  */
   t->c_cc[VTIME] = 0;
 }
+#endif

Modified: trunk/uClibc/libc/termios/cfsetspeed.c
===================================================================
--- trunk/uClibc/libc/termios/cfsetspeed.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/termios/cfsetspeed.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -20,6 +20,8 @@
 #include <errno.h>
 #include <stddef.h>
 
+#ifdef __USE_BSD
+
 libc_hidden_proto(cfsetispeed)
 libc_hidden_proto(cfsetospeed)
 
@@ -171,3 +173,4 @@
 
   return -1;
 }
+#endif

Modified: trunk/uClibc/libc/unistd/daemon.c
===================================================================
--- trunk/uClibc/libc/unistd/daemon.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/unistd/daemon.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -46,6 +46,8 @@
 #include <paths.h>
 #include <unistd.h>
 
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+
 libc_hidden_proto(open)
 libc_hidden_proto(close)
 libc_hidden_proto(_exit)
@@ -87,3 +89,4 @@
 	}
 	return(0);
 }
+#endif

Modified: trunk/uClibc/libc/unistd/getpass.c
===================================================================
--- trunk/uClibc/libc/unistd/getpass.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/unistd/getpass.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -22,6 +22,8 @@
 #include <unistd.h>
 #include <string.h>
 
+#if defined __USE_BSD && (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+
 libc_hidden_proto(strlen)
 libc_hidden_proto(tcsetattr)
 libc_hidden_proto(tcgetattr)
@@ -118,3 +120,4 @@
 
   return buf;
 }
+#endif

Modified: trunk/uClibc/libc/unistd/usershell.c
===================================================================
--- trunk/uClibc/libc/unistd/usershell.c	2006-03-23 11:14:16 UTC (rev 14623)
+++ trunk/uClibc/libc/unistd/usershell.c	2006-03-23 11:17:41 UTC (rev 14624)
@@ -40,6 +40,8 @@
 #include <unistd.h>
 #include <paths.h>
 
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+
 libc_hidden_proto(fstat)
 libc_hidden_proto(fopen)
 libc_hidden_proto(fclose)
@@ -146,3 +148,4 @@
     fclose(fp);
     return (char **) validsh;
 }
+#endif




More information about the uClibc-cvs mailing list