Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/system/Os#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/system/Os#inhmethods)

# Os

*** ** * ** ***

` public final class Os `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.system.Os |

<br />

*** ** * ** ***

Access to low-level system functionality. Most of these are system calls. Most users will want to use higher-level APIs where available, but this class provides access to the underlying primitives used to implement the higher-level APIs.

The corresponding constants can be found in `https://developer.android.com/reference/android/system/OsConstants`.

## Summary

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#accept(java.io.FileDescriptor,%20java.net.InetSocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/net/InetSocketAddress peerAddress) ` See [accept(2)](http://man7.org/linux/man-pages/man2/accept.2.html). |
| ` static boolean` | ` https://developer.android.com/reference/android/system/Os#access(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String path, int mode) ` See [access(2)](http://man7.org/linux/man-pages/man2/access.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#bind(java.io.FileDescriptor,%20java.net.InetAddress,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/net/InetAddress address, int port) ` See [bind(2)](http://man7.org/linux/man-pages/man2/bind.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#bind(java.io.FileDescriptor,%20java.net.SocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/net/SocketAddress address) ` See [bind(2)](http://man7.org/linux/man-pages/man2/bind.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#chmod(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String path, int mode) ` See [chmod(2)](http://man7.org/linux/man-pages/man2/chmod.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#chown(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String path, int uid, int gid) ` See [chown(2)](http://man7.org/linux/man-pages/man2/chown.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#close(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [close(2)](http://man7.org/linux/man-pages/man2/close.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#connect(java.io.FileDescriptor,%20java.net.InetAddress,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/net/InetAddress address, int port) ` See [connect(2)](http://man7.org/linux/man-pages/man2/connect.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#connect(java.io.FileDescriptor,%20java.net.SocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/net/SocketAddress address) ` See [connect(2)](http://man7.org/linux/man-pages/man2/connect.2.html). |
| ` static https://developer.android.com/reference/android/system/StructDlInfo` | ` https://developer.android.com/reference/android/system/Os#dladdr(long)(long addr) ` See [dladdr(3)](https://man7.org/linux/man-pages/man3/dladdr.3.html) [](https://man7.org/linux/man-pages/man3/dladdr.3.html) |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#dup(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor oldFd) ` See [dup(2)](http://man7.org/linux/man-pages/man2/dup.2.html). |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#dup2(java.io.FileDescriptor,%20int)(https://developer.android.com/reference/java/io/FileDescriptor oldFd, int newFd) ` See [dup2(2)](http://man7.org/linux/man-pages/man2/dup2.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#environ()() ` See [environ(3)](http://man7.org/linux/man-pages/man3/environ.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#execv(java.lang.String,%20java.lang.String[])(https://developer.android.com/reference/java/lang/String filename, https://developer.android.com/reference/java/lang/String argv) ` See [exec(3)](https://man7.org/linux/man-pages/man3/execv.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#execve(java.lang.String,%20java.lang.String[],%20java.lang.String[])(https://developer.android.com/reference/java/lang/String filename, https://developer.android.com/reference/java/lang/String argv, https://developer.android.com/reference/java/lang/String envp) ` See [execve(2)](http://man7.org/linux/man-pages/man2/execve.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#fchmod(java.io.FileDescriptor,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int mode) ` See [fchmod(2)](http://man7.org/linux/man-pages/man2/fchmod.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#fchown(java.io.FileDescriptor,%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int uid, int gid) ` See [fchown(2)](http://man7.org/linux/man-pages/man2/fchown.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#fcntlInt(java.io.FileDescriptor,%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int cmd, int arg) ` See [fcntl(2)](http://man7.org/linux/man-pages/man2/fcntl.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#fdatasync(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [fdatasync(2)](http://man7.org/linux/man-pages/man2/fdatasync.2.html). |
| ` static https://developer.android.com/reference/android/system/StructStat` | ` https://developer.android.com/reference/android/system/Os#fstat(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [fstat(2)](http://man7.org/linux/man-pages/man2/fstat.2.html). |
| ` static https://developer.android.com/reference/android/system/StructStatVfs` | ` https://developer.android.com/reference/android/system/Os#fstatvfs(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [fstatvfs(2)](http://man7.org/linux/man-pages/man2/fstatvfs.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#fsync(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [fsync(2)](http://man7.org/linux/man-pages/man2/fsync.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#ftruncate(java.io.FileDescriptor,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, long length) ` See [ftruncate(2)](http://man7.org/linux/man-pages/man2/ftruncate.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#gai_strerror(int)(int error) ` See [gai_strerror(3)](http://man7.org/linux/man-pages/man3/gai_strerror.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#getegid()() ` See [getegid(2)](http://man7.org/linux/man-pages/man2/getegid.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#getenv(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` See [getenv(3)](http://man7.org/linux/man-pages/man3/getenv.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#geteuid()() ` See [geteuid(2)](http://man7.org/linux/man-pages/man2/geteuid.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#getgid()() ` See [getgid(2)](http://man7.org/linux/man-pages/man2/getgid.2.html). |
| ` static https://developer.android.com/reference/java/net/SocketAddress` | ` https://developer.android.com/reference/android/system/Os#getpeername(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [getpeername(2)](http://man7.org/linux/man-pages/man2/getpeername.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#getpid()() ` See [getpid(2)](http://man7.org/linux/man-pages/man2/getpid.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#getppid()() ` See [getppid(2)](http://man7.org/linux/man-pages/man2/getppid.2.html). |
| ` static https://developer.android.com/reference/java/net/SocketAddress` | ` https://developer.android.com/reference/android/system/Os#getsockname(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [getsockname(2)](http://man7.org/linux/man-pages/man2/getsockname.2.html). |
| ` static https://developer.android.com/reference/android/system/StructTimeval` | ` https://developer.android.com/reference/android/system/Os#getsockoptTimeval(java.io.FileDescriptor,%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int level, int option) ` See [getsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#gettid()() ` See [gettid(2)](http://man7.org/linux/man-pages/man2/gettid.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#getuid()() ` See [getuid(2)](http://man7.org/linux/man-pages/man2/getuid.2.html). |
| ` static byte[]` | ` https://developer.android.com/reference/android/system/Os#getxattr(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String path, https://developer.android.com/reference/java/lang/String name) ` See [getxattr(2)](http://man7.org/linux/man-pages/man2/getxattr.2.html) |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#if_indextoname(int)(int index) ` See [if_indextoname(3)](http://man7.org/linux/man-pages/man3/if_indextoname.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#if_nametoindex(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` See [if_nametoindex(3)](http://man7.org/linux/man-pages/man3/if_nametoindex.3.html). |
| ` static https://developer.android.com/reference/java/net/InetAddress` | ` https://developer.android.com/reference/android/system/Os#inet_pton(int,%20java.lang.String)(int family, https://developer.android.com/reference/java/lang/String address) ` See [inet_pton(3)](http://man7.org/linux/man-pages/man3/inet_pton.3.html). |
| ` static boolean` | ` https://developer.android.com/reference/android/system/Os#isatty(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [isatty(3)](http://man7.org/linux/man-pages/man3/isatty.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#kill(int,%20int)(int pid, int signal) ` See [kill(2)](http://man7.org/linux/man-pages/man2/kill.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#lchown(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String path, int uid, int gid) ` See [lchown(2)](http://man7.org/linux/man-pages/man2/lchown.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#link(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String oldPath, https://developer.android.com/reference/java/lang/String newPath) ` See [link(2)](http://man7.org/linux/man-pages/man2/link.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#listen(java.io.FileDescriptor,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int backlog) ` See [listen(2)](http://man7.org/linux/man-pages/man2/listen.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#listxattr(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [listxattr(2)](http://man7.org/linux/man-pages/man2/listxattr.2.html) |
| ` static long` | ` https://developer.android.com/reference/android/system/Os#lseek(java.io.FileDescriptor,%20long,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, long offset, int whence) ` See [lseek(2)](http://man7.org/linux/man-pages/man2/lseek.2.html). |
| ` static https://developer.android.com/reference/android/system/StructStat` | ` https://developer.android.com/reference/android/system/Os#lstat(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [lstat(2)](http://man7.org/linux/man-pages/man2/lstat.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#madvise(long,%20long,%20int)(long address, long byteCount, int advice) ` See [madvise(2)](http://man7.org/linux/man-pages/man2/madvise.2.html). |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#memfd_create(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int flags) ` See [memfd_create(2)](http://man7.org/linux/man-pages/man2/memfd_create.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#mincore(long,%20long,%20byte[])(long address, long byteCount, byte[] vector) ` See [mincore(2)](http://man7.org/linux/man-pages/man2/mincore.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#mkdir(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String path, int mode) ` See [mkdir(2)](http://man7.org/linux/man-pages/man2/mkdir.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#mkfifo(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String path, int mode) ` See [mkfifo(3)](http://man7.org/linux/man-pages/man3/mkfifo.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#mlock(long,%20long)(long address, long byteCount) ` See [mlock(2)](http://man7.org/linux/man-pages/man2/mlock.2.html). |
| ` static long` | ` https://developer.android.com/reference/android/system/Os#mmap(long,%20long,%20int,%20int,%20java.io.FileDescriptor,%20long)(long address, long byteCount, int prot, int flags, https://developer.android.com/reference/java/io/FileDescriptor fd, long offset) ` See [mmap(2)](http://man7.org/linux/man-pages/man2/mmap.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#msync(long,%20long,%20int)(long address, long byteCount, int flags) ` See [msync(2)](http://man7.org/linux/man-pages/man2/msync.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#munlock(long,%20long)(long address, long byteCount) ` See [munlock(2)](http://man7.org/linux/man-pages/man2/munlock.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#munmap(long,%20long)(long address, long byteCount) ` See [munmap(2)](http://man7.org/linux/man-pages/man2/munmap.2.html). |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#open(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String path, int flags, int mode) ` See [open(2)](http://man7.org/linux/man-pages/man2/open.2.html). |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#pipe()() ` See [pipe(2)](http://man7.org/linux/man-pages/man2/pipe.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#poll(android.system.StructPollfd[],%20int)(https://developer.android.com/reference/android/system/StructPollfd fds, int timeoutMs) ` See [poll(2)](http://man7.org/linux/man-pages/man2/poll.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#posix_fallocate(java.io.FileDescriptor,%20long,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, long offset, long length) ` See [posix_fallocate(3)](http://man7.org/linux/man-pages/man3/posix_fallocate.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#prctl(int,%20long,%20long,%20long,%20long)(int option, long arg2, long arg3, long arg4, long arg5) ` See [prctl(2)](http://man7.org/linux/man-pages/man2/prctl.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#pread(java.io.FileDescriptor,%20byte[],%20int,%20int,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) ` See [pread(2)](http://man7.org/linux/man-pages/man2/pread.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#pread(java.io.FileDescriptor,%20java.nio.ByteBuffer,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer, long offset) ` See [pread(2)](http://man7.org/linux/man-pages/man2/pread.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#pwrite(java.io.FileDescriptor,%20byte[],%20int,%20int,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) ` See [pwrite(2)](http://man7.org/linux/man-pages/man2/pwrite.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#pwrite(java.io.FileDescriptor,%20java.nio.ByteBuffer,%20long)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer, long offset) ` See [pwrite(2)](http://man7.org/linux/man-pages/man2/pwrite.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#read(java.io.FileDescriptor,%20byte[],%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) ` See [read(2)](http://man7.org/linux/man-pages/man2/read.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#read(java.io.FileDescriptor,%20java.nio.ByteBuffer)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` See [read(2)](http://man7.org/linux/man-pages/man2/read.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#readlink(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [readlink(2)](http://man7.org/linux/man-pages/man2/readlink.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#readv(java.io.FileDescriptor,%20java.lang.Object[],%20int[],%20int[])(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/lang/Object buffers, int[] offsets, int[] byteCounts) ` See [readv(2)](http://man7.org/linux/man-pages/man2/readv.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#recvfrom(java.io.FileDescriptor,%20byte[],%20int,%20int,%20int,%20java.net.InetSocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, https://developer.android.com/reference/java/net/InetSocketAddress srcAddress) ` See [recvfrom(2)](http://man7.org/linux/man-pages/man2/recvfrom.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#recvfrom(java.io.FileDescriptor,%20java.nio.ByteBuffer,%20int,%20java.net.InetSocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer, int flags, https://developer.android.com/reference/java/net/InetSocketAddress srcAddress) ` See [recvfrom(2)](http://man7.org/linux/man-pages/man2/recvfrom.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#recvmsg(java.io.FileDescriptor,%20android.system.StructMsghdr,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/android/system/StructMsghdr msg, int flags) ` See [recvmsg(2)](http://man7.org/linux/man-pages/man2/recvmsg.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#remove(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [remove(3)](http://man7.org/linux/man-pages/man3/remove.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#removexattr(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String path, https://developer.android.com/reference/java/lang/String name) ` See [removexattr(2)](http://man7.org/linux/man-pages/man2/removexattr.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#rename(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String oldPath, https://developer.android.com/reference/java/lang/String newPath) ` See [rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html). |
| ` static long` | ` https://developer.android.com/reference/android/system/Os#sendfile(java.io.FileDescriptor,%20java.io.FileDescriptor,%20android.system.Int64Ref,%20long)(https://developer.android.com/reference/java/io/FileDescriptor outFd, https://developer.android.com/reference/java/io/FileDescriptor inFd, https://developer.android.com/reference/android/system/Int64Ref offset, long byteCount) ` See [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#sendmsg(java.io.FileDescriptor,%20android.system.StructMsghdr,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/android/system/StructMsghdr msg, int flags) ` See [sendmsg(2)](http://man7.org/linux/man-pages/man2/sendmsg.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#sendto(java.io.FileDescriptor,%20byte[],%20int,%20int,%20int,%20java.net.SocketAddress)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, https://developer.android.com/reference/java/net/SocketAddress address) ` See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#sendto(java.io.FileDescriptor,%20byte[],%20int,%20int,%20int,%20java.net.InetAddress,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, https://developer.android.com/reference/java/net/InetAddress inetAddress, int port) ` See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#sendto(java.io.FileDescriptor,%20java.nio.ByteBuffer,%20int,%20java.net.InetAddress,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer, int flags, https://developer.android.com/reference/java/net/InetAddress inetAddress, int port) ` See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setegid(int)(int egid) ` *This method was deprecated in API level 29. Android Applications do not have sufficient privileges to call this method.* |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setenv(java.lang.String,%20java.lang.String,%20boolean)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/java/lang/String value, boolean overwrite) ` See [setenv(3)](http://man7.org/linux/man-pages/man3/setenv.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#seteuid(int)(int euid) ` *This method was deprecated in API level 29. Android Applications do not have sufficient privileges to call this method.* |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setgid(int)(int gid) ` *This method was deprecated in API level 29. Android Applications do not have sufficient privileges to call this method.* |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#setsid()() ` See [setsid(2)](http://man7.org/linux/man-pages/man2/setsid.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setsockoptInt(java.io.FileDescriptor,%20int,%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int level, int option, int value) ` See [setsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setsockoptTimeval(java.io.FileDescriptor,%20int,%20int,%20android.system.StructTimeval)(https://developer.android.com/reference/java/io/FileDescriptor fd, int level, int option, https://developer.android.com/reference/android/system/StructTimeval value) ` See [setsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setuid(int)(int uid) ` *This method was deprecated in API level 29. Android Applications do not have sufficient privileges to call this method.* |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#setxattr(java.lang.String,%20java.lang.String,%20byte[],%20int)(https://developer.android.com/reference/java/lang/String path, https://developer.android.com/reference/java/lang/String name, byte[] value, int flags) ` See [setxattr(2)](http://man7.org/linux/man-pages/man2/setxattr.2.html) |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#shutdown(java.io.FileDescriptor,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int how) ` See [shutdown(2)](http://man7.org/linux/man-pages/man2/shutdown.2.html). |
| ` static https://developer.android.com/reference/java/io/FileDescriptor` | ` https://developer.android.com/reference/android/system/Os#socket(int,%20int,%20int)(int domain, int type, int protocol) ` See [socket(2)](http://man7.org/linux/man-pages/man2/socket.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#socketpair(int,%20int,%20int,%20java.io.FileDescriptor,%20java.io.FileDescriptor)(int domain, int type, int protocol, https://developer.android.com/reference/java/io/FileDescriptor fd1, https://developer.android.com/reference/java/io/FileDescriptor fd2) ` See [socketpair(2)](http://man7.org/linux/man-pages/man2/socketpair.2.html). |
| ` static https://developer.android.com/reference/android/system/StructStat` | ` https://developer.android.com/reference/android/system/Os#stat(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [stat(2)](http://man7.org/linux/man-pages/man2/stat.2.html). |
| ` static https://developer.android.com/reference/android/system/StructStatVfs` | ` https://developer.android.com/reference/android/system/Os#statvfs(java.lang.String)(https://developer.android.com/reference/java/lang/String path) ` See [statvfs(2)](http://man7.org/linux/man-pages/man2/statvfs.2.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#strerror(int)(int errno) ` See [strerror(2)](http://man7.org/linux/man-pages/man3/strerror.3.html). |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/system/Os#strsignal(int)(int signal) ` See [strsignal(3)](http://man7.org/linux/man-pages/man3/strsignal.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#symlink(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String oldPath, https://developer.android.com/reference/java/lang/String newPath) ` See [symlink(2)](http://man7.org/linux/man-pages/man2/symlink.2.html). |
| ` static long` | ` https://developer.android.com/reference/android/system/Os#sysconf(int)(int name) ` See [sysconf(3)](http://man7.org/linux/man-pages/man3/sysconf.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#tcdrain(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor fd) ` See [tcdrain(3)](http://man7.org/linux/man-pages/man3/tcdrain.3.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#tcsendbreak(java.io.FileDescriptor,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, int duration) ` See [tcsendbreak(3)](http://man7.org/linux/man-pages/man3/tcsendbreak.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#umask(int)(int mask) ` See [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html). |
| ` static https://developer.android.com/reference/android/system/StructUtsname` | ` https://developer.android.com/reference/android/system/Os#uname()() ` See [uname(2)](http://man7.org/linux/man-pages/man2/uname.2.html). |
| ` static void` | ` https://developer.android.com/reference/android/system/Os#unsetenv(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` See [unsetenv(3)](http://man7.org/linux/man-pages/man3/unsetenv.3.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#write(java.io.FileDescriptor,%20byte[],%20int,%20int)(https://developer.android.com/reference/java/io/FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) ` See [write(2)](http://man7.org/linux/man-pages/man2/write.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#write(java.io.FileDescriptor,%20java.nio.ByteBuffer)(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` See [write(2)](http://man7.org/linux/man-pages/man2/write.2.html). |
| ` static int` | ` https://developer.android.com/reference/android/system/Os#writev(java.io.FileDescriptor,%20java.lang.Object[],%20int[],%20int[])(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/lang/Object buffers, int[] offsets, int[] byteCounts) ` See [writev(2)](http://man7.org/linux/man-pages/man2/writev.2.html). |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### accept

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor accept (FileDescriptor fd, 
                InetSocketAddress peerAddress)
```

See [accept(2)](http://man7.org/linux/man-pages/man2/accept.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `peerAddress` | `InetSocketAddress` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### access

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean access (String path, 
                int mode)
```

See [access(2)](http://man7.org/linux/man-pages/man2/access.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `mode` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### bind

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void bind (FileDescriptor fd, 
                InetAddress address, 
                int port)
```

See [bind(2)](http://man7.org/linux/man-pages/man2/bind.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `address` | `InetAddress` <br /> |
| `port` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### bind

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void bind (FileDescriptor fd, 
                SocketAddress address)
```

See [bind(2)](http://man7.org/linux/man-pages/man2/bind.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `address` | `SocketAddress`: This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### chmod

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void chmod (String path, 
                int mode)
```

See [chmod(2)](http://man7.org/linux/man-pages/man2/chmod.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `mode` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### chown

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void chown (String path, 
                int uid, 
                int gid)
```

See [chown(2)](http://man7.org/linux/man-pages/man2/chown.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `uid` | `int` <br /> |
| `gid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### close

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void close (FileDescriptor fd)
```

See [close(2)](http://man7.org/linux/man-pages/man2/close.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### connect

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void connect (FileDescriptor fd, 
                InetAddress address, 
                int port)
```

See [connect(2)](http://man7.org/linux/man-pages/man2/connect.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `address` | `InetAddress` <br /> |
| `port` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### connect

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void connect (FileDescriptor fd, 
                SocketAddress address)
```

See [connect(2)](http://man7.org/linux/man-pages/man2/connect.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `address` | `SocketAddress`: This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### dladdr

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static StructDlInfo dladdr (long addr)
```

See [dladdr(3)](https://man7.org/linux/man-pages/man3/dladdr.3.html)

<br />

[| Parameters ||
|---|---|
| `addr` | `long` <br /> |
| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructDlInfo` | null if the underlying native `dladdr` call fails. <br /> |](https://man7.org/linux/man-pages/man3/dladdr.3.html) [](https://man7.org/linux/man-pages/man3/dladdr.3.html) [### dup](https://man7.org/linux/man-pages/man3/dladdr.3.html) [](https://man7.org/linux/man-pages/man3/dladdr.3.html) [Added in](https://man7.org/linux/man-pages/man3/dladdr.3.html)[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor dup (FileDescriptor oldFd)
```

See [dup(2)](http://man7.org/linux/man-pages/man2/dup.2.html).

<br />

| Parameters ||
|---|---|
| `oldFd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### dup2

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor dup2 (FileDescriptor oldFd, 
                int newFd)
```

See [dup2(2)](http://man7.org/linux/man-pages/man2/dup2.2.html).

<br />

| Parameters ||
|---|---|
| `oldFd` | `FileDescriptor` <br /> |
| `newFd` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### environ

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String[] environ ()
```

See [environ(3)](http://man7.org/linux/man-pages/man3/environ.3.html).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### execv

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void execv (String filename, 
                String[] argv)
```

See [exec(3)](https://man7.org/linux/man-pages/man3/execv.3.html).

<br />

| Parameters ||
|---|---|
| `filename` | `String` <br /> |
| `argv` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### execve

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void execve (String filename, 
                String[] argv, 
                String[] envp)
```

See [execve(2)](http://man7.org/linux/man-pages/man2/execve.2.html).

<br />

| Parameters ||
|---|---|
| `filename` | `String` <br /> |
| `argv` | `String` <br /> |
| `envp` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fchmod

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void fchmod (FileDescriptor fd, 
                int mode)
```

See [fchmod(2)](http://man7.org/linux/man-pages/man2/fchmod.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `mode` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fchown

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void fchown (FileDescriptor fd, 
                int uid, 
                int gid)
```

See [fchown(2)](http://man7.org/linux/man-pages/man2/fchown.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `uid` | `int` <br /> |
| `gid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fcntlInt

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int fcntlInt (FileDescriptor fd, 
                int cmd, 
                int arg)
```

See [fcntl(2)](http://man7.org/linux/man-pages/man2/fcntl.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `cmd` | `int` <br /> |
| `arg` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fdatasync

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void fdatasync (FileDescriptor fd)
```

See [fdatasync(2)](http://man7.org/linux/man-pages/man2/fdatasync.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fstat

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructStat fstat (FileDescriptor fd)
```

See [fstat(2)](http://man7.org/linux/man-pages/man2/fstat.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructStat` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fstatvfs

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructStatVfs fstatvfs (FileDescriptor fd)
```

See [fstatvfs(2)](http://man7.org/linux/man-pages/man2/fstatvfs.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructStatVfs` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### fsync

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void fsync (FileDescriptor fd)
```

See [fsync(2)](http://man7.org/linux/man-pages/man2/fsync.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### ftruncate

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void ftruncate (FileDescriptor fd, 
                long length)
```

See [ftruncate(2)](http://man7.org/linux/man-pages/man2/ftruncate.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `length` | `long` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### gai_strerror

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String gai_strerror (int error)
```

See [gai_strerror(3)](http://man7.org/linux/man-pages/man3/gai_strerror.3.html).

<br />

| Parameters ||
|---|---|
| `error` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getegid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getegid ()
```

See [getegid(2)](http://man7.org/linux/man-pages/man2/getegid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getenv

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String getenv (String name)
```

See [getenv(3)](http://man7.org/linux/man-pages/man3/getenv.3.html).

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### geteuid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int geteuid ()
```

See [geteuid(2)](http://man7.org/linux/man-pages/man2/geteuid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getgid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getgid ()
```

See [getgid(2)](http://man7.org/linux/man-pages/man2/getgid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getpeername

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static SocketAddress getpeername (FileDescriptor fd)
```

See [getpeername(2)](http://man7.org/linux/man-pages/man2/getpeername.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/SocketAddress` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### getpid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getpid ()
```

See [getpid(2)](http://man7.org/linux/man-pages/man2/getpid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getppid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getppid ()
```

See [getppid(2)](http://man7.org/linux/man-pages/man2/getppid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getsockname

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static SocketAddress getsockname (FileDescriptor fd)
```

See [getsockname(2)](http://man7.org/linux/man-pages/man2/getsockname.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/SocketAddress` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### getsockoptTimeval

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructTimeval getsockoptTimeval (FileDescriptor fd, 
                int level, 
                int option)
```

See [getsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html).

Only for use with `option` values that return a `struct timeval` such as `https://developer.android.com/reference/android/system/OsConstants#SO_RCVTIMEO` and `https://developer.android.com/reference/android/system/OsConstants#SO_SNDTIMEO`. Use with other options may throw an `IllegalArgumentException` or return junk values.

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `level` | `int` <br /> |
| `option` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructTimeval` | This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### gettid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int gettid ()
```

See [gettid(2)](http://man7.org/linux/man-pages/man2/gettid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getuid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getuid ()
```

See [getuid(2)](http://man7.org/linux/man-pages/man2/getuid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getxattr

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static byte[] getxattr (String path, 
                String name)
```

See [getxattr(2)](http://man7.org/linux/man-pages/man2/getxattr.2.html)

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `byte[]` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### if_indextoname

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String if_indextoname (int index)
```

See [if_indextoname(3)](http://man7.org/linux/man-pages/man3/if_indextoname.3.html).

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### if_nametoindex

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int if_nametoindex (String name)
```

See [if_nametoindex(3)](http://man7.org/linux/man-pages/man3/if_nametoindex.3.html).

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### inet_pton

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static InetAddress inet_pton (int family, 
                String address)
```

See [inet_pton(3)](http://man7.org/linux/man-pages/man3/inet_pton.3.html).

<br />

| Parameters ||
|---|---|
| `family` | `int` <br /> |
| `address` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/InetAddress` | <br /> |

### isatty

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean isatty (FileDescriptor fd)
```

See [isatty(3)](http://man7.org/linux/man-pages/man3/isatty.3.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### kill

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void kill (int pid, 
                int signal)
```

See [kill(2)](http://man7.org/linux/man-pages/man2/kill.2.html).

<br />

| Parameters ||
|---|---|
| `pid` | `int` <br /> |
| `signal` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### lchown

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void lchown (String path, 
                int uid, 
                int gid)
```

See [lchown(2)](http://man7.org/linux/man-pages/man2/lchown.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `uid` | `int` <br /> |
| `gid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### link

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void link (String oldPath, 
                String newPath)
```

See [link(2)](http://man7.org/linux/man-pages/man2/link.2.html).

<br />

| Parameters ||
|---|---|
| `oldPath` | `String` <br /> |
| `newPath` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### listen

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void listen (FileDescriptor fd, 
                int backlog)
```

See [listen(2)](http://man7.org/linux/man-pages/man2/listen.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `backlog` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### listxattr

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String[] listxattr (String path)
```

See [listxattr(2)](http://man7.org/linux/man-pages/man2/listxattr.2.html)

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### lseek

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long lseek (FileDescriptor fd, 
                long offset, 
                int whence)
```

See [lseek(2)](http://man7.org/linux/man-pages/man2/lseek.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `offset` | `long` <br /> |
| `whence` | `int` <br /> |

| Returns ||
|---|---|
| `long` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### lstat

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructStat lstat (String path)
```

See [lstat(2)](http://man7.org/linux/man-pages/man2/lstat.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructStat` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### madvise

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static void madvise (long address, 
                long byteCount, 
                int advice)
```

See [madvise(2)](http://man7.org/linux/man-pages/man2/madvise.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |
| `advice` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### memfd_create

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor memfd_create (String name, 
                int flags)
```

See [memfd_create(2)](http://man7.org/linux/man-pages/man2/memfd_create.2.html).

<br />

| Parameters ||
|---|---|
| `name` | `String`: This value cannot be `null`. <br /> |
| `flags` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### mincore

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void mincore (long address, 
                long byteCount, 
                byte[] vector)
```

See [mincore(2)](http://man7.org/linux/man-pages/man2/mincore.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |
| `vector` | `byte` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### mkdir

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void mkdir (String path, 
                int mode)
```

See [mkdir(2)](http://man7.org/linux/man-pages/man2/mkdir.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `mode` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### mkfifo

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void mkfifo (String path, 
                int mode)
```

See [mkfifo(3)](http://man7.org/linux/man-pages/man3/mkfifo.3.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `mode` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### mlock

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void mlock (long address, 
                long byteCount)
```

See [mlock(2)](http://man7.org/linux/man-pages/man2/mlock.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### mmap

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long mmap (long address, 
                long byteCount, 
                int prot, 
                int flags, 
                FileDescriptor fd, 
                long offset)
```

See [mmap(2)](http://man7.org/linux/man-pages/man2/mmap.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |
| `prot` | `int` <br /> |
| `flags` | `int` <br /> |
| `fd` | `FileDescriptor` <br /> |
| `offset` | `long` <br /> |

| Returns ||
|---|---|
| `long` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### msync

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void msync (long address, 
                long byteCount, 
                int flags)
```

See [msync(2)](http://man7.org/linux/man-pages/man2/msync.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |
| `flags` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### munlock

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void munlock (long address, 
                long byteCount)
```

See [munlock(2)](http://man7.org/linux/man-pages/man2/munlock.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### munmap

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void munmap (long address, 
                long byteCount)
```

See [munmap(2)](http://man7.org/linux/man-pages/man2/munmap.2.html).

<br />

| Parameters ||
|---|---|
| `address` | `long` <br /> |
| `byteCount` | `long` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### open

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor open (String path, 
                int flags, 
                int mode)
```

See [open(2)](http://man7.org/linux/man-pages/man2/open.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `flags` | `int` <br /> |
| `mode` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### pipe

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor[] pipe ()
```

See [pipe(2)](http://man7.org/linux/man-pages/man2/pipe.2.html).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### poll

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int poll (StructPollfd[] fds, 
                int timeoutMs)
```

See [poll(2)](http://man7.org/linux/man-pages/man2/poll.2.html).

Note that in Lollipop this could throw an `ErrnoException` with `EINTR`. In later releases, the implementation will automatically just restart the system call with an appropriately reduced timeout.

<br />

| Parameters ||
|---|---|
| `fds` | `StructPollfd` <br /> |
| `timeoutMs` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### posix_fallocate

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void posix_fallocate (FileDescriptor fd, 
                long offset, 
                long length)
```

See [posix_fallocate(3)](http://man7.org/linux/man-pages/man3/posix_fallocate.3.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `offset` | `long` <br /> |
| `length` | `long` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### prctl

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int prctl (int option, 
                long arg2, 
                long arg3, 
                long arg4, 
                long arg5)
```

See [prctl(2)](http://man7.org/linux/man-pages/man2/prctl.2.html).

<br />

| Parameters ||
|---|---|
| `option` | `int` <br /> |
| `arg2` | `long` <br /> |
| `arg3` | `long` <br /> |
| `arg4` | `long` <br /> |
| `arg5` | `long` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### pread

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int pread (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount, 
                long offset)
```

See [pread(2)](http://man7.org/linux/man-pages/man2/pread.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |
| `offset` | `long` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### pread

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int pread (FileDescriptor fd, 
                ByteBuffer buffer, 
                long offset)
```

See [pread(2)](http://man7.org/linux/man-pages/man2/pread.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |
| `offset` | `long` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### pwrite

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int pwrite (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount, 
                long offset)
```

See [pwrite(2)](http://man7.org/linux/man-pages/man2/pwrite.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |
| `offset` | `long` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### pwrite

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int pwrite (FileDescriptor fd, 
                ByteBuffer buffer, 
                long offset)
```

See [pwrite(2)](http://man7.org/linux/man-pages/man2/pwrite.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |
| `offset` | `long` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### read

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int read (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount)
```

See [read(2)](http://man7.org/linux/man-pages/man2/read.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### read

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int read (FileDescriptor fd, 
                ByteBuffer buffer)
```

See [read(2)](http://man7.org/linux/man-pages/man2/read.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### readlink

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String readlink (String path)
```

See [readlink(2)](http://man7.org/linux/man-pages/man2/readlink.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### readv

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int readv (FileDescriptor fd, 
                Object[] buffers, 
                int[] offsets, 
                int[] byteCounts)
```

See [readv(2)](http://man7.org/linux/man-pages/man2/readv.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffers` | `Object` <br /> |
| `offsets` | `int` <br /> |
| `byteCounts` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### recvfrom

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int recvfrom (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount, 
                int flags, 
                InetSocketAddress srcAddress)
```

See [recvfrom(2)](http://man7.org/linux/man-pages/man2/recvfrom.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |
| `flags` | `int` <br /> |
| `srcAddress` | `InetSocketAddress` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### recvfrom

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int recvfrom (FileDescriptor fd, 
                ByteBuffer buffer, 
                int flags, 
                InetSocketAddress srcAddress)
```

See [recvfrom(2)](http://man7.org/linux/man-pages/man2/recvfrom.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |
| `flags` | `int` <br /> |
| `srcAddress` | `InetSocketAddress` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### recvmsg

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int recvmsg (FileDescriptor fd, 
                StructMsghdr msg, 
                int flags)
```

See [recvmsg(2)](http://man7.org/linux/man-pages/man2/recvmsg.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `msg` | `StructMsghdr`: This value cannot be `null`. <br /> |
| `flags` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### remove

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void remove (String path)
```

See [remove(3)](http://man7.org/linux/man-pages/man3/remove.3.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### removexattr

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void removexattr (String path, 
                String name)
```

See [removexattr(2)](http://man7.org/linux/man-pages/man2/removexattr.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `name` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### rename

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void rename (String oldPath, 
                String newPath)
```

See [rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html).

<br />

| Parameters ||
|---|---|
| `oldPath` | `String` <br /> |
| `newPath` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### sendfile

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long sendfile (FileDescriptor outFd, 
                FileDescriptor inFd, 
                Int64Ref offset, 
                long byteCount)
```

See [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html).

<br />

| Parameters ||
|---|---|
| `outFd` | `FileDescriptor` <br /> |
| `inFd` | `FileDescriptor` <br /> |
| `offset` | `Int64Ref` <br /> |
| `byteCount` | `long` <br /> |

| Returns ||
|---|---|
| `long` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### sendmsg

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int sendmsg (FileDescriptor fd, 
                StructMsghdr msg, 
                int flags)
```

See [sendmsg(2)](http://man7.org/linux/man-pages/man2/sendmsg.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `msg` | `StructMsghdr`: This value cannot be `null`. <br /> |
| `flags` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### sendto

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int sendto (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount, 
                int flags, 
                SocketAddress address)
```

See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `bytes` | `byte`: This value cannot be `null`. <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |
| `flags` | `int` <br /> |
| `address` | `SocketAddress`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### sendto

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int sendto (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount, 
                int flags, 
                InetAddress inetAddress, 
                int port)
```

See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |
| `flags` | `int` <br /> |
| `inetAddress` | `InetAddress` <br /> |
| `port` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### sendto

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int sendto (FileDescriptor fd, 
                ByteBuffer buffer, 
                int flags, 
                InetAddress inetAddress, 
                int port)
```

See [sendto(2)](http://man7.org/linux/man-pages/man2/sendto.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |
| `flags` | `int` <br /> |
| `inetAddress` | `InetAddress` <br /> |
| `port` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/net/SocketException` |   |

### setegid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setegid (int egid)
```

<br />

**This method was deprecated in API level 29.**   

Android Applications do not have sufficient privileges to call this method.

See [setegid(2)](http://man7.org/linux/man-pages/man2/setegid.2.html).

<br />

| Parameters ||
|---|---|
| `egid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setenv

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setenv (String name, 
                String value, 
                boolean overwrite)
```

See [setenv(3)](http://man7.org/linux/man-pages/man3/setenv.3.html).

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |
| `value` | `String` <br /> |
| `overwrite` | `boolean` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### seteuid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void seteuid (int euid)
```

<br />

**This method was deprecated in API level 29.**   

Android Applications do not have sufficient privileges to call this method.

See [seteuid(2)](http://man7.org/linux/man-pages/man2/seteuid.2.html).

<br />

| Parameters ||
|---|---|
| `euid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setgid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setgid (int gid)
```

<br />

**This method was deprecated in API level 29.**   

Android Applications do not have sufficient privileges to call this method.

See [setgid(2)](http://man7.org/linux/man-pages/man2/setgid.2.html).

<br />

| Parameters ||
|---|---|
| `gid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setsid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int setsid ()
```

See [setsid(2)](http://man7.org/linux/man-pages/man2/setsid.2.html).

<br />

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setsockoptInt

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setsockoptInt (FileDescriptor fd, 
                int level, 
                int option, 
                int value)
```

See [setsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `level` | `int` <br /> |
| `option` | `int` <br /> |
| `value` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setsockoptTimeval

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setsockoptTimeval (FileDescriptor fd, 
                int level, 
                int option, 
                StructTimeval value)
```

See [setsockopt(2)](http://man7.org/linux/man-pages/man2/setsockopt.2.html).

Only for use with `option` values that take a `struct timeval` such as `https://developer.android.com/reference/android/system/OsConstants#SO_RCVTIMEO` and `https://developer.android.com/reference/android/system/OsConstants#SO_SNDTIMEO`. Use with other options is likely to cause incorrect behavior.

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: This value cannot be `null`. <br /> |
| `level` | `int` <br /> |
| `option` | `int` <br /> |
| `value` | `StructTimeval`: This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setuid

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setuid (int uid)
```

<br />

**This method was deprecated in API level 29.**   

Android Applications do not have sufficient privileges to call this method.

See [setuid(2)](http://man7.org/linux/man-pages/man2/setuid.2.html).

<br />

| Parameters ||
|---|---|
| `uid` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### setxattr

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void setxattr (String path, 
                String name, 
                byte[] value, 
                int flags)
```

See [setxattr(2)](http://man7.org/linux/man-pages/man2/setxattr.2.html)

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |
| `name` | `String` <br /> |
| `value` | `byte` <br /> |
| `flags` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### shutdown

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void shutdown (FileDescriptor fd, 
                int how)
```

See [shutdown(2)](http://man7.org/linux/man-pages/man2/shutdown.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `how` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### socket

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static FileDescriptor socket (int domain, 
                int type, 
                int protocol)
```

See [socket(2)](http://man7.org/linux/man-pages/man2/socket.2.html).

<br />

| Parameters ||
|---|---|
| `domain` | `int` <br /> |
| `type` | `int` <br /> |
| `protocol` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileDescriptor` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### socketpair

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void socketpair (int domain, 
                int type, 
                int protocol, 
                FileDescriptor fd1, 
                FileDescriptor fd2)
```

See [socketpair(2)](http://man7.org/linux/man-pages/man2/socketpair.2.html).

<br />

| Parameters ||
|---|---|
| `domain` | `int` <br /> |
| `type` | `int` <br /> |
| `protocol` | `int` <br /> |
| `fd1` | `FileDescriptor` <br /> |
| `fd2` | `FileDescriptor` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### stat

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructStat stat (String path)
```

See [stat(2)](http://man7.org/linux/man-pages/man2/stat.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructStat` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### statvfs

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructStatVfs statvfs (String path)
```

See [statvfs(2)](http://man7.org/linux/man-pages/man2/statvfs.2.html).

<br />

| Parameters ||
|---|---|
| `path` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructStatVfs` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### strerror

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String strerror (int errno)
```

See [strerror(2)](http://man7.org/linux/man-pages/man3/strerror.3.html).

<br />

| Parameters ||
|---|---|
| `errno` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### strsignal

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String strsignal (int signal)
```

See [strsignal(3)](http://man7.org/linux/man-pages/man3/strsignal.3.html).

<br />

| Parameters ||
|---|---|
| `signal` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### symlink

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void symlink (String oldPath, 
                String newPath)
```

See [symlink(2)](http://man7.org/linux/man-pages/man2/symlink.2.html).

<br />

| Parameters ||
|---|---|
| `oldPath` | `String` <br /> |
| `newPath` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### sysconf

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long sysconf (int name)
```

See [sysconf(3)](http://man7.org/linux/man-pages/man3/sysconf.3.html).

<br />

| Parameters ||
|---|---|
| `name` | `int` <br /> |

| Returns ||
|---|---|
| `long` | <br /> |

### tcdrain

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void tcdrain (FileDescriptor fd)
```

See [tcdrain(3)](http://man7.org/linux/man-pages/man3/tcdrain.3.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### tcsendbreak

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void tcsendbreak (FileDescriptor fd, 
                int duration)
```

See [tcsendbreak(3)](http://man7.org/linux/man-pages/man3/tcsendbreak.3.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `duration` | `int` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### umask

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int umask (int mask)
```

See [umask(2)](http://man7.org/linux/man-pages/man2/umask.2.html).

<br />

| Parameters ||
|---|---|
| `mask` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### uname

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static StructUtsname uname ()
```

See [uname(2)](http://man7.org/linux/man-pages/man2/uname.2.html).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/system/StructUtsname` | <br /> |

### unsetenv

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void unsetenv (String name)
```

See [unsetenv(3)](http://man7.org/linux/man-pages/man3/unsetenv.3.html).

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |

### write

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int write (FileDescriptor fd, 
                byte[] bytes, 
                int byteOffset, 
                int byteCount)
```

See [write(2)](http://man7.org/linux/man-pages/man2/write.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `bytes` | `byte` <br /> |
| `byteOffset` | `int` <br /> |
| `byteCount` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### write

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int write (FileDescriptor fd, 
                ByteBuffer buffer)
```

See [write(2)](http://man7.org/linux/man-pages/man2/write.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffer` | `ByteBuffer` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |

### writev

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int writev (FileDescriptor fd, 
                Object[] buffers, 
                int[] offsets, 
                int[] byteCounts)
```

See [writev(2)](http://man7.org/linux/man-pages/man2/writev.2.html).

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor` <br /> |
| `buffers` | `Object` <br /> |
| `offsets` | `int` <br /> |
| `byteCounts` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/system/ErrnoException` |   |
| `https://developer.android.com/reference/java/io/InterruptedIOException` |   |