Package libcore.io
Interface Os
-
- All Known Implementing Classes:
BlockGuardOs,ForwardingOs,Posix
public interface Os
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileDescriptoraccept(FileDescriptor fd, SocketAddress peerAddress)booleanaccess(String path, int mode)InetAddress[]android_getaddrinfo(String node, StructAddrinfo hints, int netId)voidbind(FileDescriptor fd, InetAddress address, int port)voidbind(FileDescriptor fd, SocketAddress address)voidchmod(String path, int mode)voidchown(String path, int uid, int gid)voidclose(FileDescriptor fd)voidconnect(FileDescriptor fd, InetAddress address, int port)voidconnect(FileDescriptor fd, SocketAddress address)FileDescriptordup(FileDescriptor oldFd)FileDescriptordup2(FileDescriptor oldFd, int newFd)String[]environ()voidexecv(String filename, String[] argv)voidexecve(String filename, String[] argv, String[] envp)voidfchmod(FileDescriptor fd, int mode)voidfchown(FileDescriptor fd, int uid, int gid)intfcntlFlock(FileDescriptor fd, int cmd, StructFlock arg)intfcntlInt(FileDescriptor fd, int cmd, int arg)intfcntlVoid(FileDescriptor fd, int cmd)voidfdatasync(FileDescriptor fd)StructStatfstat(FileDescriptor fd)StructStatVfsfstatvfs(FileDescriptor fd)voidfsync(FileDescriptor fd)voidftruncate(FileDescriptor fd, long length)Stringgai_strerror(int error)intgetegid()Stringgetenv(String name)intgeteuid()intgetgid()Stringgetnameinfo(InetAddress address, int flags)SocketAddressgetpeername(FileDescriptor fd)intgetpgid(int pid)intgetpid()intgetppid()StructPasswdgetpwnam(String name)StructPasswdgetpwuid(int uid)SocketAddressgetsockname(FileDescriptor fd)intgetsockoptByte(FileDescriptor fd, int level, int option)InetAddressgetsockoptInAddr(FileDescriptor fd, int level, int option)intgetsockoptInt(FileDescriptor fd, int level, int option)StructLingergetsockoptLinger(FileDescriptor fd, int level, int option)StructTimevalgetsockoptTimeval(FileDescriptor fd, int level, int option)StructUcredgetsockoptUcred(FileDescriptor fd, int level, int option)intgettid()intgetuid()intgetxattr(String path, String name, byte[] outValue)Stringif_indextoname(int index)InetAddressinet_pton(int family, String address)InetAddressioctlInetAddress(FileDescriptor fd, int cmd, String interfaceName)intioctlInt(FileDescriptor fd, int cmd, MutableInt arg)booleanisatty(FileDescriptor fd)voidkill(int pid, int signal)voidlchown(String path, int uid, int gid)voidlink(String oldPath, String newPath)voidlisten(FileDescriptor fd, int backlog)longlseek(FileDescriptor fd, long offset, int whence)StructStatlstat(String path)voidmincore(long address, long byteCount, byte[] vector)voidmkdir(String path, int mode)voidmkfifo(String path, int mode)voidmlock(long address, long byteCount)longmmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset)voidmsync(long address, long byteCount, int flags)voidmunlock(long address, long byteCount)voidmunmap(long address, long byteCount)FileDescriptoropen(String path, int flags, int mode)FileDescriptor[]pipe2(int flags)intpoll(StructPollfd[] fds, int timeoutMs)voidposix_fallocate(FileDescriptor fd, long offset, long length)intprctl(int option, long arg2, long arg3, long arg4, long arg5)intpread(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset)intpread(FileDescriptor fd, ByteBuffer buffer, long offset)intpwrite(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset)intpwrite(FileDescriptor fd, ByteBuffer buffer, long offset)intread(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount)intread(FileDescriptor fd, ByteBuffer buffer)Stringreadlink(String path)intreadv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts)intrecvfrom(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress)intrecvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress)voidremove(String path)voidremovexattr(String path, String name)voidrename(String oldPath, String newPath)longsendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount)intsendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port)intsendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress address)intsendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port)voidsetegid(int egid)voidsetenv(String name, String value, boolean overwrite)voidseteuid(int euid)voidsetgid(int gid)voidsetpgid(int pid, int pgid)voidsetregid(int rgid, int egid)voidsetreuid(int ruid, int euid)intsetsid()voidsetsockoptByte(FileDescriptor fd, int level, int option, int value)voidsetsockoptGroupReq(FileDescriptor fd, int level, int option, StructGroupReq value)voidsetsockoptGroupSourceReq(FileDescriptor fd, int level, int option, StructGroupSourceReq value)voidsetsockoptIfreq(FileDescriptor fd, int level, int option, String value)voidsetsockoptInt(FileDescriptor fd, int level, int option, int value)voidsetsockoptIpMreqn(FileDescriptor fd, int level, int option, int value)voidsetsockoptLinger(FileDescriptor fd, int level, int option, StructLinger value)voidsetsockoptTimeval(FileDescriptor fd, int level, int option, StructTimeval value)voidsetuid(int uid)voidsetxattr(String path, String name, byte[] value, int flags)voidshutdown(FileDescriptor fd, int how)FileDescriptorsocket(int domain, int type, int protocol)voidsocketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2)StructStatstat(String path)StructStatVfsstatvfs(String path)Stringstrerror(int errno)Stringstrsignal(int signal)voidsymlink(String oldPath, String newPath)longsysconf(int name)voidtcdrain(FileDescriptor fd)voidtcsendbreak(FileDescriptor fd, int duration)intumask(int mask)StructUtsnameuname()voidunlink(String pathname)voidunsetenv(String name)intwaitpid(int pid, MutableInt status, int options)intwrite(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount)intwrite(FileDescriptor fd, ByteBuffer buffer)intwritev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts)
-
-
-
Method Detail
-
accept
FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
access
boolean access(String path, int mode) throws ErrnoException
- Throws:
ErrnoException
-
android_getaddrinfo
InetAddress[] android_getaddrinfo(String node, StructAddrinfo hints, int netId) throws GaiException
- Throws:
GaiException
-
bind
void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
bind
void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
chmod
void chmod(String path, int mode) throws ErrnoException
- Throws:
ErrnoException
-
chown
void chown(String path, int uid, int gid) throws ErrnoException
- Throws:
ErrnoException
-
close
void close(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
connect
void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
connect
void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
dup
FileDescriptor dup(FileDescriptor oldFd) throws ErrnoException
- Throws:
ErrnoException
-
dup2
FileDescriptor dup2(FileDescriptor oldFd, int newFd) throws ErrnoException
- Throws:
ErrnoException
-
environ
String[] environ()
-
execv
void execv(String filename, String[] argv) throws ErrnoException
- Throws:
ErrnoException
-
execve
void execve(String filename, String[] argv, String[] envp) throws ErrnoException
- Throws:
ErrnoException
-
fchmod
void fchmod(FileDescriptor fd, int mode) throws ErrnoException
- Throws:
ErrnoException
-
fchown
void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException
- Throws:
ErrnoException
-
fcntlFlock
int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
fcntlInt
int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException
- Throws:
ErrnoException
-
fcntlVoid
int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException
- Throws:
ErrnoException
-
fdatasync
void fdatasync(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
fstat
StructStat fstat(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
fstatvfs
StructStatVfs fstatvfs(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
fsync
void fsync(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
ftruncate
void ftruncate(FileDescriptor fd, long length) throws ErrnoException
- Throws:
ErrnoException
-
gai_strerror
String gai_strerror(int error)
-
getegid
int getegid()
-
geteuid
int geteuid()
-
getgid
int getgid()
-
getnameinfo
String getnameinfo(InetAddress address, int flags) throws GaiException
- Throws:
GaiException
-
getpeername
SocketAddress getpeername(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
getpgid
int getpgid(int pid) throws ErrnoException- Throws:
ErrnoException
-
getpid
int getpid()
-
getppid
int getppid()
-
getpwnam
StructPasswd getpwnam(String name) throws ErrnoException
- Throws:
ErrnoException
-
getpwuid
StructPasswd getpwuid(int uid) throws ErrnoException
- Throws:
ErrnoException
-
getsockname
SocketAddress getsockname(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptByte
int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptInAddr
InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptInt
int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptLinger
StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptTimeval
StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
getsockoptUcred
StructUcred getsockoptUcred(FileDescriptor fd, int level, int option) throws ErrnoException
- Throws:
ErrnoException
-
gettid
int gettid()
-
getuid
int getuid()
-
getxattr
int getxattr(String path, String name, byte[] outValue) throws ErrnoException
- Throws:
ErrnoException
-
if_indextoname
String if_indextoname(int index)
-
inet_pton
InetAddress inet_pton(int family, String address)
-
ioctlInetAddress
InetAddress ioctlInetAddress(FileDescriptor fd, int cmd, String interfaceName) throws ErrnoException
- Throws:
ErrnoException
-
ioctlInt
int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException
- Throws:
ErrnoException
-
isatty
boolean isatty(FileDescriptor fd)
-
kill
void kill(int pid, int signal) throws ErrnoException- Throws:
ErrnoException
-
lchown
void lchown(String path, int uid, int gid) throws ErrnoException
- Throws:
ErrnoException
-
link
void link(String oldPath, String newPath) throws ErrnoException
- Throws:
ErrnoException
-
listen
void listen(FileDescriptor fd, int backlog) throws ErrnoException
- Throws:
ErrnoException
-
lseek
long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException
- Throws:
ErrnoException
-
lstat
StructStat lstat(String path) throws ErrnoException
- Throws:
ErrnoException
-
mincore
void mincore(long address, long byteCount, byte[] vector) throws ErrnoException- Throws:
ErrnoException
-
mkdir
void mkdir(String path, int mode) throws ErrnoException
- Throws:
ErrnoException
-
mkfifo
void mkfifo(String path, int mode) throws ErrnoException
- Throws:
ErrnoException
-
mlock
void mlock(long address, long byteCount) throws ErrnoException- Throws:
ErrnoException
-
mmap
long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException- Throws:
ErrnoException
-
msync
void msync(long address, long byteCount, int flags) throws ErrnoException- Throws:
ErrnoException
-
munlock
void munlock(long address, long byteCount) throws ErrnoException- Throws:
ErrnoException
-
munmap
void munmap(long address, long byteCount) throws ErrnoException- Throws:
ErrnoException
-
open
FileDescriptor open(String path, int flags, int mode) throws ErrnoException
- Throws:
ErrnoException
-
pipe2
FileDescriptor[] pipe2(int flags) throws ErrnoException
- Throws:
ErrnoException
-
poll
int poll(StructPollfd[] fds, int timeoutMs) throws ErrnoException
- Throws:
ErrnoException
-
posix_fallocate
void posix_fallocate(FileDescriptor fd, long offset, long length) throws ErrnoException
- Throws:
ErrnoException
-
prctl
int prctl(int option, long arg2, long arg3, long arg4, long arg5) throws ErrnoException- Throws:
ErrnoException
-
pread
int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
pread
int pread(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
pwrite
int pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
pwrite
int pwrite(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
read
int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
read
int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
readlink
String readlink(String path) throws ErrnoException
- Throws:
ErrnoException
-
readv
int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
recvfrom
int recvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
recvfrom
int recvfrom(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
remove
void remove(String path) throws ErrnoException
- Throws:
ErrnoException
-
removexattr
void removexattr(String path, String name) throws ErrnoException
- Throws:
ErrnoException
-
rename
void rename(String oldPath, String newPath) throws ErrnoException
- Throws:
ErrnoException
-
sendto
int sendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
sendto
int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
sendto
int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress address) throws ErrnoException, SocketException
- Throws:
ErrnoExceptionSocketException
-
sendfile
long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException
- Throws:
ErrnoException
-
setegid
void setegid(int egid) throws ErrnoException- Throws:
ErrnoException
-
setenv
void setenv(String name, String value, boolean overwrite) throws ErrnoException
- Throws:
ErrnoException
-
seteuid
void seteuid(int euid) throws ErrnoException- Throws:
ErrnoException
-
setgid
void setgid(int gid) throws ErrnoException- Throws:
ErrnoException
-
setpgid
void setpgid(int pid, int pgid) throws ErrnoException- Throws:
ErrnoException
-
setregid
void setregid(int rgid, int egid) throws ErrnoException- Throws:
ErrnoException
-
setreuid
void setreuid(int ruid, int euid) throws ErrnoException- Throws:
ErrnoException
-
setsid
int setsid() throws ErrnoException- Throws:
ErrnoException
-
setsockoptByte
void setsockoptByte(FileDescriptor fd, int level, int option, int value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptIfreq
void setsockoptIfreq(FileDescriptor fd, int level, int option, String value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptInt
void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptIpMreqn
void setsockoptIpMreqn(FileDescriptor fd, int level, int option, int value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptGroupReq
void setsockoptGroupReq(FileDescriptor fd, int level, int option, StructGroupReq value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptGroupSourceReq
void setsockoptGroupSourceReq(FileDescriptor fd, int level, int option, StructGroupSourceReq value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptLinger
void setsockoptLinger(FileDescriptor fd, int level, int option, StructLinger value) throws ErrnoException
- Throws:
ErrnoException
-
setsockoptTimeval
void setsockoptTimeval(FileDescriptor fd, int level, int option, StructTimeval value) throws ErrnoException
- Throws:
ErrnoException
-
setuid
void setuid(int uid) throws ErrnoException- Throws:
ErrnoException
-
setxattr
void setxattr(String path, String name, byte[] value, int flags) throws ErrnoException
- Throws:
ErrnoException
-
shutdown
void shutdown(FileDescriptor fd, int how) throws ErrnoException
- Throws:
ErrnoException
-
socket
FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException
- Throws:
ErrnoException
-
socketpair
void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException- Throws:
ErrnoException
-
stat
StructStat stat(String path) throws ErrnoException
- Throws:
ErrnoException
-
statvfs
StructStatVfs statvfs(String path) throws ErrnoException
- Throws:
ErrnoException
-
strerror
String strerror(int errno)
-
strsignal
String strsignal(int signal)
-
symlink
void symlink(String oldPath, String newPath) throws ErrnoException
- Throws:
ErrnoException
-
sysconf
long sysconf(int name)
-
tcdrain
void tcdrain(FileDescriptor fd) throws ErrnoException
- Throws:
ErrnoException
-
tcsendbreak
void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException
- Throws:
ErrnoException
-
umask
int umask(int mask)
-
uname
StructUtsname uname()
-
unlink
void unlink(String pathname) throws ErrnoException
- Throws:
ErrnoException
-
unsetenv
void unsetenv(String name) throws ErrnoException
- Throws:
ErrnoException
-
waitpid
int waitpid(int pid, MutableInt status, int options) throws ErrnoException- Throws:
ErrnoException
-
write
int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
write
int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
writev
int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException
- Throws:
ErrnoExceptionInterruptedIOException
-
-