-
- All Known Subinterfaces:
Linux
- All Known Implementing Classes:
BaseNativePOSIX,NativePOSIX,WindowsPOSIX
public interface POSIX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description intaccess(CharSequence path, int amode)MsgHdrallocateMsgHdr()FileStatallocateStat()TimevalallocateTimeval()intchdir(String path)intchmod(String filename, int mode)intchown(String filename, int user, int group)intclose(int fd)intconfstr(jnr.constants.platform.Confstr name, ByteBuffer buf, int len)byte[]crypt(byte[] key, byte[] salt)Call the crypt function with the given key and salt as raw null-terminated byte (C char) strings.CharSequencecrypt(CharSequence key, CharSequence salt)intdaemon(int nochdir, int noclose)intdup(int fd)intdup2(int oldFd, int newFd)intendgrent()intendpwent()jnr.ffi.Pointerenviron()interrno()voiderrno(int value)intexec(String path, String... argv)Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.intexec(String path, String[] argv, String[] envp)Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.intexecv(String path, String[] argv)intexecve(String path, String[] argv, String[] envp)intfchmod(int fd, int mode)intfchown(int fd, int user, int group)intfcntl(int fd, jnr.constants.platform.Fcntl fcntlConst)intfcntl(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg)intfcntl(int fd, jnr.constants.platform.Fcntl fcntlConst, int... arg)Deprecated.This version does not pass args because jnr-ffi does not support variadic invocation.intfcntlInt(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg)intfdatasync(int fd)intflock(int fd, int operation)intfork()intfpathconf(int fd, jnr.constants.platform.Pathconf name)FileStatfstat(int descriptor)intfstat(int fd, FileStat stat)FileStatfstat(FileDescriptor descriptor)intfstat(FileDescriptor descriptor, FileStat stat)intfsync(int fd)intftruncate(int fd, long offset)intfutimens(int fd, long[] atimespec, long[] mtimespec)intfutimens(int fd, jnr.ffi.Pointer times)intfutimes(int fd, long[] atimeval, long[] mtimeval)Stringgetcwd()intgetdtablesize()intgetegid()Stringgetenv(String envName)intgeteuid()intgetgid()Groupgetgrent()Groupgetgrgid(int which)Groupgetgrnam(String which)long[]getgroups()intgetgroups(int size, int[] groups)Stringgethostname()Stringgetlogin()intgetpgid()intgetpgid(int pid)intgetpgrp()intgetpid()intgetppid()intgetpriority(int which, int who)Passwdgetpwent()Passwdgetpwnam(String which)Passwdgetpwuid(int which)RLimitgetrlimit(int resource)intgetrlimit(int resource, jnr.ffi.Pointer rlim)intgetrlimit(int resource, RLimit rlim)intgettimeofday(Timeval tv)intgetuid()intisatty(int descriptor)booleanisatty(FileDescriptor descriptor)booleanisNative()intkill(int pid, int signal)intkill(long pid, int signal)intlchmod(String filename, int mode)intlchown(String filename, int user, int group)LibClibc()Returns null if isNative returns false.intlink(String oldpath, String newpath)intlseek(int fd, long offset, int whence)longlseekLong(int fd, long offset, int whence)FileStatlstat(String path)intlstat(String path, FileStat stat)intlutimes(String path, long[] atimeval, long[] mtimeval)intmkdir(String path, int mode)intmkfifo(String filename, int mode)ProcessMakernewProcessMaker()ProcessMakernewProcessMaker(String... command)Stringnl_langinfo(int item)intopen(CharSequence path, int flags, int perm)intpipe(int[] fds)longposix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)longposix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)intpread(int fd, byte[] buf, int n, int offset)longpread(int fd, byte[] buf, long n, long offset)intpread(int fd, ByteBuffer buf, int n, int offset)longpread(int fd, ByteBuffer buf, long n, long offset)intpwrite(int fd, byte[] buf, int n, int offset)longpwrite(int fd, byte[] buf, long n, long offset)intpwrite(int fd, ByteBuffer buf, int n, int offset)longpwrite(int fd, ByteBuffer buf, long n, long offset)intraise(int sig)intread(int fd, byte[] buf, int n)longread(int fd, byte[] buf, long n)intread(int fd, ByteBuffer buf, int n)longread(int fd, ByteBuffer buf, long n)intreadlink(CharSequence path, byte[] buf, int bufsize)intreadlink(CharSequence path, ByteBuffer buf, int bufsize)intreadlink(CharSequence path, jnr.ffi.Pointer bufPtr, int bufsize)Stringreadlink(String path)intrecvmsg(int socket, MsgHdr message, int flags)intrename(CharSequence oldName, CharSequence newName)intrmdir(String path)intsendmsg(int socket, MsgHdr message, int flags)intsetegid(int egid)intsetenv(String envName, String envValue, int overwrite)intseteuid(int euid)intsetgid(int gid)intsetgrent()Stringsetlocale(int category, String locale)intsetpgid(int pid, int pgid)intsetpgrp(int pid, int pgrp)intsetpriority(int which, int who, int prio)intsetpwent()intsetrlimit(int resource, long rlimCur, long rlimMax)intsetrlimit(int resource, jnr.ffi.Pointer rlim)intsetrlimit(int resource, RLimit rlim)intsetsid()intsetuid(int uid)SignalHandlersignal(jnr.constants.platform.Signal sig, SignalHandler handler)intsocketpair(int domain, int type, int protocol, int[] fds)FileStatstat(String path)intstat(String path, FileStat stat)Stringstrerror(int code)intsymlink(String oldpath, String newpath)longsysconf(jnr.constants.platform.Sysconf name)Timestimes()inttruncate(CharSequence path, long length)intumask(int mask)intunlink(CharSequence path)intunsetenv(String envName)intutimensat(int dirfd, String path, long[] atimespec, long[] mtimespec, int flag)intutimensat(int dirfd, String path, jnr.ffi.Pointer times, int flag)intutimes(String path, long[] atimeval, long[] mtimeval)intutimes(String path, jnr.ffi.Pointer times)intwait(int[] status)intwaitpid(int pid, int[] status, int flags)intwaitpid(long pid, int[] status, int flags)intwrite(int fd, byte[] buf, int n)longwrite(int fd, byte[] buf, long n)intwrite(int fd, ByteBuffer buf, int n)longwrite(int fd, ByteBuffer buf, long n)
-
-
-
Method Detail
-
crypt
CharSequence crypt(CharSequence key, CharSequence salt)
-
crypt
byte[] crypt(byte[] key, byte[] salt)Call the crypt function with the given key and salt as raw null-terminated byte (C char) strings.- Parameters:
key- null-terminated key bytessalt- null-terminated salt bytes- Returns:
- null-terminated crypted bytes, or null if there was an error
-
allocateStat
FileStat allocateStat()
-
chmod
int chmod(String filename, int mode)
-
fchmod
int fchmod(int fd, int mode)
-
chown
int chown(String filename, int user, int group)
-
fchown
int fchown(int fd, int user, int group)
-
exec
int exec(String path, String... argv)
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.- Parameters:
path- the path to executeargv- the arguments to pass, with arg0 equal to the desired process name- Returns:
- does not return if successful; -1 if failed
-
exec
int exec(String path, String[] argv, String[] envp)
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.- Parameters:
path- the path to executeargv- the arguments to pass, with arg0 equal to the desired process nameenvp- a set of KEY=VALUE environment strings to set for the new execution- Returns:
- does not return if successful; -1 if failed
-
fork
int fork()
-
fstat
FileStat fstat(FileDescriptor descriptor)
-
fstat
FileStat fstat(int descriptor)
-
fstat
int fstat(FileDescriptor descriptor, FileStat stat)
-
fstat
int fstat(int fd, FileStat stat)
-
environ
jnr.ffi.Pointer environ()
-
getegid
int getegid()
-
geteuid
int geteuid()
-
seteuid
int seteuid(int euid)
-
getgid
int getgid()
-
getdtablesize
int getdtablesize()
-
getlogin
String getlogin()
-
getpgid
int getpgid()
-
getpgid
int getpgid(int pid)
-
getpgrp
int getpgrp()
-
getpid
int getpid()
-
getppid
int getppid()
-
getpriority
int getpriority(int which, int who)
-
getpwent
Passwd getpwent()
-
getpwuid
Passwd getpwuid(int which)
-
getgrgid
Group getgrgid(int which)
-
getgrent
Group getgrent()
-
endgrent
int endgrent()
-
setgrent
int setgrent()
-
endpwent
int endpwent()
-
setpwent
int setpwent()
-
getuid
int getuid()
-
getrlimit
int getrlimit(int resource, RLimit rlim)
-
getrlimit
int getrlimit(int resource, jnr.ffi.Pointer rlim)
-
getrlimit
RLimit getrlimit(int resource)
-
setrlimit
int setrlimit(int resource, RLimit rlim)
-
setrlimit
int setrlimit(int resource, jnr.ffi.Pointer rlim)
-
setrlimit
int setrlimit(int resource, long rlimCur, long rlimMax)
-
isatty
boolean isatty(FileDescriptor descriptor)
-
isatty
int isatty(int descriptor)
-
kill
int kill(int pid, int signal)
-
kill
int kill(long pid, int signal)
-
signal
SignalHandler signal(jnr.constants.platform.Signal sig, SignalHandler handler)
-
raise
int raise(int sig)
-
lchmod
int lchmod(String filename, int mode)
-
lchown
int lchown(String filename, int user, int group)
-
mkdir
int mkdir(String path, int mode)
-
readlink
String readlink(String path) throws IOException
- Throws:
IOException
-
readlink
int readlink(CharSequence path, byte[] buf, int bufsize)
-
readlink
int readlink(CharSequence path, ByteBuffer buf, int bufsize)
-
readlink
int readlink(CharSequence path, jnr.ffi.Pointer bufPtr, int bufsize)
-
rmdir
int rmdir(String path)
-
setsid
int setsid()
-
setgid
int setgid(int gid)
-
setegid
int setegid(int egid)
-
setpgid
int setpgid(int pid, int pgid)
-
setpgrp
int setpgrp(int pid, int pgrp)
-
setpriority
int setpriority(int which, int who, int prio)
-
setuid
int setuid(int uid)
-
umask
int umask(int mask)
-
unsetenv
int unsetenv(String envName)
-
utimes
int utimes(String path, long[] atimeval, long[] mtimeval)
-
utimes
int utimes(String path, jnr.ffi.Pointer times)
-
futimes
int futimes(int fd, long[] atimeval, long[] mtimeval)
-
lutimes
int lutimes(String path, long[] atimeval, long[] mtimeval)
-
utimensat
int utimensat(int dirfd, String path, long[] atimespec, long[] mtimespec, int flag)
-
utimensat
int utimensat(int dirfd, String path, jnr.ffi.Pointer times, int flag)
-
futimens
int futimens(int fd, long[] atimespec, long[] mtimespec)
-
futimens
int futimens(int fd, jnr.ffi.Pointer times)
-
waitpid
int waitpid(int pid, int[] status, int flags)
-
waitpid
int waitpid(long pid, int[] status, int flags)
-
wait
int wait(int[] status)
-
errno
int errno()
-
errno
void errno(int value)
-
strerror
String strerror(int code)
-
chdir
int chdir(String path)
-
isNative
boolean isNative()
-
libc
LibC libc()
Returns null if isNative returns false.- Returns:
- the LibC implementation for this POSIX
-
newProcessMaker
ProcessMaker newProcessMaker(String... command)
-
newProcessMaker
ProcessMaker newProcessMaker()
-
sysconf
long sysconf(jnr.constants.platform.Sysconf name)
-
confstr
int confstr(jnr.constants.platform.Confstr name, ByteBuffer buf, int len)
-
fpathconf
int fpathconf(int fd, jnr.constants.platform.Pathconf name)
-
times
Times times()
-
posix_spawnp
long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)
-
posix_spawnp
long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp)
-
flock
int flock(int fd, int operation)
-
dup
int dup(int fd)
-
dup2
int dup2(int oldFd, int newFd)
-
fcntlInt
int fcntlInt(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg)
-
fcntl
int fcntl(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg)
-
fcntl
int fcntl(int fd, jnr.constants.platform.Fcntl fcntlConst)
-
access
int access(CharSequence path, int amode)
-
close
int close(int fd)
-
unlink
int unlink(CharSequence path)
-
open
int open(CharSequence path, int flags, int perm)
-
read
long read(int fd, byte[] buf, long n)
-
write
long write(int fd, byte[] buf, long n)
-
read
long read(int fd, ByteBuffer buf, long n)
-
write
long write(int fd, ByteBuffer buf, long n)
-
pread
long pread(int fd, byte[] buf, long n, long offset)
-
pwrite
long pwrite(int fd, byte[] buf, long n, long offset)
-
pread
long pread(int fd, ByteBuffer buf, long n, long offset)
-
pwrite
long pwrite(int fd, ByteBuffer buf, long n, long offset)
-
read
int read(int fd, byte[] buf, int n)
-
write
int write(int fd, byte[] buf, int n)
-
read
int read(int fd, ByteBuffer buf, int n)
-
write
int write(int fd, ByteBuffer buf, int n)
-
pread
int pread(int fd, byte[] buf, int n, int offset)
-
pwrite
int pwrite(int fd, byte[] buf, int n, int offset)
-
pread
int pread(int fd, ByteBuffer buf, int n, int offset)
-
pwrite
int pwrite(int fd, ByteBuffer buf, int n, int offset)
-
lseek
int lseek(int fd, long offset, int whence)
-
lseekLong
long lseekLong(int fd, long offset, int whence)
-
pipe
int pipe(int[] fds)
-
truncate
int truncate(CharSequence path, long length)
-
ftruncate
int ftruncate(int fd, long offset)
-
rename
int rename(CharSequence oldName, CharSequence newName)
-
getcwd
String getcwd()
-
gethostname
String gethostname()
-
socketpair
int socketpair(int domain, int type, int protocol, int[] fds)
-
sendmsg
int sendmsg(int socket, MsgHdr message, int flags)
-
recvmsg
int recvmsg(int socket, MsgHdr message, int flags)
-
allocateMsgHdr
MsgHdr allocateMsgHdr()
-
fcntl
@Deprecated int fcntl(int fd, jnr.constants.platform.Fcntl fcntlConst, int... arg)
Deprecated.This version does not pass args because jnr-ffi does not support variadic invocation.fcntl(2)- Parameters:
fd- the file descriptor on which to actfcntlConst- theFcntlenum value for the flag to setarg- arguments for the flag or null if none- Returns:
- 0 if success, -1 if error
- See Also:
fcntlInt(int, jnr.constants.platform.Fcntl, int)
-
fsync
int fsync(int fd)
-
fdatasync
int fdatasync(int fd)
-
mkfifo
int mkfifo(String filename, int mode)
-
daemon
int daemon(int nochdir, int noclose)
-
getgroups
long[] getgroups()
-
getgroups
int getgroups(int size, int[] groups)
-
nl_langinfo
String nl_langinfo(int item)
-
allocateTimeval
Timeval allocateTimeval()
-
gettimeofday
int gettimeofday(Timeval tv)
-
-