java.lang.Object
jnr.posix.NativePOSIX
jnr.posix.BaseNativePOSIX
jnr.posix.WindowsPOSIX
- All Implemented Interfaces:
POSIX
-
Nested Class Summary
Nested classes/interfaces inherited from class jnr.posix.BaseNativePOSIX
BaseNativePOSIX.PointerConverter -
Field Summary
FieldsFields inherited from class jnr.posix.BaseNativePOSIX
ConstantConverter, FileStatConverter, GROUP, handler, helper, MsgHdrConverter, signalHandlers, TimesConverter -
Method Summary
Modifier and TypeMethodDescriptionintintintintbyte[]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) intendgrent()intendpwent()jnr.ffi.Pointerenviron()intShell expanding and escaping version of exec which handles all the preparation of a command line or command list.intShell expanding and escaping version of exec which handles all the preparation of a command line or command list.intintfcntlInt(int fd, jnr.constants.platform.Fcntl fcntl, int arg) intfindFirstFile(String path, FileStat stat) fstat(int fd) intfstat(FileDescriptor fileDescriptor, FileStat stat) intgetegid()intgeteuid()intgetgid()getgrent()getgrgid(int which) getlogin()intgetpgid()intgetpgid(int pid) intgetpid()intgetppid()intgetpriority(int which, int who) getpwent()getpwuid(int which) intgettimeofday(Timeval tv) intgetuid()intisatty(int fd) booleanisatty(FileDescriptor fd) intkill(int pid, int signal) intkill(long pid, int signal) intintintintintintintpipe(int[] fds) intThe logic here is a bit strange and this copies MRI (Ruby) which may not be language agnostic, but windows (win7 and others) automatically mark folders as read-only when it contains other files and folders within it.intsetegid(int egid) intintseteuid(int euid) intsetgid(int gid) intsetgrent()intsetpgid(int pid, int pgid) intsetpriority(int which, int who, int prio) intsetpwent()intsetuid(int uid) intintinttruncate(CharSequence path, long length) intumask(int mask) intintintintwait(int[] status) intwaitpid(int pid, int[] status, int flags) intwaitpid(long pid, int[] status, int flags) Methods inherited from class jnr.posix.BaseNativePOSIX
access, close, confstr, crypt, daemon, dup, dup2, errno, errno, execve, fchmod, fchown, fcntl, fcntl, fcntl, fdatasync, flock, fork, fpathconf, fstat, fstat, fsync, ftruncate, futimens, futimens, futimes, getcwd, getdtablesize, getenv, getfd, getgroups, getgroups, getpgrp, getrlimit, getrlimit, getrlimit, isNative, libc, lseek, lseekLong, lutimes, newProcessMaker, newProcessMaker, nl_langinfo, open, posix_spawnp, posix_spawnp, posix_spawnp, posix_spawnp, pread, pread, pread, pread, pwrite, pwrite, pwrite, pwrite, raise, read, read, read, read, readlink, readlink, readlink, recvmsg, rename, sendmsg, setlocale, setpgrp, setrlimit, setrlimit, setrlimit, setsid, signal, socketpair, stat, strerror, symlink, sysconf, times, unimplementedInt, unimplementedNull, unlink, utimensat, utimes, write, write, write, writeMethods inherited from class jnr.posix.NativePOSIX
allocatePosixSpawnattr, allocatePosixSpawnFileActions
-
Field Details
-
FILE_FLAG_BACKUP_SEMANTICS
public static final int FILE_FLAG_BACKUP_SEMANTICS- See Also:
-
PASSWD
-
-
Method Details
-
allocateStat
- Specified by:
allocateStatin interfacePOSIX- Specified by:
allocateStatin classBaseNativePOSIX
-
allocateMsgHdr
-
socketMacros
- Specified by:
socketMacrosin classNativePOSIX
-
kill
public int kill(int pid, int signal) - Specified by:
killin interfacePOSIX- Overrides:
killin classBaseNativePOSIX
-
kill
public int kill(long pid, int signal) - Specified by:
killin interfacePOSIX- Overrides:
killin classBaseNativePOSIX
-
chmod
- Specified by:
chmodin interfacePOSIX- Overrides:
chmodin classBaseNativePOSIX
-
chdir
- Specified by:
chdirin interfacePOSIX- Overrides:
chdirin classBaseNativePOSIX
-
chown
- Specified by:
chownin interfacePOSIX- Overrides:
chownin classBaseNativePOSIX
-
exec
Description copied from interface:POSIXShell expanding and escaping version of exec which handles all the preparation of a command line or command list.- Specified by:
execin interfacePOSIX- Overrides:
execin classBaseNativePOSIX- 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
-
crypt
- Specified by:
cryptin interfacePOSIX- Overrides:
cryptin classBaseNativePOSIX
-
crypt
public byte[] crypt(byte[] key, byte[] salt) Description copied from interface:POSIXCall the crypt function with the given key and salt as raw null-terminated byte (C char) strings.- Specified by:
cryptin interfacePOSIX- Overrides:
cryptin classBaseNativePOSIX- Parameters:
key- null-terminated key bytessalt- null-terminated salt bytes- Returns:
- null-terminated crypted bytes, or null if there was an error
-
exec
Description copied from interface:POSIXShell expanding and escaping version of exec which handles all the preparation of a command line or command list.- Specified by:
execin interfacePOSIX- Overrides:
execin classBaseNativePOSIX- 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
- Specified by:
execvin interfacePOSIX- Overrides:
execvin classBaseNativePOSIX
-
getegid
public int getegid()- Specified by:
getegidin interfacePOSIX- Overrides:
getegidin classBaseNativePOSIX
-
setegid
public int setegid(int egid) - Specified by:
setegidin interfacePOSIX- Overrides:
setegidin classBaseNativePOSIX
-
geteuid
public int geteuid()- Specified by:
geteuidin interfacePOSIX- Overrides:
geteuidin classBaseNativePOSIX
-
seteuid
public int seteuid(int euid) - Specified by:
seteuidin interfacePOSIX- Overrides:
seteuidin classBaseNativePOSIX
-
getuid
public int getuid()- Specified by:
getuidin interfacePOSIX- Overrides:
getuidin classBaseNativePOSIX
-
setuid
public int setuid(int uid) - Specified by:
setuidin interfacePOSIX- Overrides:
setuidin classBaseNativePOSIX
-
getgid
public int getgid()- Specified by:
getgidin interfacePOSIX- Overrides:
getgidin classBaseNativePOSIX
-
setgid
public int setgid(int gid) - Specified by:
setgidin interfacePOSIX- Overrides:
setgidin classBaseNativePOSIX
-
getpgid
public int getpgid(int pid) - Specified by:
getpgidin interfacePOSIX- Overrides:
getpgidin classBaseNativePOSIX
-
getpgid
public int getpgid()- Specified by:
getpgidin interfacePOSIX- Overrides:
getpgidin classBaseNativePOSIX
-
setpgid
public int setpgid(int pid, int pgid) - Specified by:
setpgidin interfacePOSIX- Overrides:
setpgidin classBaseNativePOSIX
-
getpriority
public int getpriority(int which, int who) - Specified by:
getpriorityin interfacePOSIX- Overrides:
getpriorityin classBaseNativePOSIX
-
setpriority
public int setpriority(int which, int who, int prio) - Specified by:
setpriorityin interfacePOSIX- Overrides:
setpriorityin classBaseNativePOSIX
-
getpid
public int getpid()- Specified by:
getpidin interfacePOSIX- Overrides:
getpidin classBaseNativePOSIX
-
getppid
public int getppid()- Specified by:
getppidin interfacePOSIX- Overrides:
getppidin classBaseNativePOSIX
-
lchmod
- Specified by:
lchmodin interfacePOSIX- Overrides:
lchmodin classBaseNativePOSIX
-
lchown
- Specified by:
lchownin interfacePOSIX- Overrides:
lchownin classBaseNativePOSIX
-
gethostname
- Specified by:
gethostnamein interfacePOSIX- Overrides:
gethostnamein classBaseNativePOSIX
-
fstat
- Specified by:
fstatin interfacePOSIX- Overrides:
fstatin classBaseNativePOSIX
-
fstat
- Specified by:
fstatin interfacePOSIX- Overrides:
fstatin classBaseNativePOSIX
-
lstat
- Specified by:
lstatin interfacePOSIX- Overrides:
lstatin classBaseNativePOSIX
-
lstat
- Specified by:
lstatin interfacePOSIX- Overrides:
lstatin classBaseNativePOSIX
-
stat
- Specified by:
statin interfacePOSIX- Overrides:
statin classBaseNativePOSIX
-
findFirstFile
-
readlink
- Specified by:
readlinkin interfacePOSIX- Overrides:
readlinkin classBaseNativePOSIX
-
environ
public jnr.ffi.Pointer environ()- Specified by:
environin interfacePOSIX- Overrides:
environin classBaseNativePOSIX
-
setenv
- Specified by:
setenvin interfacePOSIX- Overrides:
setenvin classBaseNativePOSIX
-
umask
public int umask(int mask) - Specified by:
umaskin interfacePOSIX- Overrides:
umaskin classBaseNativePOSIX
-
unsetenv
- Specified by:
unsetenvin interfacePOSIX- Overrides:
unsetenvin classBaseNativePOSIX
-
utimes
- Specified by:
utimesin interfacePOSIX- Overrides:
utimesin classBaseNativePOSIX
-
utimensat
- Specified by:
utimensatin interfacePOSIX- Overrides:
utimensatin classBaseNativePOSIX
-
wait
public int wait(int[] status) - Specified by:
waitin interfacePOSIX- Overrides:
waitin classBaseNativePOSIX
-
waitpid
public int waitpid(int pid, int[] status, int flags) - Specified by:
waitpidin interfacePOSIX- Overrides:
waitpidin classBaseNativePOSIX
-
waitpid
public int waitpid(long pid, int[] status, int flags) - Specified by:
waitpidin interfacePOSIX- Overrides:
waitpidin classBaseNativePOSIX
-
getlogin
- Specified by:
getloginin interfacePOSIX- Overrides:
getloginin classBaseNativePOSIX
-
endgrent
public int endgrent()- Specified by:
endgrentin interfacePOSIX- Overrides:
endgrentin classBaseNativePOSIX
-
endpwent
public int endpwent()- Specified by:
endpwentin interfacePOSIX- Overrides:
endpwentin classBaseNativePOSIX
-
getgrent
- Specified by:
getgrentin interfacePOSIX- Overrides:
getgrentin classBaseNativePOSIX
-
getpwent
- Specified by:
getpwentin interfacePOSIX- Overrides:
getpwentin classBaseNativePOSIX
-
getgrgid
- Specified by:
getgrgidin interfacePOSIX- Overrides:
getgrgidin classBaseNativePOSIX
-
getpwnam
- Specified by:
getpwnamin interfacePOSIX- Overrides:
getpwnamin classBaseNativePOSIX
-
getgrnam
- Specified by:
getgrnamin interfacePOSIX- Overrides:
getgrnamin classBaseNativePOSIX
-
setgrent
public int setgrent()- Specified by:
setgrentin interfacePOSIX- Overrides:
setgrentin classBaseNativePOSIX
-
setpwent
public int setpwent()- Specified by:
setpwentin interfacePOSIX- Overrides:
setpwentin classBaseNativePOSIX
-
getpwuid
- Specified by:
getpwuidin interfacePOSIX- Overrides:
getpwuidin classBaseNativePOSIX
-
isatty
- Specified by:
isattyin interfacePOSIX- Overrides:
isattyin classBaseNativePOSIX
-
isatty
public int isatty(int fd) - Specified by:
isattyin interfacePOSIX- Overrides:
isattyin classBaseNativePOSIX
-
mkdir
- Specified by:
mkdirin interfacePOSIX- Overrides:
mkdirin classBaseNativePOSIX
-
rmdir
The logic here is a bit strange and this copies MRI (Ruby) which may not be language agnostic, but windows (win7 and others) automatically mark folders as read-only when it contains other files and folders within it. This document explains more: http://support.microsoft.com/kb/326549 I think the logic is based around idea that if you removed all other files it would be empty but will stay marked as read-only.- Specified by:
rmdirin interfacePOSIX- Overrides:
rmdirin classBaseNativePOSIX- Parameters:
path- the path to remove- Returns:
- 0 if successful, -1 if failed
-
link
- Specified by:
linkin interfacePOSIX- Overrides:
linkin classBaseNativePOSIX
-
aspawn
- Parameters:
overlay- is P_OVERLAY if true and P_NOWAIT if falseprogram- to be invokedargv- is all args including argv0 being what is executedpath- is path to be searched when needed (delimited by ; on windows)envp- is a set of KEY=VALUE strings to be set in the child process- Returns:
- the pid
-
pipe
public int pipe(int[] fds) - Specified by:
pipein interfacePOSIX- Overrides:
pipein classBaseNativePOSIX
-
truncate
- Specified by:
truncatein interfacePOSIX- Overrides:
truncatein classBaseNativePOSIX
-
fcntlInt
public int fcntlInt(int fd, jnr.constants.platform.Fcntl fcntl, int arg) - Specified by:
fcntlIntin interfacePOSIX- Overrides:
fcntlIntin classBaseNativePOSIX
-
spawn
- Parameters:
overlay- is P_OVERLAY if true and P_NOWAIT if falsecommand- full command stringprogram- program to be invokedpath- is path to be searched when needed (delimited by ; on windows)envp- is a set of KEY=VALUE strings to be set in the child process- Returns:
- the pid
-
mkfifo
- Specified by:
mkfifoin interfacePOSIX- Overrides:
mkfifoin classBaseNativePOSIX
-
allocateTimeval
- Specified by:
allocateTimevalin interfacePOSIX- Overrides:
allocateTimevalin classBaseNativePOSIX
-
gettimeofday
- Specified by:
gettimeofdayin interfacePOSIX- Overrides:
gettimeofdayin classBaseNativePOSIX
-