[Glibc-bsd-commits] r5079 - in trunk/freebsd-glue: debian include src

Robert Millan rmh at alioth.debian.org
Sun Oct 20 13:14:54 UTC 2013


Author: rmh
Date: 2013-10-20 13:14:54 +0000 (Sun, 20 Oct 2013)
New Revision: 5079

Added:
   trunk/freebsd-glue/src/cpuset.c
Modified:
   trunk/freebsd-glue/debian/changelog
   trunk/freebsd-glue/include/fcntl.h
   trunk/freebsd-glue/include/stdlib.h
   trunk/freebsd-glue/src/Makefile
   trunk/freebsd-glue/src/namespace.h
   trunk/freebsd-glue/src/un-namespace.h
Log:
Fix unresolved dependencies on libc hidden symbols (_open, _read, _close), libdb and cpuset family of functions.

Modified: trunk/freebsd-glue/debian/changelog
===================================================================
--- trunk/freebsd-glue/debian/changelog	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/debian/changelog	2013-10-20 13:14:54 UTC (rev 5079)
@@ -1,3 +1,10 @@
+freebsd-glue (0.1.11) UNRELEASED; urgency=low
+
+  * Fix unresolved dependencies on libc hidden symbols (_open, _read,
+    _close), libdb and cpuset family of functions.
+
+ -- Robert Millan <rmh at debian.org>  Sun, 20 Oct 2013 15:14:22 +0200
+
 freebsd-glue (0.1.10) unstable; urgency=low
 
   * Add libdb-dev to Depends / Build-Depends.

Modified: trunk/freebsd-glue/include/fcntl.h
===================================================================
--- trunk/freebsd-glue/include/fcntl.h	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/include/fcntl.h	2013-10-20 13:14:54 UTC (rev 5079)
@@ -1,2 +1,16 @@
 #include_next <fcntl.h>
 #include <sys/fcntl.h>
+
+#ifndef _FREEBSD_FCNTL_H_
+#define _FREEBSD_FCNTL_H_
+
+#ifdef __FREEBSD_LIBC
+/* On FreeBSD, these are hidden symbols provided by libc. We use
+   macros to redirect them, but only them visible to freebsd-glue
+   code.  */
+#define _open	open
+#define _read	read
+#define _close	close
+#endif
+
+#endif

Modified: trunk/freebsd-glue/include/stdlib.h
===================================================================
--- trunk/freebsd-glue/include/stdlib.h	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/include/stdlib.h	2013-10-20 13:14:54 UTC (rev 5079)
@@ -9,8 +9,10 @@
 
 u_int32_t arc4random (void);
 const char *getprogname(void);
+void setprogname (const char *);
 void *reallocf(void *ptr, size_t size);
 void srandomdev (void);
+long long strtonum (const char *nptr, long long minval, long long maxval, const char **errstr);
 
 char	*cgetcap(char *, const char *, int);
 int	 cgetclose(void);

Modified: trunk/freebsd-glue/src/Makefile
===================================================================
--- trunk/freebsd-glue/src/Makefile	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/src/Makefile	2013-10-20 13:14:54 UTC (rev 5079)
@@ -12,10 +12,15 @@
 	zopen.c \
 	${NULL}
 
+LDADD=	-ldb
+
+CFLAGS+=	-D__FREEBSD_LIBC
+
 SYS!=	dpkg-architecture -qDEB_HOST_GNU_SYSTEM
 
 .if ${SYS} == "kfreebsd-gnu"
 SRCS+=	\
+	cpuset.c \
 	disklabel.c \
 	linkaddr.c \
 	login_class.c \

Added: trunk/freebsd-glue/src/cpuset.c
===================================================================
--- trunk/freebsd-glue/src/cpuset.c	                        (rev 0)
+++ trunk/freebsd-glue/src/cpuset.c	2013-10-20 13:14:54 UTC (rev 5079)
@@ -0,0 +1,34 @@
+#include <sys/param.h>
+#include <sys/cpuset.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+int
+cpuset (cpusetid_t *setid)
+{
+  return syscall (SYS_cpuset, setid);
+}
+
+int
+cpuset_setid (cpuwhich_t which, id_t id, cpusetid_t setid)
+{
+  return syscall (SYS_cpuset_setid, which, id, setid);
+}
+
+int
+cpuset_getid (cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid)
+{
+  return syscall (SYS_cpuset_getid, level, which, id, setid);
+}
+
+int
+cpuset_getaffinity (cpulevel_t level, cpuwhich_t which, id_t id, size_t setsize, cpuset_t *mask)
+{
+  return syscall (SYS_cpuset_getaffinity, level, which, id, setsize, mask);
+}
+
+int
+cpuset_setaffinity (cpulevel_t level, cpuwhich_t which, id_t id, size_t setsize, const cpuset_t *mask)
+{
+  return syscall (SYS_cpuset_setaffinity, level, which, id, setsize, mask);
+}

Modified: trunk/freebsd-glue/src/namespace.h
===================================================================
--- trunk/freebsd-glue/src/namespace.h	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/src/namespace.h	2013-10-20 13:14:54 UTC (rev 5079)
@@ -1,47 +1,3 @@
-/*
- * Copyright (c) 2001 Daniel Eischen <deischen at FreeBSD.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
 #ifndef _NAMESPACE_H_
 #define _NAMESPACE_H_
-
-/*
- * Adjust names so that headers declare "hidden" names.
- *
- * README: When modifying this file don't forget to make the appropriate
- *         changes in un-namespace.h!!!
- */
-
-/*
- * Prototypes for syscalls/functions that need to be overridden
- * in libc_r/libpthread.
- */
-#define		close				_close
-#define		open				_open
-#define		read				_read
-
-#endif /* _NAMESPACE_H_ */
+#endif

Modified: trunk/freebsd-glue/src/un-namespace.h
===================================================================
--- trunk/freebsd-glue/src/un-namespace.h	2013-10-20 10:56:30 UTC (rev 5078)
+++ trunk/freebsd-glue/src/un-namespace.h	2013-10-20 13:14:54 UTC (rev 5079)
@@ -1,36 +1,3 @@
-/*
- * Copyright (c) 2001 Daniel Eischen <deischen at FreeBSD.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
 #ifndef _UN_NAMESPACE_H_
 #define _UN_NAMESPACE_H_
-
-#undef		close
-#undef		open
-#undef		read
-
-#endif	/* _UN_NAMESPACE_H_ */
+#endif




More information about the Glibc-bsd-commits mailing list