Package jnr.posix
Class JavaLibCHelper
- java.lang.Object
-
- jnr.posix.JavaLibCHelper
-
public class JavaLibCHelper extends java.lang.ObjectThis 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(java.lang.String path)intchmod(java.lang.String filename, int mode)intchown(java.lang.String filename, int user, int group)static byte[]crypt(byte[] original, byte[] salt)static java.lang.CharSequencecrypt(java.lang.CharSequence original, java.lang.CharSequence salt)intendpwent()static java.io.FileDescriptorgetDescriptorFromChannel(java.nio.channels.Channel channel)java.util.Map<java.lang.String,java.lang.String>getEnv()intgetfd(java.io.FileDescriptor descriptor)static intgetfdFromDescriptor(java.io.FileDescriptor descriptor)static HANDLEgethandle(long descriptor)static HANDLEgethandle(java.io.FileDescriptor descriptor)java.lang.Stringgethostname()java.lang.Stringgetlogin()intgetpid()Passwdgetpwent()Passwdgetpwuid(int which)intisatty(int fd)intlink(java.lang.String oldpath, java.lang.String newpath)intlstat(java.lang.String path, FileStat stat)intmkdir(java.lang.String path, int mode)intreadlink(java.lang.String oldpath, java.nio.ByteBuffer buffer, int length)intrmdir(java.lang.String path)intsetpwent()intstat(java.lang.String path, FileStat stat)intsymlink(java.lang.String oldpath, java.lang.String newpath)static java.io.FileDescriptortoFileDescriptor(int fileDescriptor)static java.io.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 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)
-
-