1 /* 2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana 3 * University Research and Technology 4 * Corporation. All rights reserved. 5 * Copyright (c) 2004-2006 The University of Tennessee and The University 6 * of Tennessee Research Foundation. All rights 7 * reserved. 8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 9 * University of Stuttgart. All rights reserved. 10 * Copyright (c) 2004-2005 The Regents of the University of California. 11 * All rights reserved. 12 * Copyright (c) 2013 Los Alamos National Security, LLC. 13 * All rights reserved. 14 * Copyright (c) 2014 Intel, Inc. All rights reserved. 15 * $COPYRIGHT$ 16 * 17 * Additional copyrights may follow 18 * 19 * $HEADER$ 20 */ 21 22 #ifndef OPAL_SYS_LIMITS_H 23 #define OPAL_SYS_LIMITS_H 24 25 #include "opal_config.h" 26 27 #ifdef HAVE_SYS_TYPES_H 28 #include <sys/types.h> 29 #endif 30 31 BEGIN_C_DECLS 32 33 /* define a structure to hold the various limits we find 34 * so that users can neatly access them 35 */ 36 typedef struct opal_sys_limits_t { 37 bool initialized; 38 int num_files; 39 int num_procs; 40 size_t file_size; 41 } opal_sys_limits_t; 42 43 /* since we only want to do this once, we will store the 44 * values in the following locations - provide access here 45 */ 46 OPAL_DECLSPEC extern opal_sys_limits_t opal_sys_limits; 47 48 /* Get the system resource limits and, if requested, set 49 * them to the specified limit 50 */ 51 OPAL_DECLSPEC int opal_util_init_sys_limits(char **errmsg); 52 53 /** 54 * Get pagesize 55 */ 56 OPAL_DECLSPEC int opal_getpagesize(void); 57 58 59 END_C_DECLS 60 61 #endif /* OPAL_STRNCPY_H */