File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1515 * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
1616 * reserved.
1717 * Copyright (c) 2016 Intel, Inc. All rights reserved.
18+ * Copyright (c) 2016 Research Organization for Information Science
19+ * and Technology (RIST). All rights reserved.
1820 *
1921 * $COPYRIGHT$
2022 *
5658
5759#include <fcntl.h>
5860
61+ /*
62+ * Note that some OS's (e.g., NetBSD and Solaris) have statfs(), but
63+ * no struct statfs (!). So check to make sure we have struct statfs
64+ * before allowing the use of statfs().
65+ */
66+ #if defined(HAVE_STATFS ) && (defined(HAVE_STRUCT_STATFS_F_FSTYPENAME ) || \
67+ defined(HAVE_STRUCT_STATFS_F_TYPE ))
68+ #define USE_STATFS 1
69+ #endif
70+
71+
5972/*
6073 * Local functions
6174 */
@@ -220,12 +233,15 @@ static void mca_mpool_hugepage_find_hugepages (void) {
220233 } while (tok );
221234
222235 if (!tok ) {
223- #if HAVE_STATFS
236+ #if defined( USE_STATFS )
224237 struct statfs info ;
225238
226239 statfs (path , & info );
227- page_size = info .f_bsize ;
240+ #elif defined(HAVE_STATVFS )
241+ struct statvfs info ;
242+ statvfs (path , & info );
228243#endif
244+ page_size = info .f_bsize ;
229245 } else {
230246 (void ) sscanf (tok , "pagesize=%lu" , & page_size );
231247 }
You can’t perform that action at this time.
0 commit comments