6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "jvm.h" 26 #include "memory/allocation.inline.hpp" 27 #include "utilities/globalDefinitions.hpp" 28 #include "runtime/frame.inline.hpp" 29 #include "runtime/interfaceSupport.inline.hpp" 30 #include "runtime/os.hpp" 31 #include "services/memTracker.hpp" 32 #include "utilities/align.hpp" 33 #include "utilities/macros.hpp" 34 #include "utilities/vmError.hpp" 35 36 #include <dlfcn.h> 37 #include <pthread.h> 38 #include <signal.h> 39 #include <sys/mman.h> 40 #include <sys/resource.h> 41 #include <sys/utsname.h> 42 #include <time.h> 43 #include <unistd.h> 44 45 // Todo: provide a os::get_max_process_id() or similar. Number of processes 46 // may have been configured, can be read more accurately from proc fs etc. 47 #ifndef MAX_PID 48 #define MAX_PID INT_MAX 49 #endif 50 #define IS_VALID_PID(p) (p > 0 && p < MAX_PID) 51 52 #ifndef MAP_ANONYMOUS | 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "jvm.h" 26 #include "logging/log.hpp" 27 #include "memory/allocation.inline.hpp" 28 #include "utilities/globalDefinitions.hpp" 29 #include "runtime/frame.inline.hpp" 30 #include "runtime/interfaceSupport.inline.hpp" 31 #include "runtime/os.hpp" 32 #include "services/memTracker.hpp" 33 #include "utilities/align.hpp" 34 #include "utilities/formatBuffer.hpp" 35 #include "utilities/macros.hpp" 36 #include "utilities/vmError.hpp" 37 38 #include <dlfcn.h> 39 #include <pthread.h> 40 #include <signal.h> 41 #include <sys/mman.h> 42 #include <sys/resource.h> 43 #include <sys/utsname.h> 44 #include <time.h> 45 #include <unistd.h> 46 47 // Todo: provide a os::get_max_process_id() or similar. Number of processes 48 // may have been configured, can be read more accurately from proc fs etc. 49 #ifndef MAX_PID 50 #define MAX_PID INT_MAX 51 #endif 52 #define IS_VALID_PID(p) (p > 0 && p < MAX_PID) 53 54 #ifndef MAP_ANONYMOUS |