- java.lang.Object
-
- jnr.posix.JavaLibCHelper
-
public class JavaLibCHelper extends 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.
-
-
Constructor Summary
Constructors Constructor Description JavaLibCHelper(POSIXHandler handler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intchdir(String path)intchmod(String filename, int mode)intchown(String filename, int user, int group)static byte[]crypt(byte[] original, byte[] salt)static CharSequencecrypt(CharSequence original, CharSequence salt)intendpwent()static FileDescriptorgetDescriptorFromChannel(Channel channel)Map<String,String>getEnv()intgetfd(FileDescriptor descriptor)static intgetfdFromDescriptor(FileDescriptor descriptor)static HANDLEgethandle(long descriptor)static HANDLEgethandle(FileDescriptor descriptor)Stringgethostname()Stringgetlogin()intgetpid()Passwdgetpwent()Passwdgetpwuid(int which)intisatty(int fd)intlink(String oldpath, String newpath)intlstat(String path, FileStat stat)intmkdir(String path, int mode)intreadlink(String oldpath, ByteBuffer buffer, int length)intrmdir(String path)intsetpwent()intstat(String path, FileStat stat)intsymlink(String oldpath, String newpath)static FileDescriptortoFileDescriptor(int fileDescriptor)static FileDescriptortoFileDescriptor(HANDLE fileDescriptor)
-
-
-
Field Detail
-
STDIN
public static final int STDIN
- See Also:
- Constant Field Values
-
STDOUT
public static final int STDOUT
- See Also:
- Constant Field Values
-
STDERR
public static final int STDERR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JavaLibCHelper
public JavaLibCHelper(POSIXHandler handler)
-
-
Method Detail
-
getDescriptorFromChannel
public static FileDescriptor getDescriptorFromChannel(Channel channel)
-
chmod
public int chmod(String filename, int mode)
-
chown
public int chown(String filename, int user, int group)
-
crypt
public static CharSequence crypt(CharSequence original, CharSequence salt)
-
crypt
public static byte[] crypt(byte[] original, byte[] salt)
-
getfd
public int getfd(FileDescriptor descriptor)
-
getfdFromDescriptor
public static int getfdFromDescriptor(FileDescriptor descriptor)
-
gethandle
public static HANDLE gethandle(FileDescriptor descriptor)
-
gethandle
public static HANDLE gethandle(long descriptor)
-
getlogin
public String getlogin()
-
gethostname
public 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)
-
mkdir
public int mkdir(String path, int mode)
-
rmdir
public int rmdir(String path)
-
chdir
public static int chdir(String path)
-
readlink
public int readlink(String oldpath, ByteBuffer buffer, int length) throws IOException
- Throws:
IOException
-
toFileDescriptor
public static FileDescriptor toFileDescriptor(int fileDescriptor)
-
toFileDescriptor
public static FileDescriptor toFileDescriptor(HANDLE fileDescriptor)
-
-