Package jnr.posix

Class JavaLibCHelper


  • public class JavaLibCHelper
    extends java.lang.Object
    This libc implementation is created one per runtime instance versus the others which are expected to be one static instance for whole JVM. Because of this it is no big deal to make reference to a POSIXHandler directly.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int STDERR  
      static int STDIN  
      static int STDOUT  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static int chdir​(java.lang.String path)  
      int chmod​(java.lang.String filename, int mode)  
      int chown​(java.lang.String filename, int user, int group)  
      static byte[] crypt​(byte[] original, byte[] salt)  
      static java.lang.CharSequence crypt​(java.lang.CharSequence original, java.lang.CharSequence salt)  
      int endpwent()  
      static java.io.FileDescriptor getDescriptorFromChannel​(java.nio.channels.Channel channel)  
      java.util.Map<java.lang.String,​java.lang.String> getEnv()  
      int getfd​(java.io.FileDescriptor descriptor)  
      static int getfdFromDescriptor​(java.io.FileDescriptor descriptor)  
      static HANDLE gethandle​(long descriptor)  
      static HANDLE gethandle​(java.io.FileDescriptor descriptor)  
      java.lang.String gethostname()  
      java.lang.String getlogin()  
      int getpid()  
      Passwd getpwent()  
      Passwd getpwuid​(int which)  
      int isatty​(int fd)  
      int link​(java.lang.String oldpath, java.lang.String newpath)  
      int lstat​(java.lang.String path, FileStat stat)  
      int mkdir​(java.lang.String path, int mode)  
      int readlink​(java.lang.String oldpath, java.nio.ByteBuffer buffer, int length)  
      int rmdir​(java.lang.String path)  
      int setpwent()  
      int stat​(java.lang.String path, FileStat stat)  
      int symlink​(java.lang.String oldpath, java.lang.String newpath)  
      static java.io.FileDescriptor toFileDescriptor​(int fileDescriptor)  
      static java.io.FileDescriptor toFileDescriptor​(HANDLE fileDescriptor)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaLibCHelper

        public JavaLibCHelper​(POSIXHandler handler)
    • Method Detail

      • getDescriptorFromChannel

        public static java.io.FileDescriptor getDescriptorFromChannel​(java.nio.channels.Channel channel)
      • chmod

        public int chmod​(java.lang.String filename,
                         int mode)
      • chown

        public int chown​(java.lang.String filename,
                         int user,
                         int group)
      • crypt

        public static java.lang.CharSequence crypt​(java.lang.CharSequence original,
                                                   java.lang.CharSequence salt)
      • crypt

        public static byte[] crypt​(byte[] original,
                                   byte[] salt)
      • getfd

        public int getfd​(java.io.FileDescriptor descriptor)
      • getfdFromDescriptor

        public static int getfdFromDescriptor​(java.io.FileDescriptor descriptor)
      • gethandle

        public static HANDLE gethandle​(java.io.FileDescriptor descriptor)
      • gethandle

        public static HANDLE gethandle​(long descriptor)
      • getlogin

        public java.lang.String getlogin()
      • gethostname

        public java.lang.String gethostname()
      • getpid

        public int getpid()
      • getpwent

        public Passwd getpwent()
      • setpwent

        public int setpwent()
      • endpwent

        public int endpwent()
      • getpwuid

        public Passwd getpwuid​(int which)
      • isatty

        public int isatty​(int fd)
      • link

        public int link​(java.lang.String oldpath,
                        java.lang.String newpath)
      • lstat

        public int lstat​(java.lang.String path,
                         FileStat stat)
      • mkdir

        public int mkdir​(java.lang.String path,
                         int mode)
      • rmdir

        public int rmdir​(java.lang.String path)
      • chdir

        public static int chdir​(java.lang.String path)
      • stat

        public int stat​(java.lang.String path,
                        FileStat stat)
      • symlink

        public int symlink​(java.lang.String oldpath,
                           java.lang.String newpath)
      • readlink

        public int readlink​(java.lang.String oldpath,
                            java.nio.ByteBuffer buffer,
                            int length)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getEnv

        public java.util.Map<java.lang.String,​java.lang.String> getEnv()
      • toFileDescriptor

        public static java.io.FileDescriptor toFileDescriptor​(int fileDescriptor)
      • toFileDescriptor

        public static java.io.FileDescriptor toFileDescriptor​(HANDLE fileDescriptor)