src/hotspot/os/aix/libo4.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 39298 hotspot/src/os/aix/vm/libo4.hpp@0517ab37a67c
child 53244 9807daeb47c4
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     1
/*
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
     2
 * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     4
 *
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     8
 *
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    13
 * accompanied this code).
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    14
 *
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    18
 *
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    21
 * questions.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    22
 *
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    23
 */
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    24
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    25
// Class libo4 is a C++ wrapper around the libo4 porting library. It handles
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    26
// basic stuff like dynamic loading, library initialization etc.
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    27
// The libo4 porting library is a set of functions that bridge from the AIX
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    28
// runtime environment on OS/400 (aka PASE layer) into native OS/400
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    29
// functionality (aka ILE layer) to close some functional gaps that exist in
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    30
// the PASE layer.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    31
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    32
#ifndef OS_AIX_VM_LIBO4_HPP
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    33
#define OS_AIX_VM_LIBO4_HPP
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    34
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    35
class libo4 {
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    36
public:
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    37
  // Initialize the libo4 porting library.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    38
  // Returns true if succeeded, false if error.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    39
  static bool init();
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    40
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    41
  // Triggers cleanup of the libo4 porting library.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    42
  static void cleanup();
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    43
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    44
  // Returns a number of memory statistics from OS/400.
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    45
  //
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    46
  // See libo4.h for details on this API.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    47
  //
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    48
  // Specify NULL for numbers you are not interested in.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    49
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    50
  // Returns false if an error happened. Activate OsMisc trace for
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    51
  // trace output.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    52
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    53
  static bool get_memory_info(unsigned long long* p_virt_total,
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    54
                              unsigned long long* p_real_total,
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    55
                              unsigned long long* p_real_free,
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    56
                              unsigned long long* p_pgsp_total,
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    57
                              unsigned long long* p_pgsp_free);
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    58
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    59
  // Returns information about system load
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    60
  // (similar to "loadavg()" under other Unices)
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    61
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    62
  // See libo4.h for details on this API.
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    63
  //
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    64
  // Specify NULL for numbers you are not interested in.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    65
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    66
  // Returns false if an error happened. Activate OsMisc trace for
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    67
  // trace output.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    68
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    69
  static bool get_load_avg(double* p_avg1, double* p_avg5, double* p_avg15);
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    70
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    71
  // This is a replacement for the "realpath()" API which does not really work
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    72
  // in PASE together with the (case insensitive but case preserving)
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    73
  // filesystem on OS/400.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    74
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    75
  // See libo4.h for details on this API.
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    76
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    77
  // Returns false if an error happened. Activate OsMisc trace for
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    78
  // trace output.
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    79
  //
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    80
  static bool realpath(const char* file_name, char* resolved_name,
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    81
                       int resolved_name_len);
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    82
39298
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    83
  // Call libo4_RemoveEscapeMessageFromJoblogByContext API to remove messages
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    84
  // from the OS/400 job log.
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    85
  //
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    86
  // See libo4.h for details on this API.
0517ab37a67c 8160565: AIX port: cleanup of libo4 wrapper stub
clanger
parents: 35594
diff changeset
    87
  static bool removeEscapeMessageFromJoblogByContext(const void* context);
34647
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    88
};
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    89
fafb32d71489 8143125: [aix] Further Developments for AIX
stuefe
parents:
diff changeset
    90
#endif // OS_AIX_VM_LIBO4_HPP