aboutsummaryrefslogtreecommitdiff
path: root/init_privutils.c
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-10-17 15:40:08 +0100
committerEric B Munson <ebmunson@us.ibm.com>2008-10-21 11:14:23 +0100
commite23e851e93b1d071f13053b8aa03f8961f583f12 (patch)
tree7529a5e7fc26ecf50e7ace11e6f8735235a2d8e0 /init_privutils.c
parent82ce959dfa0edbe4a33d8a632508552106b7d7ec (diff)
downloadlibhugetlbfs-e23e851e93b1d071f13053b8aa03f8961f583f12.tar.gz
add a new private utilities library
Add a new private utilities library consisting of various useful helpers normally hidden within libhugetlbfs. Extend the library local marker idiom to include a private utilities marker __pu_. When we build libhugetlbfs these are forced local when building libhugetlbfs_privutils these are the only routines exported. This makes it very hard for the two libraries to interfere with each other when both are linked to the same binary, which is particularly important when testing the library; we must test the real one. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Adam Litke <agl@us.ibm.com>
Diffstat (limited to 'init_privutils.c')
-rw-r--r--init_privutils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/init_privutils.c b/init_privutils.c
new file mode 100644
index 0000000..6c9243d
--- /dev/null
+++ b/init_privutils.c
@@ -0,0 +1,25 @@
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2008 Nishanth Aravamudan, IBM Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libhugetlbfs_internal.h"
+
+static void __attribute__ ((constructor)) setup_libhugetlbfs(void)
+{
+ hugetlbfs_setup_debug();
+}