Package jnr.posix
Interface POSIX
- All Known Subinterfaces:
Linux
- All Known Implementing Classes:
AixPOSIX
,BaseNativePOSIX
,CheckedPOSIX
,DragonFlyPOSIX
,FreeBSDPOSIX
,JavaPOSIX
,LazyPOSIX
,LinuxPOSIX
,MacOSPOSIX
,NativePOSIX
,OpenBSDPOSIX
,SolarisPOSIX
,WindowsPOSIX
public interface POSIX
-
Method Summary
Modifier and TypeMethodDescriptionint
access
(CharSequence path, int amode) int
int
int
int
close
(int fd) int
confstr
(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.crypt
(CharSequence key, CharSequence salt) int
daemon
(int nochdir, int noclose) int
dup
(int fd) int
dup2
(int oldFd, int newFd) int
endgrent()
int
endpwent()
jnr.ffi.Pointer
environ()
int
errno()
void
errno
(int value) int
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.int
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list.int
int
int
fchmod
(int fd, int mode) int
fchown
(int fd, int user, int group) int
fcntl
(int fd, jnr.constants.platform.Fcntl fcntlConst) int
fcntl
(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg) 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.int
fcntlInt
(int fd, jnr.constants.platform.Fcntl fcntlConst, int arg) int
fdatasync
(int fd) int
flock
(int fd, int operation) int
fork()
int
fpathconf
(int fd, jnr.constants.platform.Pathconf name) fstat
(int descriptor) int
fstat
(FileDescriptor descriptor) int
fstat
(FileDescriptor descriptor, FileStat stat) int
fsync
(int fd) int
ftruncate
(int fd, long offset) int
futimens
(int fd, long[] atimespec, long[] mtimespec) int
futimens
(int fd, jnr.ffi.Pointer times) int
futimes
(int fd, long[] atimeval, long[] mtimeval) getcwd()
int
int
getegid()
int
geteuid()
int
getgid()
getgrent()
getgrgid
(int which) long[]
int
getgroups
(int size, int[] groups) getlogin()
int
getpgid()
int
getpgid
(int pid) int
getpgrp()
int
getpid()
int
getppid()
int
getpriority
(int which, int who) getpwent()
getpwuid
(int which) getrlimit
(int resource) int
getrlimit
(int resource, jnr.ffi.Pointer rlim) int
int
gettimeofday
(Timeval tv) int
getuid()
int
isatty
(int descriptor) boolean
isatty
(FileDescriptor descriptor) boolean
isNative()
int
kill
(int pid, int signal) int
kill
(long pid, int signal) int
int
libc()
Returns null if isNative returns false.int
int
lseek
(int fd, long offset, int whence) long
lseekLong
(int fd, long offset, int whence) int
int
int
int
newProcessMaker
(String... command) nl_langinfo
(int item) int
open
(CharSequence path, int flags, int perm) int
pipe
(int[] fds) long
posix_spawnp
(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) long
posix_spawnp
(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) int
pread
(int fd, byte[] buf, int n, int offset) long
pread
(int fd, byte[] buf, long n, long offset) int
pread
(int fd, ByteBuffer buf, int n, int offset) long
pread
(int fd, ByteBuffer buf, long n, long offset) int
pwrite
(int fd, byte[] buf, int n, int offset) long
pwrite
(int fd, byte[] buf, long n, long offset) int
pwrite
(int fd, ByteBuffer buf, int n, int offset) long
pwrite
(int fd, ByteBuffer buf, long n, long offset) int
raise
(int sig) int
read
(int fd, byte[] buf, int n) long
read
(int fd, byte[] buf, long n) int
read
(int fd, ByteBuffer buf, int n) long
read
(int fd, ByteBuffer buf, long n) int
readlink
(CharSequence path, byte[] buf, int bufsize) int
readlink
(CharSequence path, ByteBuffer buf, int bufsize) int
readlink
(CharSequence path, jnr.ffi.Pointer bufPtr, int bufsize) int
int
rename
(CharSequence oldName, CharSequence newName) int
int
int
setegid
(int egid) int
int
seteuid
(int euid) int
setgid
(int gid) int
setgrent()
int
setpgid
(int pid, int pgid) int
setpgrp
(int pid, int pgrp) int
setpriority
(int which, int who, int prio) int
setpwent()
int
setrlimit
(int resource, long rlimCur, long rlimMax) int
setrlimit
(int resource, jnr.ffi.Pointer rlim) int
int
setsid()
int
setuid
(int uid) signal
(jnr.constants.platform.Signal sig, SignalHandler handler) int
socketpair
(int domain, int type, int protocol, int[] fds) int
strerror
(int code) int
long
sysconf
(jnr.constants.platform.Sysconf name) times()
int
truncate
(CharSequence path, long length) int
umask
(int mask) int
unlink
(CharSequence path) int
int
int
int
int
int
wait
(int[] status) int
waitpid
(int pid, int[] status, int flags) int
waitpid
(long pid, int[] status, int flags) int
write
(int fd, byte[] buf, int n) long
write
(int fd, byte[] buf, long n) int
write
(int fd, ByteBuffer buf, int n) long
write
(int fd, ByteBuffer buf, long n)
-
Method Details
-
crypt
-
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
-
fchmod
int fchmod(int fd, int mode) -
chown
-
fchown
int fchown(int fd, int user, int group) -
exec
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
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
-
execv
-
execve
-
fork
int fork() -
fstat
-
fstat
-
fstat
-
fstat
-
environ
jnr.ffi.Pointer environ() -
getenv
-
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
-
getpwnam
-
getgrgid
-
getgrnam
-
getgrent
Group getgrent() -
endgrent
int endgrent() -
setgrent
int setgrent() -
endpwent
int endpwent() -
setpwent
int setpwent() -
getuid
int getuid() -
getrlimit
-
getrlimit
int getrlimit(int resource, jnr.ffi.Pointer rlim) -
getrlimit
-
setrlimit
-
setrlimit
int setrlimit(int resource, jnr.ffi.Pointer rlim) -
setrlimit
int setrlimit(int resource, long rlimCur, long rlimMax) -
isatty
-
isatty
int isatty(int descriptor) -
kill
int kill(int pid, int signal) -
kill
int kill(long pid, int signal) -
signal
-
raise
int raise(int sig) -
lchmod
-
lchown
-
link
-
lstat
-
lstat
-
mkdir
-
readlink
- Throws:
IOException
-
readlink
-
readlink
-
readlink
-
rmdir
-
setenv
-
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) -
stat
-
stat
-
symlink
-
umask
int umask(int mask) -
unsetenv
-
utimes
-
utimes
-
futimes
int futimes(int fd, long[] atimeval, long[] mtimeval) -
lutimes
-
utimensat
-
utimensat
-
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
-
chdir
-
isNative
boolean isNative() -
libc
LibC libc()Returns null if isNative returns false.- Returns:
- the LibC implementation for this POSIX
-
newProcessMaker
-
newProcessMaker
ProcessMaker newProcessMaker() -
sysconf
long sysconf(jnr.constants.platform.Sysconf name) -
confstr
-
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
-
close
int close(int fd) -
unlink
-
open
-
read
long read(int fd, byte[] buf, long n) -
write
long write(int fd, byte[] buf, long n) -
read
-
write
-
pread
long pread(int fd, byte[] buf, long n, long offset) -
pwrite
long pwrite(int fd, byte[] buf, long n, long offset) -
pread
-
pwrite
-
read
int read(int fd, byte[] buf, int n) -
write
int write(int fd, byte[] buf, int n) -
read
-
write
-
pread
int pread(int fd, byte[] buf, int n, int offset) -
pwrite
int pwrite(int fd, byte[] buf, int n, int offset) -
pread
-
pwrite
-
lseek
int lseek(int fd, long offset, int whence) -
lseekLong
long lseekLong(int fd, long offset, int whence) -
pipe
int pipe(int[] fds) -
truncate
-
ftruncate
int ftruncate(int fd, long offset) -
rename
-
getcwd
String getcwd() -
gethostname
String gethostname() -
socketpair
int socketpair(int domain, int type, int protocol, int[] fds) -
sendmsg
-
recvmsg
-
allocateMsgHdr
MsgHdr allocateMsgHdr() -
fcntl
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
- theFcntl
enum value for the flag to setarg
- arguments for the flag or null if none- Returns:
- 0 if success, -1 if error
- See Also:
-
fsync
int fsync(int fd) -
fdatasync
int fdatasync(int fd) -
mkfifo
-
daemon
int daemon(int nochdir, int noclose) -
getgroups
long[] getgroups() -
getgroups
int getgroups(int size, int[] groups) -
nl_langinfo
-
setlocale
-
allocateTimeval
Timeval allocateTimeval() -
gettimeofday
-