Package jnr.posix
Class BaseNativePOSIX
java.lang.Object
jnr.posix.NativePOSIX
jnr.posix.BaseNativePOSIX
- All Implemented Interfaces:
POSIX
- Direct Known Subclasses:
AixPOSIX
,DragonFlyPOSIX
,FreeBSDPOSIX
,LinuxPOSIX
,MacOSPOSIX
,OpenBSDPOSIX
,SolarisPOSIX
,WindowsPOSIX
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final jnr.ffi.mapper.ToNativeConverter<jnr.constants.Constant,
Integer> private final Crypt
static final jnr.ffi.mapper.ToNativeConverter<FileStat,
jnr.ffi.Pointer> static final BaseNativePOSIX.PointerConverter
protected final POSIXHandler
protected final JavaLibCHelper
private final LibC
static final jnr.ffi.mapper.ToNativeConverter<MsgHdr,
jnr.ffi.Pointer> protected final Map<jnr.constants.platform.Signal,
SignalHandler> static final jnr.ffi.mapper.ToNativeConverter<NativeTimes,
jnr.ffi.Pointer> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseNativePOSIX
(LibCProvider libcProvider, POSIXHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionint
access
(CharSequence path, int amode) abstract FileStat
int
int
int
int
close
(int fd) int
confstr
(jnr.constants.platform.Confstr name, ByteBuffer buf, int len) final 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.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 fcntl) int
fcntl
(int fd, jnr.constants.platform.Fcntl fcntl, int arg) int
fcntl
(int fd, jnr.constants.platform.Fcntl fcntl, int... args) Deprecated.int
fcntlInt
(int fd, jnr.constants.platform.Fcntl fcntl, int arg) int
fdatasync
(int fd) int
flock
(int fd, int mode) int
fork()
int
fpathconf
(int fd, jnr.constants.platform.Pathconf name) fstat
(int fd) int
fstat
(FileDescriptor fileDescriptor) int
fstat
(FileDescriptor fileDescriptor, 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
getfd
(FileDescriptor descriptor) 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()
(package private) POSIXHandler
handler()
int
isatty
(int fd) boolean
isatty
(FileDescriptor fd) boolean
isNative()
int
kill
(int pid, int signal) int
kill
(long pid, int signal) int
int
final LibC
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
private jnr.ffi.Pointer
nativeFileActions
(Collection<? extends SpawnFileAction> fileActions) private jnr.ffi.Pointer
nativeSpawnAttributes
(Collection<? extends SpawnAttribute> spawnAttributes) 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, CharSequence[] argv, CharSequence[] envp) 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, CharSequence[] argv, 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) protected int
protected <T> T
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) Methods inherited from class jnr.posix.NativePOSIX
allocatePosixSpawnattr, allocatePosixSpawnFileActions, getRuntime, socketMacros
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jnr.posix.POSIX
allocateMsgHdr
-
Field Details
-
libc
-
crypt
-
handler
-
helper
-
signalHandlers
-
GROUP
-
FileStatConverter
-
TimesConverter
-
ConstantConverter
public static final jnr.ffi.mapper.ToNativeConverter<jnr.constants.Constant,Integer> ConstantConverter -
MsgHdrConverter
-
-
Constructor Details
-
BaseNativePOSIX
-
-
Method Details
-
newProcessMaker
- Specified by:
newProcessMaker
in interfacePOSIX
-
newProcessMaker
- Specified by:
newProcessMaker
in interfacePOSIX
-
libc
Description copied from interface:POSIX
Returns null if isNative returns false. -
crypt
-
handler
POSIXHandler handler() -
unimplementedNull
protected <T> T unimplementedNull() -
unimplementedInt
protected int unimplementedInt() -
chmod
-
fchmod
public int fchmod(int fd, int mode) -
chown
-
fchown
public int fchown(int fd, int user, int group) -
crypt
-
crypt
public byte[] crypt(byte[] key, byte[] salt) Description copied from interface:POSIX
Call the crypt function with the given key and salt as raw null-terminated byte (C char) strings. -
exec
Description copied from interface:POSIX
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list. -
exec
Description copied from interface:POSIX
Shell expanding and escaping version of exec which handles all the preparation of a command line or command list. -
execv
-
execve
-
fstat
-
fstat
-
fstat
-
fstat
-
environ
public jnr.ffi.Pointer environ() -
getenv
-
getegid
public int getegid() -
geteuid
public int geteuid() -
getgid
public int getgid() -
getdtablesize
public int getdtablesize()- Specified by:
getdtablesize
in interfacePOSIX
-
getlogin
-
getpgid
public int getpgid() -
getpgrp
public int getpgrp() -
getpid
public int getpid() -
getppid
public int getppid() -
getpwent
-
getpwuid
-
getpwnam
-
getgrent
-
getgrgid
-
getgrnam
-
setpwent
public int setpwent() -
endpwent
public int endpwent() -
setgrent
public int setgrent() -
endgrent
public int endgrent() -
getuid
public int getuid() -
getrlimit
-
getrlimit
public int getrlimit(int resource, jnr.ffi.Pointer rlim) -
getrlimit
-
setrlimit
-
setrlimit
public int setrlimit(int resource, jnr.ffi.Pointer rlim) -
setrlimit
public int setrlimit(int resource, long rlimCur, long rlimMax) -
setegid
public int setegid(int egid) -
seteuid
public int seteuid(int euid) -
setgid
public int setgid(int gid) -
getfd
-
getpgid
public int getpgid(int pid) -
setpgid
public int setpgid(int pid, int pgid) -
setpgrp
public int setpgrp(int pid, int pgrp) -
setsid
public int setsid() -
setuid
public int setuid(int uid) -
kill
public int kill(int pid, int signal) -
kill
public int kill(long pid, int signal) -
signal
-
raise
public int raise(int sig) -
lchmod
-
lchown
-
link
-
lstat
-
lstat
-
mkdir
-
rmdir
-
setenv
-
stat
-
stat
-
symlink
-
readlink
- Specified by:
readlink
in interfacePOSIX
- Throws:
IOException
-
readlink
-
readlink
-
readlink
-
unsetenv
-
umask
public int umask(int mask) -
utimes
-
utimes
-
futimes
public int futimes(int fd, long[] atimeval, long[] mtimeval) -
lutimes
-
utimensat
-
utimensat
-
futimens
public int futimens(int fd, long[] atimespec, long[] mtimespec) -
futimens
public int futimens(int fd, jnr.ffi.Pointer times) -
fork
public int fork() -
waitpid
public int waitpid(int pid, int[] status, int flags) -
waitpid
public int waitpid(long pid, int[] status, int flags) -
wait
public int wait(int[] status) -
getpriority
public int getpriority(int which, int who) - Specified by:
getpriority
in interfacePOSIX
-
setpriority
public int setpriority(int which, int who, int prio) - Specified by:
setpriority
in interfacePOSIX
-
isatty
-
isatty
public int isatty(int fd) -
errno
public int errno() -
errno
public void errno(int value) -
chdir
-
isNative
public boolean isNative() -
posix_spawnp
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, CharSequence[] argv, CharSequence[] envp) -
posix_spawnp
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) - Specified by:
posix_spawnp
in interfacePOSIX
-
posix_spawnp
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) - Specified by:
posix_spawnp
in interfacePOSIX
-
posix_spawnp
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, CharSequence[] argv, CharSequence[] envp) -
flock
public int flock(int fd, int mode) -
dup
public int dup(int fd) -
dup2
public int dup2(int oldFd, int newFd) -
fcntlInt
public int fcntlInt(int fd, jnr.constants.platform.Fcntl fcntl, int arg) -
fcntl
public int fcntl(int fd, jnr.constants.platform.Fcntl fcntl) -
fcntl
public int fcntl(int fd, jnr.constants.platform.Fcntl fcntl, int arg) -
fcntl
Deprecated.Description copied from interface:POSIX
fcntl(2) -
access
-
close
public int close(int fd) -
nativeFileActions
-
nativeSpawnAttributes
-
allocateStat
- Specified by:
allocateStat
in interfacePOSIX
-
sysconf
public long sysconf(jnr.constants.platform.Sysconf name) -
confstr
-
fpathconf
public int fpathconf(int fd, jnr.constants.platform.Pathconf name) -
times
-
unlink
-
open
-
read
public long read(int fd, byte[] buf, long n) -
write
public long write(int fd, byte[] buf, long n) -
read
-
write
-
pread
public long pread(int fd, byte[] buf, long n, long offset) -
pwrite
public long pwrite(int fd, byte[] buf, long n, long offset) -
pread
-
pwrite
-
read
public int read(int fd, byte[] buf, int n) -
write
public int write(int fd, byte[] buf, int n) -
read
-
write
-
pread
public int pread(int fd, byte[] buf, int n, int offset) -
pwrite
public int pwrite(int fd, byte[] buf, int n, int offset) -
pread
-
pwrite
-
lseek
public int lseek(int fd, long offset, int whence) -
lseekLong
public long lseekLong(int fd, long offset, int whence) -
pipe
public int pipe(int[] fds) -
socketpair
public int socketpair(int domain, int type, int protocol, int[] fds) - Specified by:
socketpair
in interfacePOSIX
-
sendmsg
-
recvmsg
-
truncate
-
ftruncate
public int ftruncate(int fd, long offset) -
rename
-
gethostname
- Specified by:
gethostname
in interfacePOSIX
-
getcwd
-
fsync
public int fsync(int fd) -
fdatasync
public int fdatasync(int fd) -
mkfifo
-
daemon
public int daemon(int nochdir, int noclose) -
getgroups
public long[] getgroups() -
getgroups
public int getgroups(int size, int[] groups) -
nl_langinfo
- Specified by:
nl_langinfo
in interfacePOSIX
-
setlocale
-
strerror
-
allocateTimeval
- Specified by:
allocateTimeval
in interfacePOSIX
-
gettimeofday
- Specified by:
gettimeofday
in interfacePOSIX
-