Package jnr.posix
Class JavaLibCHelper
- java.lang.Object
-
- jnr.posix.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.
-
-
Constructor Summary
Constructors Constructor Description JavaLibCHelper(POSIXHandler handler)
-
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)
-
-
-
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)
-
-