jnr.posix
Class JavaLibCHelper

java.lang.Object
  extended by 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.


Field Summary
static int STDERR
           
static int STDIN
           
static int STDOUT
           
 
Constructor Summary
JavaLibCHelper(POSIXHandler handler)
           
 
Method Summary
static int chdir(String path)
           
 int chmod(String filename, int mode)
           
 int chown(String filename, int user, int group)
           
static CharSequence crypt(CharSequence original, CharSequence salt)
           
 int endpwent()
           
static FileDescriptor getDescriptorFromChannel(Channel channel)
           
 Map<String,String> getEnv()
           
 int getfd(FileDescriptor descriptor)
           
static int getfdFromDescriptor(FileDescriptor descriptor)
           
 HANDLE gethandle(FileDescriptor descriptor)
           
 String getlogin()
           
 int getpid()
           
 Passwd getpwent()
           
 Passwd getpwuid(int which)
           
 int isatty(int fd)
           
 int link(String oldpath, String newpath)
           
 int lstat(String path, FileStat stat)
           
 int mkdir(String path, int mode)
           
 int readlink(String oldpath, ByteBuffer buffer, int length)
           
 int rmdir(String path)
           
 int setpwent()
           
 int stat(String path, FileStat stat)
           
 int symlink(String oldpath, String newpath)
           
static FileDescriptor toFileDescriptor(int fileDescriptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)

getfd

public int getfd(FileDescriptor descriptor)

getfdFromDescriptor

public static int getfdFromDescriptor(FileDescriptor descriptor)

gethandle

public HANDLE gethandle(FileDescriptor descriptor)

getlogin

public String getlogin()

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(String oldpath,
                String newpath)

lstat

public int lstat(String path,
                 FileStat stat)

mkdir

public int mkdir(String path,
                 int mode)

rmdir

public int rmdir(String path)

chdir

public static int chdir(String path)

stat

public int stat(String path,
                FileStat stat)

symlink

public int symlink(String oldpath,
                   String newpath)

readlink

public int readlink(String oldpath,
                    ByteBuffer buffer,
                    int length)
             throws IOException
Throws:
IOException

getEnv

public Map<String,String> getEnv()

toFileDescriptor

public static FileDescriptor toFileDescriptor(int fileDescriptor)


Copyright © 2014. All Rights Reserved.