Package org.apache.tomcat.jni

# Class OS

java.lang.Object
org.apache.tomcat.jni.OS

@Deprecated public class OS extends Object
Deprecated.
The scope of the APR/Native Library will be reduced in Tomcat 10.1.x / Tomcat Native 2.x onwards to only include those components required to provide OpenSSL integration with the NIO and NIO2 connectors.
OS

Author:
  Mladen Turk

## Field Summary

Fields
Modifier and Type
Field
Description
`static final boolean`
`IS_BSD`
Deprecated.
`static final boolean`
`IS_LINUX`
Deprecated.
`static final boolean`
`IS_MACOSX`
Deprecated.
`static final boolean`
`IS_NETWARE`
Deprecated.
Hard-coded to false since there has not been a supported Netware platform for many years.
`static final boolean`
`IS_SOLARIS`
Deprecated.
`static final boolean`
`IS_UNIX`
Deprecated.
`static final boolean`
`IS_WIN32`
Deprecated.
`static final boolean`
`IS_WIN64`
Deprecated.
`static final int`
`LOG_DEBUG`
Deprecated.
`static final int`
`LOG_EMERG`
Deprecated.
`static final int`
`LOG_ERROR`
Deprecated.
`static final int`
`LOG_INFO`
Deprecated.
`static final int`
`LOG_NOTICE`
Deprecated.
`static final int`
`LOG_WARN`
Deprecated.

## Constructor Summary

Constructors
Constructor
Description
`OS()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`static String`
`defaultEncoding(long pool)`
Deprecated.
Get the name of the system default character set.
`static String`
`expand(String str)`
Deprecated.
Expand environment variables.
`static int`
`info(long[] inf)`
Deprecated.
Gather system info.
`static String`
`localeEncoding(long pool)`
Deprecated.
Get the name of the current locale character set.
`static int`
`random(byte[] buf, int len)`
Deprecated.
Generate random bytes.
`static void`
`syslog(int level, String message)`
Deprecated.
Log message.
`static void`
`sysloginit(String domain)`
Deprecated.
Initialize system logging.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG_EMERG

public static final int LOG_EMERG
Deprecated.

See Also:
  - Constant Field Values

### LOG_ERROR

public static final int LOG_ERROR
Deprecated.

See Also:
  - Constant Field Values

### LOG_NOTICE

public static final int LOG_NOTICE
Deprecated.

See Also:
  - Constant Field Values

### LOG_WARN

public static final int LOG_WARN
Deprecated.

See Also:
  - Constant Field Values

### LOG_INFO

public static final int LOG_INFO
Deprecated.

See Also:
  - Constant Field Values

### LOG_DEBUG

public static final int LOG_DEBUG
Deprecated.

See Also:
  - Constant Field Values

### IS_UNIX

public static final boolean IS_UNIX
Deprecated.

### IS_NETWARE

@Deprecated public static final boolean IS_NETWARE
Deprecated.
Hard-coded to false since there has not been a supported Netware platform for many years. This will be removed in Tomcat 10 onwards

See Also:
  - Constant Field Values

### IS_WIN32

public static final boolean IS_WIN32
Deprecated.

### IS_WIN64

public static final boolean IS_WIN64
Deprecated.

### IS_LINUX

public static final boolean IS_LINUX
Deprecated.

### IS_SOLARIS

public static final boolean IS_SOLARIS
Deprecated.

### IS_BSD

public static final boolean IS_BSD
Deprecated.

### IS_MACOSX

public static final boolean IS_MACOSX
Deprecated.

## Constructor Details

### OS

public OS()
Deprecated.

## Method Details

### defaultEncoding

public static String defaultEncoding(long pool)
Deprecated.
Get the name of the system default character set.

Parameters:
  `pool` - the pool to allocate the name from, if needed
Returns:
  the encoding

### localeEncoding

public static String localeEncoding(long pool)
Deprecated.
Get the name of the current locale character set. Defers to apr_os_default_encoding if the current locale's data can't be retrieved on this system.

Parameters:
  `pool` - the pool to allocate the name from, if needed
Returns:
  the encoding

### random

public static int random(byte[] buf, int len)
Deprecated.
Generate random bytes.

Parameters:
  `buf` - Buffer to fill with random bytes
  `len` - Length of buffer in bytes
Returns:
  the operation status

### info

public static int info(long[] inf)
Deprecated.
Gather system info.

     On exit the inf array will be filled with:
     inf[0]  - Total usable main memory size
     inf[1]  - Available memory size
     inf[2]  - Total page file/swap space size
     inf[3]  - Page file/swap space still available
     inf[4]  - Amount of shared memory
     inf[5]  - Memory used by buffers
     inf[6]  - Memory Load

     inf[7]  - Idle Time in microseconds
     inf[8]  - Kernel Time in microseconds
     inf[9]  - User Time in microseconds

     inf[10] - Process creation time (apr_time_t)
     inf[11] - Process Kernel Time in microseconds
     inf[12] - Process User Time in microseconds

     inf[13] - Current working set size.
     inf[14] - Peak working set size.
     inf[15] - Number of page faults.

Parameters:
  `inf` - array that will be filled with system information. Array length must be at least 16.
Returns:
  the operation status

### expand

public static String expand(String str)
Deprecated.
Expand environment variables.

Parameters:
  `str` - String to expand
Returns:
  Expanded string with replaced environment variables.

### sysloginit

public static void sysloginit(String domain)
Deprecated.
Initialize system logging.

Parameters:
  `domain` - String that will be prepended to every message

### syslog

public static void syslog(int level, String message)
Deprecated.
Log message.

Parameters:
  `level` - Log message severity. See LOG_XXX enums.
  `message` - Message to log