Skip navigation links
JNA API 5.3.1
com.sun.jna.platform.unix

Interface LibCAPI

  • All Superinterfaces:
    Reboot, Resource
    All Known Subinterfaces:
    LibC, LibC


    public interface LibCAPI
    extends Reboot, Resource
    Note: we are using this "intermediate" API in order to allow Linux-like O/S-es to implement the same API, but maybe using a different library name
    Author:
    Lyor Goldstein
    • Method Detail

      • getuid

        int getuid()
      • geteuid

        int geteuid()
      • getgid

        int getgid()
      • getegid

        int getegid()
      • setuid

        int setuid(int uid)
      • seteuid

        int seteuid(int uid)
      • setgid

        int setgid(int gid)
      • setegid

        int setegid(int gid)
      • gethostname

        int gethostname(byte[] name,
                        int len)
      • sethostname

        int sethostname(java.lang.String name,
                        int len)
      • getdomainname

        int getdomainname(byte[] name,
                          int len)
      • setdomainname

        int setdomainname(java.lang.String name,
                          int len)
      • getenv

        java.lang.String getenv(java.lang.String name)
        Parameters:
        name - Environment variable name
        Returns:
        Returns the value in the environment, or null if there is no match for the name
        See Also:
        getenv(3)
      • setenv

        int setenv(java.lang.String name,
                   java.lang.String value,
                   int overwrite)
        Update or add a variable in the environment of the calling process.
        Parameters:
        name - Environment variable name
        value - Required value
        overwrite - If the environment variable already exists and the value of overwrite is non-zero, the function shall return success and the environment shall be updated. If the environment variable already exists and the value of overwrite is zero, the function shall return success and the environment shall remain unchanged.
        Returns:
        Upon successful completion, zero shall be returned. Otherwise, -1 shall be returned, errno set to indicate the error, and the environment shall be unchanged
        See Also:
        getenv(3)
      • unsetenv

        int unsetenv(java.lang.String name)
        Parameters:
        name - Environment variable name - If the named variable does not exist in the current environment, the environment shall be unchanged and the function is considered to have completed successfully.
        Returns:
        Upon successful completion, zero shall be returned. Otherwise, -1 shall be returned, errno set to indicate the error, and the environment shall be unchanged
        See Also:
        getenv(3)
      • getloadavg

        int getloadavg(double[] loadavg,
                       int nelem)
        The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time. Up to nelem samples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively.
        Parameters:
        loadavg - An array of doubles which will be filled with the results
        nelem - Number of samples to return
        Returns:
        If the load average was unobtainable, -1 is returned; otherwise, the number of samples actually retrieved is returned.
        See Also:
        getloadavg(3)
JNA API 5.3.1

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.