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

rmh at alioth.debian.org rmh at alioth.debian.org
Sat Jan 18 23:28:58 UTC 2014


Author: rmh
Date: 2014-01-18 23:28:58 +0000 (Sat, 18 Jan 2014)
New Revision: 5354

Added:
   trunk/freebsd-glue/include/libgen.h
   trunk/freebsd-glue/src/freebsd-glue/basename.c
Modified:
   trunk/freebsd-glue/debian/changelog
   trunk/freebsd-glue/debian/copyright
   trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
   trunk/freebsd-glue/src/freebsd-glue/Makefile
Log:
Add basename_r().

Modified: trunk/freebsd-glue/debian/changelog
===================================================================
--- trunk/freebsd-glue/debian/changelog	2014-01-18 23:22:56 UTC (rev 5353)
+++ trunk/freebsd-glue/debian/changelog	2014-01-18 23:28:58 UTC (rev 5354)
@@ -11,6 +11,7 @@
   * Add arc4random_buf() prototype to <stdlib.h>.
   * Add _PATH_GBDE, _PATH_GELI and _PATH_MDCONFIG to <paths.h>.
   * Add swapon() and swapoff() prototypes to <unistd.h>.
+  * Add basename_r().
 
  -- Robert Millan <rmh at debian.org>  Wed, 08 Jan 2014 22:36:52 +0100
 

Modified: trunk/freebsd-glue/debian/copyright
===================================================================
--- trunk/freebsd-glue/debian/copyright	2014-01-18 23:22:56 UTC (rev 5353)
+++ trunk/freebsd-glue/debian/copyright	2014-01-18 23:28:58 UTC (rev 5354)
@@ -37,13 +37,11 @@
 License: BSD (2 clause)
 
 Files: src/freebsd-glue/random.c
-Copyright: 2013, Robert Millan <rmh at debian.org>
+ src/freebsd-glue/sysarch.c
+ src/freebsd-glue/basename.c
+Copyright: 2013, 2014, Robert Millan <rmh at debian.org>
 License: BSD (2 clause)
 
-Files: src/freebsd-glue/sysarch.c
-Copyright: 2014, Robert Millan <rmh at debian.org>
-License: BSD (2 clause)
-
 Files: include/sys/endian.h
 Copyright: 2002, Thomas Moestl <tmm at FreeBSD.org>
 License: BSD (2 clause)

Modified: trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
===================================================================
--- trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols	2014-01-18 23:22:56 UTC (rev 5353)
+++ trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols	2014-01-18 23:28:58 UTC (rev 5354)
@@ -7,6 +7,7 @@
  (arch=kfreebsd-i386)i386_get_gsbase at Base 0.2.8
  (arch=kfreebsd-i386)i386_set_fsbase at Base 0.2.8
  (arch=kfreebsd-i386)i386_set_gsbase at Base 0.2.8
+ basename_r at Base 0.2.17
  (arch=kfreebsd-any)bsd_sendfile at Base 0.2.6
  cgetcap at Base 0.1.15
  cgetclose at Base 0.1.15

Added: trunk/freebsd-glue/include/libgen.h
===================================================================
--- trunk/freebsd-glue/include/libgen.h	                        (rev 0)
+++ trunk/freebsd-glue/include/libgen.h	2014-01-18 23:28:58 UTC (rev 5354)
@@ -0,0 +1,14 @@
+#include_next <libgen.h>
+
+#ifndef _LIBGEN_H_
+#define _LIBGEN_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+char *basename_r(const char *, char *);
+
+__END_DECLS
+
+#endif

Modified: trunk/freebsd-glue/src/freebsd-glue/Makefile
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/Makefile	2014-01-18 23:22:56 UTC (rev 5353)
+++ trunk/freebsd-glue/src/freebsd-glue/Makefile	2014-01-18 23:28:58 UTC (rev 5354)
@@ -1,5 +1,6 @@
 LIB=	freebsd-glue
 SRCS=	\
+	basename.c \
 	exec.c \
 	feature_present.c \
 	fstab.c \

Added: trunk/freebsd-glue/src/freebsd-glue/basename.c
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/basename.c	                        (rev 0)
+++ trunk/freebsd-glue/src/freebsd-glue/basename.c	2014-01-18 23:28:58 UTC (rev 5354)
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2014 Robert Millan <rmh at debian.org>
+ *
+ * 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 AUTHOR 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.
+ *
+ */
+
+#include <libgen.h>
+#include <string.h>
+#include <sys/param.h>
+
+char *
+basename_r (const char *path, char *bname)
+{
+  strncpy (bname, path, MAXPATHLEN);
+  return __xpg_basename (bname);
+}




More information about the Glibc-bsd-commits mailing list