Top Methods
jnr.posix

public Interface POSIX

Known Direct Subinterfaces
jnr.posix.Linux
Known Direct Implementers
jnr.posix.JavaPOSIX, jnr.posix.LazyPOSIX, jnr.posix.BaseNativePOSIX, jnr.posix.CheckedPOSIX, jnr.posix.NativePOSIX
Imports
jnr.constants.platform.Fcntl, .Signal, .Sysconf, .Confstr, .Pathconf, jnr.ffi.Pointer, jnr.posix.util.ProcessMaker, java.io.FileDescriptor, .IOException, java.nio.ByteBuffer, java.util.Collection, jnr.ffi.annotations.Out

Method Summary

Modifier and TypeMethod and Description
public int
access(CharSequence path, int amode)

public MsgHdr
public FileStat
public Timeval
public int
chdir(String path)

public int
chmod(String filename, int mode)

public int
chown(String filename, int user, int group)

public int
close(int fd)

public int
confstr(Confstr name, ByteBuffer buf, int len)

public CharSequence
public byte[]

Returns:

null-terminated crypted bytes, or null if there was an error
crypt
(byte[]
null-terminated key bytes
key
,
byte[]
null-terminated salt bytes
salt
)

Call the crypt function with the given key and salt as raw null-terminated byte (C char) strings.

public int
daemon(int nochdir, int noclose)

public int
dup(int fd)

public int
dup2(int oldFd, int newFd)

public int
public int
public Pointer
public int
public void
errno(int value)

public int

Returns:

does not return if successful; -1 if failed
exec
(String
the path to execute
path
,
String...
the arguments to pass, with arg0 equal to the desired process name
argv
)

Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.

public int

Returns:

does not return if successful; -1 if failed
exec
(String
the path to execute
path
,
String[]
the arguments to pass, with arg0 equal to the desired process name
argv
,
String[]
a set of KEY=VALUE environment strings to set for the new execution
envp
)

Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.

public int
execv(String path, String[] argv)

public int
execve(String path, String[] argv, String[] envp)

public int
fchmod(int fd, int mode)

public int
fchown(int fd, int user, int group)

public int
fcntl(int fd, Fcntl fcntlConst, int arg)

public int
fcntl(int fd, Fcntl fcntlConst)

public int

Returns:

0 if success, -1 if error
fcntl
(int
the file descriptor on which to act
fd
,
Fcntl
the Fcntl enum value for the flag to set
fcntlConst
,
int...
arguments for the flag or null if none
arg
)

Deprecated This version does not pass args because jnr-ffi does not support variadic invocation.
fcntl(2)
public int
fcntlInt(int fd, Fcntl fcntlConst, int arg)

public int
fdatasync(int fd)

public int
flock(int fd, int operation)

public int
fork()

public int
fpathconf(int fd, Pathconf name)

public FileStat
fstat(FileDescriptor descriptor)

public FileStat
fstat(int descriptor)

public int
fstat(FileDescriptor descriptor, FileStat stat)

public int
fstat(int fd, FileStat stat)

public int
fsync(int fd)

public int
ftruncate(int fd, long offset)

public int
futimens(int fd, long[] atimespec, long[] mtimespec)

public int
futimens(int fd, Pointer times)

public int
futimes(int fd, long[] atimeval, long[] mtimeval)

public String
public int
public int
public String
getenv(String envName)

public int
public int
public Group
public Group
getgrgid(int which)

public Group
public long[]
public int
getgroups(int size, int[] groups)

public String
public String
public int
public int
getpgid(int pid)

public int
public int
public int
public int
getpriority(int which, int who)

public Passwd
public Passwd
public Passwd
getpwuid(int which)

public int
getrlimit(int resource, RLimit rlim)

public int
getrlimit(int resource, Pointer rlim)

public RLimit
getrlimit(int resource)

public int
public int
public boolean
isatty(FileDescriptor descriptor)

public int
isatty(int descriptor)

public boolean
public int
kill(int pid, int signal)

public int
kill(long pid, int signal)

public int
lchmod(String filename, int mode)

public int
lchown(String filename, int user, int group)

public LibC

Returns:

the LibC implementation for this POSIX
libc
()

Returns null if isNative returns false.

public int
lseek(int fd, long offset, int whence)

public long
lseekLong(int fd, long offset, int whence)

public FileStat
lstat(String path)

public int
lstat(String path, FileStat stat)

public int
lutimes(String path, long[] atimeval, long[] mtimeval)

public int
mkdir(String path, int mode)

public int
mkfifo(String filename, int mode)

public ProcessMaker
newProcessMaker(String... command)

public ProcessMaker
public String
nl_langinfo(int item)

public int
open(CharSequence path, int flags, int perm)

public int
pipe(int[] fds)

public long
posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)

public long
posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)

public long
pread(int fd, byte[] buf, long n, long offset)

public long
pread(int fd, ByteBuffer buf, long n, long offset)

public int
pread(int fd, byte[] buf, int n, int offset)

public int
pread(int fd, ByteBuffer buf, int n, int offset)

public long
pwrite(int fd, byte[] buf, long n, long offset)

public long
pwrite(int fd, ByteBuffer buf, long n, long offset)

public int
pwrite(int fd, byte[] buf, int n, int offset)

public int
pwrite(int fd, ByteBuffer buf, int n, int offset)

public int
raise(int sig)

public long
read(int fd, byte[] buf, long n)

public long
read(int fd, ByteBuffer buf, long n)

public int
read(int fd, byte[] buf, int n)

public int
read(int fd, ByteBuffer buf, int n)

public int
recvmsg(int socket, MsgHdr message, int flags)

public int
rename(CharSequence oldName, CharSequence newName)

public int
rmdir(String path)

public int
sendmsg(int socket, MsgHdr message, int flags)

public int
setegid(int egid)

public int
setenv(String envName, String envValue, int overwrite)

public int
seteuid(int euid)

public int
setgid(int gid)

public int
public String
setlocale(int category, String locale)

public int
setpgid(int pid, int pgid)

public int
setpgrp(int pid, int pgrp)

public int
setpriority(int which, int who, int prio)

public int
public int
setrlimit(int resource, RLimit rlim)

public int
setrlimit(int resource, Pointer rlim)

public int
setrlimit(int resource, long rlimCur, long rlimMax)

public int
public int
setuid(int uid)

public SignalHandler
signal(Signal sig, SignalHandler handler)

public int
socketpair(int domain, int type, int protocol, int[] fds)

public FileStat
stat(String path)

public int
stat(String path, FileStat stat)

public String
strerror(int code)

public long
public Times
public int
truncate(CharSequence path, long length)

public int
umask(int mask)

public int
unsetenv(String envName)

public int
utimensat(int dirfd, String path, long[] atimespec, long[] mtimespec, int flag)

public int
utimensat(int dirfd, String path, Pointer times, int flag)

public int
utimes(String path, long[] atimeval, long[] mtimeval)

public int
utimes(String path, Pointer times)

public int
wait(int[] status)

public int
waitpid(int pid, int[] status, int flags)

public int
waitpid(long pid, int[] status, int flags)

public long
write(int fd, byte[] buf, long n)

public long
write(int fd, ByteBuffer buf, long n)

public int
write(int fd, byte[] buf, int n)

public int
write(int fd, ByteBuffer buf, int n)