aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2008-02-27 13:00:25 -0800
committerNishanth Aravamudan <nacc@us.ibm.com>2008-02-28 15:52:32 -0800
commite068a9516ead1d7a0b55be4dd545fc2b2cd6528a (patch)
tree8bf261e9b57bb87e448a63e0093e99abd09dabcc /init.c
parent5f6c3a5a85e93720e759a5927214f1356fe74348 (diff)
downloadlibhugetlbfs-e068a9516ead1d7a0b55be4dd545fc2b2cd6528a.tar.gz
libhugetlbfs: consolidate to one constructor
Use one constructor to control the constructor order for libhugetlbfs. Currently, the constructors are run in the order their containing object files are linked in to libhugetlbfs.so. This is fragile as new features are added. Instead, have one constructor that calls the others (which are now no longer actually constructors). Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Acked-by: Andrew Hastings <abh@cray.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'init.c')
-rw-r--r--init.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/init.c b/init.c
new file mode 100644
index 0000000..2aca5a6
--- /dev/null
+++ b/init.c
@@ -0,0 +1,27 @@
+/*
+ * 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();
+ __hugetlbfs_setup_elflink();
+ __hugetlbfs_setup_morecore();
+}