Path: blob/master/src/hotspot/os/aix/libo4.hpp
40930 views
/*1* Copyright (c) 2012, 2016 SAP SE. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324// Class libo4 is a C++ wrapper around the libo4 porting library. It handles25// basic stuff like dynamic loading, library initialization etc.26// The libo4 porting library is a set of functions that bridge from the AIX27// runtime environment on OS/400 (aka PASE layer) into native OS/40028// functionality (aka ILE layer) to close some functional gaps that exist in29// the PASE layer.3031#ifndef OS_AIX_LIBO4_HPP32#define OS_AIX_LIBO4_HPP3334class libo4 {35public:36// Initialize the libo4 porting library.37// Returns true if succeeded, false if error.38static bool init();3940// Triggers cleanup of the libo4 porting library.41static void cleanup();4243// Returns a number of memory statistics from OS/400.44//45// See libo4.h for details on this API.46//47// Specify NULL for numbers you are not interested in.48//49// Returns false if an error happened. Activate OsMisc trace for50// trace output.51//52static bool get_memory_info(unsigned long long* p_virt_total,53unsigned long long* p_real_total,54unsigned long long* p_real_free,55unsigned long long* p_pgsp_total,56unsigned long long* p_pgsp_free);5758// Returns information about system load59// (similar to "loadavg()" under other Unices)60//61// See libo4.h for details on this API.62//63// Specify NULL for numbers you are not interested in.64//65// Returns false if an error happened. Activate OsMisc trace for66// trace output.67//68static bool get_load_avg(double* p_avg1, double* p_avg5, double* p_avg15);6970// This is a replacement for the "realpath()" API which does not really work71// in PASE together with the (case insensitive but case preserving)72// filesystem on OS/400.73//74// See libo4.h for details on this API.75//76// Returns false if an error happened. Activate OsMisc trace for77// trace output.78//79static bool realpath(const char* file_name, char* resolved_name,80int resolved_name_len);8182// Call libo4_RemoveEscapeMessageFromJoblogByContext API to remove messages83// from the OS/400 job log.84//85// See libo4.h for details on this API.86static bool removeEscapeMessageFromJoblogByContext(const void* context);87};8889#endif // OS_AIX_LIBO4_HPP909192