Interface LibCAPI

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

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
  • Field Details

  • Method Details

    • 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(String name, int len)
    • getdomainname

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

      int setdomainname(String name, int len)
    • getenv

      String getenv(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:
    • setenv

      int setenv(String name, 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:
    • unsetenv

      int unsetenv(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:
    • 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: