Package jnr.posix

Interface POSIX

All Known Subinterfaces:
Linux
All Known Implementing Classes:
BaseNativePOSIX, NativePOSIX, WindowsPOSIX

public interface POSIX
  • 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 bytes
      salt - 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 execute
      argv - 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 execute
      argv - the arguments to pass, with arg0 equal to the desired process name
      envp - a set of KEY=VALUE environment strings to set for the new execution
      Returns:
      does not return if successful; -1 if failed
    • execv

      int execv(String path, String[] argv)
    • execve

      int execve(String path, String[] argv, String[] envp)
    • 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()
    • getenv

      String getenv(String envName)
    • 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)
    • getpwnam

      Passwd getpwnam(String which)
    • getgrgid

      Group getgrgid(int which)
    • getgrnam

      Group getgrnam(String 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)
    • link

      int link(String oldpath, String newpath)
    • lstat

      FileStat lstat(String path)
    • lstat

      int lstat(String path, FileStat stat)
    • 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)
    • setenv

      int setenv(String envName, String envValue, int overwrite)
    • 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

      FileStat stat(String path)
    • stat

      int stat(String path, FileStat stat)
    • symlink

      int symlink(String oldpath, String newpath)
    • 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 act
      fcntlConst - the Fcntl enum value for the flag to set
      arg - 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

      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)
    • setlocale

      String setlocale(int category, String locale)
    • allocateTimeval

      Timeval allocateTimeval()
    • gettimeofday

      int gettimeofday(Timeval tv)