diff options
author | Justin Klaassen <justinklaassen@google.com> | 2017-10-24 19:50:40 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2017-10-24 19:50:40 -0400 |
commit | 47ed54e5d312f899507d28d6e95ccc18a0de19fe (patch) | |
tree | 7a2d435c55c36fbc1d07e895bd0c68b18f84e12c /android/system | |
parent | 07f9f65561c2b81bcd189b895b31bb2ad0438d74 (diff) | |
download | android-28-47ed54e5d312f899507d28d6e95ccc18a0de19fe.tar.gz |
Import Android SDK Platform P [4413397]
/google/data/ro/projects/android/fetch_artifact \
--bid 4413397 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4413397.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: I3cf1f7c36e61c090dcc7de7bcfa812ef2bf96c00
Diffstat (limited to 'android/system')
-rw-r--r-- | android/system/ErrnoException.java | 92 | ||||
-rw-r--r-- | android/system/GaiException.java | 92 | ||||
-rw-r--r-- | android/system/Os.java | 1181 | ||||
-rw-r--r-- | android/system/StructAddrinfo.java | 38 | ||||
-rw-r--r-- | android/system/StructCapUserData.java | 34 | ||||
-rw-r--r-- | android/system/StructCapUserHeader.java | 36 | ||||
-rw-r--r-- | android/system/StructFlock.java | 26 | ||||
-rw-r--r-- | android/system/StructGroupReq.java | 18 | ||||
-rw-r--r-- | android/system/StructLinger.java | 28 | ||||
-rw-r--r-- | android/system/StructPasswd.java | 36 | ||||
-rw-r--r-- | android/system/StructPollfd.java | 36 | ||||
-rw-r--r-- | android/system/StructRlimit.java | 18 | ||||
-rw-r--r-- | android/system/StructStat.java | 190 | ||||
-rw-r--r-- | android/system/StructStatVfs.java | 86 | ||||
-rw-r--r-- | android/system/StructTimespec.java | 92 | ||||
-rw-r--r-- | android/system/StructTimeval.java | 48 | ||||
-rw-r--r-- | android/system/StructUcred.java | 28 | ||||
-rw-r--r-- | android/system/StructUtsname.java | 58 |
18 files changed, 1071 insertions, 1066 deletions
diff --git a/android/system/ErrnoException.java b/android/system/ErrnoException.java index 90155c89..e60ac8f3 100644 --- a/android/system/ErrnoException.java +++ b/android/system/ErrnoException.java @@ -26,57 +26,57 @@ import libcore.io.Libcore; * callers need to adjust their behavior based on the exact failure. */ public final class ErrnoException extends Exception { - private final String functionName; + private final String functionName; - /** - * The errno value, for comparison with the {@code E} constants in {@link OsConstants}. - */ - public final int errno; + /** + * The errno value, for comparison with the {@code E} constants in {@link OsConstants}. + */ + public final int errno; - /** - * Constructs an instance with the given function name and errno value. - */ - public ErrnoException(String functionName, int errno) { - this.functionName = functionName; - this.errno = errno; - } + /** + * Constructs an instance with the given function name and errno value. + */ + public ErrnoException(String functionName, int errno) { + this.functionName = functionName; + this.errno = errno; + } - /** - * Constructs an instance with the given function name, errno value, and cause. - */ - public ErrnoException(String functionName, int errno, Throwable cause) { - super(cause); - this.functionName = functionName; - this.errno = errno; - } + /** + * Constructs an instance with the given function name, errno value, and cause. + */ + public ErrnoException(String functionName, int errno, Throwable cause) { + super(cause); + this.functionName = functionName; + this.errno = errno; + } - /** - * Converts the stashed function name and errno value to a human-readable string. - * We do this here rather than in the constructor so that callers only pay for - * this if they need it. - */ - @Override public String getMessage() { - String errnoName = OsConstants.errnoName(errno); - if (errnoName == null) { - errnoName = "errno " + errno; + /** + * Converts the stashed function name and errno value to a human-readable string. + * We do this here rather than in the constructor so that callers only pay for + * this if they need it. + */ + @Override public String getMessage() { + String errnoName = OsConstants.errnoName(errno); + if (errnoName == null) { + errnoName = "errno " + errno; + } + String description = Libcore.os.strerror(errno); + return functionName + " failed: " + errnoName + " (" + description + ")"; } - String description = Libcore.os.strerror(errno); - return functionName + " failed: " + errnoName + " (" + description + ")"; - } - /** - * @hide - internal use only. - */ - public IOException rethrowAsIOException() throws IOException { - IOException newException = new IOException(getMessage()); - newException.initCause(this); - throw newException; - } + /** + * @hide - internal use only. + */ + public IOException rethrowAsIOException() throws IOException { + IOException newException = new IOException(getMessage()); + newException.initCause(this); + throw newException; + } - /** - * @hide - internal use only. - */ - public SocketException rethrowAsSocketException() throws SocketException { - throw new SocketException(getMessage(), this); - } + /** + * @hide - internal use only. + */ + public SocketException rethrowAsSocketException() throws SocketException { + throw new SocketException(getMessage(), this); + } } diff --git a/android/system/GaiException.java b/android/system/GaiException.java index dc105668..182cc3eb 100644 --- a/android/system/GaiException.java +++ b/android/system/GaiException.java @@ -27,57 +27,57 @@ import libcore.io.Libcore; * @hide */ public final class GaiException extends RuntimeException { - private final String functionName; + private final String functionName; - /** - * The native error value, for comparison with the {@code GAI_} constants in {@link OsConstants}. - */ - public final int error; + /** + * The native error value, for comparison with the {@code GAI_} constants in {@link OsConstants}. + */ + public final int error; - /** - * Constructs an instance with the given function name and error value. - */ - public GaiException(String functionName, int error) { - this.functionName = functionName; - this.error = error; - } + /** + * Constructs an instance with the given function name and error value. + */ + public GaiException(String functionName, int error) { + this.functionName = functionName; + this.error = error; + } - /** - * Constructs an instance with the given function name, error value, and cause. - */ - public GaiException(String functionName, int error, Throwable cause) { - super(cause); - this.functionName = functionName; - this.error = error; - } + /** + * Constructs an instance with the given function name, error value, and cause. + */ + public GaiException(String functionName, int error, Throwable cause) { + super(cause); + this.functionName = functionName; + this.error = error; + } - /** - * Converts the stashed function name and error value to a human-readable string. - * We do this here rather than in the constructor so that callers only pay for - * this if they need it. - */ - @Override public String getMessage() { - String gaiName = OsConstants.gaiName(error); - if (gaiName == null) { - gaiName = "GAI_ error " + error; + /** + * Converts the stashed function name and error value to a human-readable string. + * We do this here rather than in the constructor so that callers only pay for + * this if they need it. + */ + @Override public String getMessage() { + String gaiName = OsConstants.gaiName(error); + if (gaiName == null) { + gaiName = "GAI_ error " + error; + } + String description = Libcore.os.gai_strerror(error); + return functionName + " failed: " + gaiName + " (" + description + ")"; } - String description = Libcore.os.gai_strerror(error); - return functionName + " failed: " + gaiName + " (" + description + ")"; - } - /** - * @hide - internal use only. - */ - public UnknownHostException rethrowAsUnknownHostException(String detailMessage) throws UnknownHostException { - UnknownHostException newException = new UnknownHostException(detailMessage); - newException.initCause(this); - throw newException; - } + /** + * @hide - internal use only. + */ + public UnknownHostException rethrowAsUnknownHostException(String detailMessage) throws UnknownHostException { + UnknownHostException newException = new UnknownHostException(detailMessage); + newException.initCause(this); + throw newException; + } - /** - * @hide - internal use only. - */ - public UnknownHostException rethrowAsUnknownHostException() throws UnknownHostException { - throw rethrowAsUnknownHostException(getMessage()); - } + /** + * @hide - internal use only. + */ + public UnknownHostException rethrowAsUnknownHostException() throws UnknownHostException { + throw rethrowAsUnknownHostException(getMessage()); + } } diff --git a/android/system/Os.java b/android/system/Os.java index 8e312ddc..2dabae2f 100644 --- a/android/system/Os.java +++ b/android/system/Os.java @@ -35,592 +35,597 @@ import libcore.io.Libcore; * <p>The corresponding constants can be found in {@link OsConstants}. */ public final class Os { - private Os() {} - - /** - * See <a href="http://man7.org/linux/man-pages/man2/accept.2.html">accept(2)</a>. - */ - public static FileDescriptor accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketException { return Libcore.os.accept(fd, peerAddress); } - - /** - * TODO Change the public API by removing the overload above and unhiding this version. - * @hide - */ - public static FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException { return Libcore.os.accept(fd, peerAddress); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/access.2.html">access(2)</a>. - */ - public static boolean access(String path, int mode) throws ErrnoException { return Libcore.os.access(path, mode); } - - /** @hide */ public static InetAddress[] android_getaddrinfo(String node, StructAddrinfo hints, int netId) throws GaiException { return Libcore.os.android_getaddrinfo(node, hints, netId); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/bind.2.html">bind(2)</a>. - */ - public static void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.bind(fd, address, port); } - - /** @hide */ public static void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.bind(fd, address); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/capget.2.html">capget(2)</a>. - * - * @hide - */ - public static StructCapUserData[] capget(StructCapUserHeader hdr) throws ErrnoException { - return Libcore.os.capget(hdr); - } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/capset.2.html">capset(2)</a>. - * - * @hide - */ - public static void capset(StructCapUserHeader hdr, StructCapUserData[] data) - throws ErrnoException { - Libcore.os.capset(hdr, data); - } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/chmod.2.html">chmod(2)</a>. - */ - public static void chmod(String path, int mode) throws ErrnoException { Libcore.os.chmod(path, mode); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/chown.2.html">chown(2)</a>. - */ - public static void chown(String path, int uid, int gid) throws ErrnoException { Libcore.os.chown(path, uid, gid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/close.2.html">close(2)</a>. - */ - public static void close(FileDescriptor fd) throws ErrnoException { Libcore.os.close(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/connect.2.html">connect(2)</a>. - */ - public static void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.connect(fd, address, port); } - - /** @hide */ public static void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.connect(fd, address); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/dup.2.html">dup(2)</a>. - */ - public static FileDescriptor dup(FileDescriptor oldFd) throws ErrnoException { return Libcore.os.dup(oldFd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/dup2.2.html">dup2(2)</a>. - */ - public static FileDescriptor dup2(FileDescriptor oldFd, int newFd) throws ErrnoException { return Libcore.os.dup2(oldFd, newFd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/environ.3.html">environ(3)</a>. - */ - public static String[] environ() { return Libcore.os.environ(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/execv.2.html">execv(2)</a>. - */ - public static void execv(String filename, String[] argv) throws ErrnoException { Libcore.os.execv(filename, argv); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/execve.2.html">execve(2)</a>. - */ - public static void execve(String filename, String[] argv, String[] envp) throws ErrnoException { Libcore.os.execve(filename, argv, envp); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fchmod.2.html">fchmod(2)</a>. - */ - public static void fchmod(FileDescriptor fd, int mode) throws ErrnoException { Libcore.os.fchmod(fd, mode); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fchown.2.html">fchown(2)</a>. - */ - public static void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { Libcore.os.fchown(fd, uid, gid); } - - /** @hide */ public static int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException { return Libcore.os.fcntlFlock(fd, cmd, arg); } - /** @hide */ public static int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException { return Libcore.os.fcntlInt(fd, cmd, arg); } - /** @hide */ public static int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException { return Libcore.os.fcntlVoid(fd, cmd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fdatasync.2.html">fdatasync(2)</a>. - */ - public static void fdatasync(FileDescriptor fd) throws ErrnoException { Libcore.os.fdatasync(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fstat.2.html">fstat(2)</a>. - */ - public static StructStat fstat(FileDescriptor fd) throws ErrnoException { return Libcore.os.fstat(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fstatvfs.2.html">fstatvfs(2)</a>. - */ - public static StructStatVfs fstatvfs(FileDescriptor fd) throws ErrnoException { return Libcore.os.fstatvfs(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/fsync.2.html">fsync(2)</a>. - */ - public static void fsync(FileDescriptor fd) throws ErrnoException { Libcore.os.fsync(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/ftruncate.2.html">ftruncate(2)</a>. - */ - public static void ftruncate(FileDescriptor fd, long length) throws ErrnoException { Libcore.os.ftruncate(fd, length); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/gai_strerror.3.html">gai_strerror(3)</a>. - */ - public static String gai_strerror(int error) { return Libcore.os.gai_strerror(error); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getegid.2.html">getegid(2)</a>. - */ - public static int getegid() { return Libcore.os.getegid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/geteuid.2.html">geteuid(2)</a>. - */ - public static int geteuid() { return Libcore.os.geteuid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getgid.2.html">getgid(2)</a>. - */ - public static int getgid() { return Libcore.os.getgid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/getenv.3.html">getenv(3)</a>. - */ - public static String getenv(String name) { return Libcore.os.getenv(name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/getifaddrs.3.html">getifaddrs(3)</a>. - */ - /** @hide */ public static StructIfaddrs[] getifaddrs() throws ErrnoException { return Libcore.os.getifaddrs(); } - - /** @hide */ public static String getnameinfo(InetAddress address, int flags) throws GaiException { return Libcore.os.getnameinfo(address, flags); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getpeername.2.html">getpeername(2)</a>. - */ - public static SocketAddress getpeername(FileDescriptor fd) throws ErrnoException { return Libcore.os.getpeername(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getpgid.2.html">getpgid(2)</a>. - */ - /** @hide */ public static int getpgid(int pid) throws ErrnoException { return Libcore.os.getpgid(pid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getpid.2.html">getpid(2)</a>. - */ - public static int getpid() { return Libcore.os.getpid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getppid.2.html">getppid(2)</a>. - */ - public static int getppid() { return Libcore.os.getppid(); } - - /** @hide */ public static StructPasswd getpwnam(String name) throws ErrnoException { return Libcore.os.getpwnam(name); } - - /** @hide */ public static StructPasswd getpwuid(int uid) throws ErrnoException { return Libcore.os.getpwuid(uid); } - - /** @hide */ public static StructRlimit getrlimit(int resource) throws ErrnoException { return Libcore.os.getrlimit(resource); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getsockname.2.html">getsockname(2)</a>. - */ - public static SocketAddress getsockname(FileDescriptor fd) throws ErrnoException { return Libcore.os.getsockname(fd); } - - /** @hide */ public static int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptByte(fd, level, option); } - /** @hide */ public static InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptInAddr(fd, level, option); } - /** @hide */ public static int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptInt(fd, level, option); } - /** @hide */ public static StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptLinger(fd, level, option); } - /** @hide */ public static StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptTimeval(fd, level, option); } - /** @hide */ public static StructUcred getsockoptUcred(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptUcred(fd, level, option); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/gettid.2.html">gettid(2)</a>. - */ - public static int gettid() { return Libcore.os.gettid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getuid.2.html">getuid(2)</a>. - */ - public static int getuid() { return Libcore.os.getuid(); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/getxattr.2.html">getxattr(2)</a> - */ - public static byte[] getxattr(String path, String name) throws ErrnoException { return Libcore.os.getxattr(path, name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/if_indextoname.3.html">if_indextoname(3)</a>. - */ - public static String if_indextoname(int index) { return Libcore.os.if_indextoname(index); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/if_nametoindex.3.html">if_nametoindex(3)</a>. - */ - public static int if_nametoindex(String name) { return Libcore.os.if_nametoindex(name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/inet_pton.3.html">inet_pton(3)</a>. - */ - public static InetAddress inet_pton(int family, String address) { return Libcore.os.inet_pton(family, address); } - - /** @hide */ public static InetAddress ioctlInetAddress(FileDescriptor fd, int cmd, String interfaceName) throws ErrnoException { return Libcore.os.ioctlInetAddress(fd, cmd, interfaceName); } - /** @hide */ public static int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException { return Libcore.os.ioctlInt(fd, cmd, arg); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/isatty.3.html">isatty(3)</a>. - */ - public static boolean isatty(FileDescriptor fd) { return Libcore.os.isatty(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/kill.2.html">kill(2)</a>. - */ - public static void kill(int pid, int signal) throws ErrnoException { Libcore.os.kill(pid, signal); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/lchown.2.html">lchown(2)</a>. - */ - public static void lchown(String path, int uid, int gid) throws ErrnoException { Libcore.os.lchown(path, uid, gid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/link.2.html">link(2)</a>. - */ - public static void link(String oldPath, String newPath) throws ErrnoException { Libcore.os.link(oldPath, newPath); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/listen.2.html">listen(2)</a>. - */ - public static void listen(FileDescriptor fd, int backlog) throws ErrnoException { Libcore.os.listen(fd, backlog); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/listxattr.2.html">listxattr(2)</a> - */ - public static String[] listxattr(String path) throws ErrnoException { return Libcore.os.listxattr(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/lseek.2.html">lseek(2)</a>. - */ - public static long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return Libcore.os.lseek(fd, offset, whence); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/lstat.2.html">lstat(2)</a>. - */ - public static StructStat lstat(String path) throws ErrnoException { return Libcore.os.lstat(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/mincore.2.html">mincore(2)</a>. - */ - public static void mincore(long address, long byteCount, byte[] vector) throws ErrnoException { Libcore.os.mincore(address, byteCount, vector); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/mkdir.2.html">mkdir(2)</a>. - */ - public static void mkdir(String path, int mode) throws ErrnoException { Libcore.os.mkdir(path, mode); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/mkfifo.3.html">mkfifo(3)</a>. - */ - public static void mkfifo(String path, int mode) throws ErrnoException { Libcore.os.mkfifo(path, mode); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/mlock.2.html">mlock(2)</a>. - */ - public static void mlock(long address, long byteCount) throws ErrnoException { Libcore.os.mlock(address, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>. - */ - public static long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return Libcore.os.mmap(address, byteCount, prot, flags, fd, offset); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/msync.2.html">msync(2)</a>. - */ - public static void msync(long address, long byteCount, int flags) throws ErrnoException { Libcore.os.msync(address, byteCount, flags); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/munlock.2.html">munlock(2)</a>. - */ - public static void munlock(long address, long byteCount) throws ErrnoException { Libcore.os.munlock(address, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/munmap.2.html">munmap(2)</a>. - */ - public static void munmap(long address, long byteCount) throws ErrnoException { Libcore.os.munmap(address, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>. - */ - public static FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return Libcore.os.open(path, flags, mode); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/pipe.2.html">pipe(2)</a>. - */ - public static FileDescriptor[] pipe() throws ErrnoException { return Libcore.os.pipe2(0); } - - /** @hide */ public static FileDescriptor[] pipe2(int flags) throws ErrnoException { return Libcore.os.pipe2(flags); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/poll.2.html">poll(2)</a>. - * - * <p>Note that in Lollipop this could throw an {@code ErrnoException} with {@code EINTR}. - * In later releases, the implementation will automatically just restart the system call with - * an appropriately reduced timeout. - */ - public static int poll(StructPollfd[] fds, int timeoutMs) throws ErrnoException { return Libcore.os.poll(fds, timeoutMs); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/posix_fallocate.3.html">posix_fallocate(3)</a>. - */ - public static void posix_fallocate(FileDescriptor fd, long offset, long length) throws ErrnoException { Libcore.os.posix_fallocate(fd, offset, length); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/prctl.2.html">prctl(2)</a>. - */ - public static int prctl(int option, long arg2, long arg3, long arg4, long arg5) throws ErrnoException { return Libcore.os.prctl(option, arg2, arg3, arg4, arg5); }; - - /** - * See <a href="http://man7.org/linux/man-pages/man2/pread.2.html">pread(2)</a>. - */ - public static int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pread(fd, buffer, offset); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/pread.2.html">pread(2)</a>. - */ - public static int pread(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pread(fd, bytes, byteOffset, byteCount, offset); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/pwrite.2.html">pwrite(2)</a>. - */ - public static int pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pwrite(fd, buffer, offset); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/pwrite.2.html">pwrite(2)</a>. - */ - public static int pwrite(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pwrite(fd, bytes, byteOffset, byteCount, offset); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/read.2.html">read(2)</a>. - */ - public static int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException { return Libcore.os.read(fd, buffer); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/read.2.html">read(2)</a>. - */ - public static int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException { return Libcore.os.read(fd, bytes, byteOffset, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/readlink.2.html">readlink(2)</a>. - */ - public static String readlink(String path) throws ErrnoException { return Libcore.os.readlink(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/readv.2.html">readv(2)</a>. - */ - public static int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException { return Libcore.os.readv(fd, buffers, offsets, byteCounts); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/recvfrom.2.html">recvfrom(2)</a>. - */ - public static int recvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException { return Libcore.os.recvfrom(fd, buffer, flags, srcAddress); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/recvfrom.2.html">recvfrom(2)</a>. - */ - public static int recvfrom(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException { return Libcore.os.recvfrom(fd, bytes, byteOffset, byteCount, flags, srcAddress); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/remove.3.html">remove(3)</a>. - */ - public static void remove(String path) throws ErrnoException { Libcore.os.remove(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/removexattr.2.html">removexattr(2)</a>. - */ - public static void removexattr(String path, String name) throws ErrnoException { Libcore.os.removexattr(path, name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/rename.2.html">rename(2)</a>. - */ - public static void rename(String oldPath, String newPath) throws ErrnoException { Libcore.os.rename(oldPath, newPath); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/sendfile.2.html">sendfile(2)</a>. - */ - public static long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException { return Libcore.os.sendfile(outFd, inFd, inOffset, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. - */ - public static int sendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, buffer, flags, inetAddress, port); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. - */ - public static int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, bytes, byteOffset, byteCount, flags, inetAddress, port); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. - */ - /** @hide */ public static int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress address) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, bytes, byteOffset, byteCount, flags, address); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setegid.2.html">setegid(2)</a>. - */ - public static void setegid(int egid) throws ErrnoException { Libcore.os.setegid(egid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/setenv.3.html">setenv(3)</a>. - */ - public static void setenv(String name, String value, boolean overwrite) throws ErrnoException { Libcore.os.setenv(name, value, overwrite); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/seteuid.2.html">seteuid(2)</a>. - */ - public static void seteuid(int euid) throws ErrnoException { Libcore.os.seteuid(euid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setgid.2.html">setgid(2)</a>. - */ - public static void setgid(int gid) throws ErrnoException { Libcore.os.setgid(gid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setpgid.2.html">setpgid(2)</a>. - */ - /** @hide */ public static void setpgid(int pid, int pgid) throws ErrnoException { Libcore.os.setpgid(pid, pgid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setregid.2.html">setregid(2)</a>. - */ - /** @hide */ public static void setregid(int rgid, int egid) throws ErrnoException { Libcore.os.setregid(rgid, egid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setreuid.2.html">setreuid(2)</a>. - */ - /** @hide */ public static void setreuid(int ruid, int euid) throws ErrnoException { Libcore.os.setreuid(ruid, euid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setsid.2.html">setsid(2)</a>. - */ - public static int setsid() throws ErrnoException { return Libcore.os.setsid(); } - - /** @hide */ public static void setsockoptByte(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptByte(fd, level, option, value); } - /** @hide */ public static void setsockoptIfreq(FileDescriptor fd, int level, int option, String value) throws ErrnoException { Libcore.os.setsockoptIfreq(fd, level, option, value); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setsockopt.2.html">setsockopt(2)</a>. - */ - public static void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptInt(fd, level, option, value); } - - /** @hide */ public static void setsockoptIpMreqn(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptIpMreqn(fd, level, option, value); } - /** @hide */ public static void setsockoptGroupReq(FileDescriptor fd, int level, int option, StructGroupReq value) throws ErrnoException { Libcore.os.setsockoptGroupReq(fd, level, option, value); } - /** @hide */ public static void setsockoptLinger(FileDescriptor fd, int level, int option, StructLinger value) throws ErrnoException { Libcore.os.setsockoptLinger(fd, level, option, value); } - /** @hide */ public static void setsockoptTimeval(FileDescriptor fd, int level, int option, StructTimeval value) throws ErrnoException { Libcore.os.setsockoptTimeval(fd, level, option, value); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setuid.2.html">setuid(2)</a>. - */ - public static void setuid(int uid) throws ErrnoException { Libcore.os.setuid(uid); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/setxattr.2.html">setxattr(2)</a> - */ - public static void setxattr(String path, String name, byte[] value, int flags) throws ErrnoException { Libcore.os.setxattr(path, name, value, flags); }; - - /** - * See <a href="http://man7.org/linux/man-pages/man2/shutdown.2.html">shutdown(2)</a>. - */ - public static void shutdown(FileDescriptor fd, int how) throws ErrnoException { Libcore.os.shutdown(fd, how); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/socket.2.html">socket(2)</a>. - */ - public static FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException { return Libcore.os.socket(domain, type, protocol); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/socketpair.2.html">socketpair(2)</a>. - */ - public static void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException { Libcore.os.socketpair(domain, type, protocol, fd1, fd2); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/stat.2.html">stat(2)</a>. - */ - public static StructStat stat(String path) throws ErrnoException { return Libcore.os.stat(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/statvfs.2.html">statvfs(2)</a>. - */ - public static StructStatVfs statvfs(String path) throws ErrnoException { return Libcore.os.statvfs(path); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/strerror.3.html">strerror(2)</a>. - */ - public static String strerror(int errno) { return Libcore.os.strerror(errno); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/strsignal.3.html">strsignal(3)</a>. - */ - public static String strsignal(int signal) { return Libcore.os.strsignal(signal); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/symlink.2.html">symlink(2)</a>. - */ - public static void symlink(String oldPath, String newPath) throws ErrnoException { Libcore.os.symlink(oldPath, newPath); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/sysconf.3.html">sysconf(3)</a>. - */ - public static long sysconf(int name) { return Libcore.os.sysconf(name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/tcdrain.3.html">tcdrain(3)</a>. - */ - public static void tcdrain(FileDescriptor fd) throws ErrnoException { Libcore.os.tcdrain(fd); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/tcsendbreak.3.html">tcsendbreak(3)</a>. - */ - public static void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException { Libcore.os.tcsendbreak(fd, duration); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/umask.2.html">umask(2)</a>. - */ - public static int umask(int mask) { return Libcore.os.umask(mask); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/uname.2.html">uname(2)</a>. - */ - public static StructUtsname uname() { return Libcore.os.uname(); } - - /** - * @hide See <a href="http://man7.org/linux/man-pages/man2/unlink.2.html">unlink(2)</a>. - */ - public static void unlink(String pathname) throws ErrnoException { Libcore.os.unlink(pathname); } - - /** - * See <a href="http://man7.org/linux/man-pages/man3/unsetenv.3.html">unsetenv(3)</a>. - */ - public static void unsetenv(String name) throws ErrnoException { Libcore.os.unsetenv(name); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/waitpid.2.html">waitpid(2)</a>. - */ - public static int waitpid(int pid, MutableInt status, int options) throws ErrnoException { return Libcore.os.waitpid(pid, status, options); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/write.2.html">write(2)</a>. - */ - public static int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException { return Libcore.os.write(fd, buffer); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/write.2.html">write(2)</a>. - */ - public static int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException { return Libcore.os.write(fd, bytes, byteOffset, byteCount); } - - /** - * See <a href="http://man7.org/linux/man-pages/man2/writev.2.html">writev(2)</a>. - */ - public static int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException { return Libcore.os.writev(fd, buffers, offsets, byteCounts); } + private Os() {} + + /** + * See <a href="http://man7.org/linux/man-pages/man2/accept.2.html">accept(2)</a>. + */ + public static FileDescriptor accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketException { return Libcore.os.accept(fd, peerAddress); } + + /** + * TODO Change the public API by removing the overload above and unhiding this version. + * @hide + */ + public static FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException { return Libcore.os.accept(fd, peerAddress); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/access.2.html">access(2)</a>. + */ + public static boolean access(String path, int mode) throws ErrnoException { return Libcore.os.access(path, mode); } + + /** @hide */ public static InetAddress[] android_getaddrinfo(String node, StructAddrinfo hints, int netId) throws GaiException { return Libcore.os.android_getaddrinfo(node, hints, netId); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/bind.2.html">bind(2)</a>. + */ + public static void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.bind(fd, address, port); } + + /** @hide */ public static void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.bind(fd, address); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/capget.2.html">capget(2)</a>. + * + * @hide + */ + public static StructCapUserData[] capget(StructCapUserHeader hdr) throws ErrnoException { + return Libcore.os.capget(hdr); + } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/capset.2.html">capset(2)</a>. + * + * @hide + */ + public static void capset(StructCapUserHeader hdr, StructCapUserData[] data) + throws ErrnoException { + Libcore.os.capset(hdr, data); + } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/chmod.2.html">chmod(2)</a>. + */ + public static void chmod(String path, int mode) throws ErrnoException { Libcore.os.chmod(path, mode); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/chown.2.html">chown(2)</a>. + */ + public static void chown(String path, int uid, int gid) throws ErrnoException { Libcore.os.chown(path, uid, gid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/close.2.html">close(2)</a>. + */ + public static void close(FileDescriptor fd) throws ErrnoException { Libcore.os.close(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/connect.2.html">connect(2)</a>. + */ + public static void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.connect(fd, address, port); } + + /** @hide */ public static void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.connect(fd, address); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/dup.2.html">dup(2)</a>. + */ + public static FileDescriptor dup(FileDescriptor oldFd) throws ErrnoException { return Libcore.os.dup(oldFd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/dup2.2.html">dup2(2)</a>. + */ + public static FileDescriptor dup2(FileDescriptor oldFd, int newFd) throws ErrnoException { return Libcore.os.dup2(oldFd, newFd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/environ.3.html">environ(3)</a>. + */ + public static String[] environ() { return Libcore.os.environ(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/execv.2.html">execv(2)</a>. + */ + public static void execv(String filename, String[] argv) throws ErrnoException { Libcore.os.execv(filename, argv); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/execve.2.html">execve(2)</a>. + */ + public static void execve(String filename, String[] argv, String[] envp) throws ErrnoException { Libcore.os.execve(filename, argv, envp); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fchmod.2.html">fchmod(2)</a>. + */ + public static void fchmod(FileDescriptor fd, int mode) throws ErrnoException { Libcore.os.fchmod(fd, mode); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fchown.2.html">fchown(2)</a>. + */ + public static void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { Libcore.os.fchown(fd, uid, gid); } + + /** @hide */ public static int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException { return Libcore.os.fcntlFlock(fd, cmd, arg); } + /** @hide */ public static int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException { return Libcore.os.fcntlInt(fd, cmd, arg); } + /** @hide */ public static int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException { return Libcore.os.fcntlVoid(fd, cmd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fdatasync.2.html">fdatasync(2)</a>. + */ + public static void fdatasync(FileDescriptor fd) throws ErrnoException { Libcore.os.fdatasync(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fstat.2.html">fstat(2)</a>. + */ + public static StructStat fstat(FileDescriptor fd) throws ErrnoException { return Libcore.os.fstat(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fstatvfs.2.html">fstatvfs(2)</a>. + */ + public static StructStatVfs fstatvfs(FileDescriptor fd) throws ErrnoException { return Libcore.os.fstatvfs(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/fsync.2.html">fsync(2)</a>. + */ + public static void fsync(FileDescriptor fd) throws ErrnoException { Libcore.os.fsync(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/ftruncate.2.html">ftruncate(2)</a>. + */ + public static void ftruncate(FileDescriptor fd, long length) throws ErrnoException { Libcore.os.ftruncate(fd, length); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/gai_strerror.3.html">gai_strerror(3)</a>. + */ + public static String gai_strerror(int error) { return Libcore.os.gai_strerror(error); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getegid.2.html">getegid(2)</a>. + */ + public static int getegid() { return Libcore.os.getegid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/geteuid.2.html">geteuid(2)</a>. + */ + public static int geteuid() { return Libcore.os.geteuid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getgid.2.html">getgid(2)</a>. + */ + public static int getgid() { return Libcore.os.getgid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/getenv.3.html">getenv(3)</a>. + */ + public static String getenv(String name) { return Libcore.os.getenv(name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/getifaddrs.3.html">getifaddrs(3)</a>. + */ + /** @hide */ public static StructIfaddrs[] getifaddrs() throws ErrnoException { return Libcore.os.getifaddrs(); } + + /** @hide */ public static String getnameinfo(InetAddress address, int flags) throws GaiException { return Libcore.os.getnameinfo(address, flags); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getpeername.2.html">getpeername(2)</a>. + */ + public static SocketAddress getpeername(FileDescriptor fd) throws ErrnoException { return Libcore.os.getpeername(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getpgid.2.html">getpgid(2)</a>. + */ + /** @hide */ public static int getpgid(int pid) throws ErrnoException { return Libcore.os.getpgid(pid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getpid.2.html">getpid(2)</a>. + */ + public static int getpid() { return Libcore.os.getpid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getppid.2.html">getppid(2)</a>. + */ + public static int getppid() { return Libcore.os.getppid(); } + + /** @hide */ public static StructPasswd getpwnam(String name) throws ErrnoException { return Libcore.os.getpwnam(name); } + + /** @hide */ public static StructPasswd getpwuid(int uid) throws ErrnoException { return Libcore.os.getpwuid(uid); } + + /** @hide */ public static StructRlimit getrlimit(int resource) throws ErrnoException { return Libcore.os.getrlimit(resource); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getsockname.2.html">getsockname(2)</a>. + */ + public static SocketAddress getsockname(FileDescriptor fd) throws ErrnoException { return Libcore.os.getsockname(fd); } + + /** @hide */ public static int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptByte(fd, level, option); } + /** @hide */ public static InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptInAddr(fd, level, option); } + /** @hide */ public static int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptInt(fd, level, option); } + /** @hide */ public static StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptLinger(fd, level, option); } + /** @hide */ public static StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptTimeval(fd, level, option); } + /** @hide */ public static StructUcred getsockoptUcred(FileDescriptor fd, int level, int option) throws ErrnoException { return Libcore.os.getsockoptUcred(fd, level, option); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/gettid.2.html">gettid(2)</a>. + */ + public static int gettid() { return Libcore.os.gettid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getuid.2.html">getuid(2)</a>. + */ + public static int getuid() { return Libcore.os.getuid(); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/getxattr.2.html">getxattr(2)</a> + */ + public static byte[] getxattr(String path, String name) throws ErrnoException { return Libcore.os.getxattr(path, name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/if_indextoname.3.html">if_indextoname(3)</a>. + */ + public static String if_indextoname(int index) { return Libcore.os.if_indextoname(index); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/if_nametoindex.3.html">if_nametoindex(3)</a>. + */ + public static int if_nametoindex(String name) { return Libcore.os.if_nametoindex(name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/inet_pton.3.html">inet_pton(3)</a>. + */ + public static InetAddress inet_pton(int family, String address) { return Libcore.os.inet_pton(family, address); } + + /** @hide */ public static InetAddress ioctlInetAddress(FileDescriptor fd, int cmd, String interfaceName) throws ErrnoException { return Libcore.os.ioctlInetAddress(fd, cmd, interfaceName); } + /** @hide */ public static int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException { return Libcore.os.ioctlInt(fd, cmd, arg); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/isatty.3.html">isatty(3)</a>. + */ + public static boolean isatty(FileDescriptor fd) { return Libcore.os.isatty(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/kill.2.html">kill(2)</a>. + */ + public static void kill(int pid, int signal) throws ErrnoException { Libcore.os.kill(pid, signal); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/lchown.2.html">lchown(2)</a>. + */ + public static void lchown(String path, int uid, int gid) throws ErrnoException { Libcore.os.lchown(path, uid, gid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/link.2.html">link(2)</a>. + */ + public static void link(String oldPath, String newPath) throws ErrnoException { Libcore.os.link(oldPath, newPath); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/listen.2.html">listen(2)</a>. + */ + public static void listen(FileDescriptor fd, int backlog) throws ErrnoException { Libcore.os.listen(fd, backlog); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/listxattr.2.html">listxattr(2)</a> + */ + public static String[] listxattr(String path) throws ErrnoException { return Libcore.os.listxattr(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/lseek.2.html">lseek(2)</a>. + */ + public static long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return Libcore.os.lseek(fd, offset, whence); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/lstat.2.html">lstat(2)</a>. + */ + public static StructStat lstat(String path) throws ErrnoException { return Libcore.os.lstat(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/mincore.2.html">mincore(2)</a>. + */ + public static void mincore(long address, long byteCount, byte[] vector) throws ErrnoException { Libcore.os.mincore(address, byteCount, vector); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/mkdir.2.html">mkdir(2)</a>. + */ + public static void mkdir(String path, int mode) throws ErrnoException { Libcore.os.mkdir(path, mode); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/mkfifo.3.html">mkfifo(3)</a>. + */ + public static void mkfifo(String path, int mode) throws ErrnoException { Libcore.os.mkfifo(path, mode); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/mlock.2.html">mlock(2)</a>. + */ + public static void mlock(long address, long byteCount) throws ErrnoException { Libcore.os.mlock(address, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>. + */ + public static long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return Libcore.os.mmap(address, byteCount, prot, flags, fd, offset); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/msync.2.html">msync(2)</a>. + */ + public static void msync(long address, long byteCount, int flags) throws ErrnoException { Libcore.os.msync(address, byteCount, flags); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/munlock.2.html">munlock(2)</a>. + */ + public static void munlock(long address, long byteCount) throws ErrnoException { Libcore.os.munlock(address, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/munmap.2.html">munmap(2)</a>. + */ + public static void munmap(long address, long byteCount) throws ErrnoException { Libcore.os.munmap(address, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>. + */ + public static FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return Libcore.os.open(path, flags, mode); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/pipe.2.html">pipe(2)</a>. + */ + public static FileDescriptor[] pipe() throws ErrnoException { return Libcore.os.pipe2(0); } + + /** @hide */ public static FileDescriptor[] pipe2(int flags) throws ErrnoException { return Libcore.os.pipe2(flags); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/poll.2.html">poll(2)</a>. + * + * <p>Note that in Lollipop this could throw an {@code ErrnoException} with {@code EINTR}. + * In later releases, the implementation will automatically just restart the system call with + * an appropriately reduced timeout. + */ + public static int poll(StructPollfd[] fds, int timeoutMs) throws ErrnoException { return Libcore.os.poll(fds, timeoutMs); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/posix_fallocate.3.html">posix_fallocate(3)</a>. + */ + public static void posix_fallocate(FileDescriptor fd, long offset, long length) throws ErrnoException { Libcore.os.posix_fallocate(fd, offset, length); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/prctl.2.html">prctl(2)</a>. + */ + public static int prctl(int option, long arg2, long arg3, long arg4, long arg5) throws ErrnoException { return Libcore.os.prctl(option, arg2, arg3, arg4, arg5); }; + + /** + * See <a href="http://man7.org/linux/man-pages/man2/pread.2.html">pread(2)</a>. + */ + public static int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pread(fd, buffer, offset); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/pread.2.html">pread(2)</a>. + */ + public static int pread(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pread(fd, bytes, byteOffset, byteCount, offset); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/pwrite.2.html">pwrite(2)</a>. + */ + public static int pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pwrite(fd, buffer, offset); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/pwrite.2.html">pwrite(2)</a>. + */ + public static int pwrite(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, long offset) throws ErrnoException, InterruptedIOException { return Libcore.os.pwrite(fd, bytes, byteOffset, byteCount, offset); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/read.2.html">read(2)</a>. + */ + public static int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException { return Libcore.os.read(fd, buffer); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/read.2.html">read(2)</a>. + */ + public static int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException { return Libcore.os.read(fd, bytes, byteOffset, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/readlink.2.html">readlink(2)</a>. + */ + public static String readlink(String path) throws ErrnoException { return Libcore.os.readlink(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/realpath.3.html">realpath(3)</a>. + */ + /** @hide */ public static String realpath(String path) throws ErrnoException { return Libcore.os.realpath(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/readv.2.html">readv(2)</a>. + */ + public static int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException { return Libcore.os.readv(fd, buffers, offsets, byteCounts); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/recvfrom.2.html">recvfrom(2)</a>. + */ + public static int recvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException { return Libcore.os.recvfrom(fd, buffer, flags, srcAddress); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/recvfrom.2.html">recvfrom(2)</a>. + */ + public static int recvfrom(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress) throws ErrnoException, SocketException { return Libcore.os.recvfrom(fd, bytes, byteOffset, byteCount, flags, srcAddress); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/remove.3.html">remove(3)</a>. + */ + public static void remove(String path) throws ErrnoException { Libcore.os.remove(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/removexattr.2.html">removexattr(2)</a>. + */ + public static void removexattr(String path, String name) throws ErrnoException { Libcore.os.removexattr(path, name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/rename.2.html">rename(2)</a>. + */ + public static void rename(String oldPath, String newPath) throws ErrnoException { Libcore.os.rename(oldPath, newPath); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/sendfile.2.html">sendfile(2)</a>. + */ + public static long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException { return Libcore.os.sendfile(outFd, inFd, inOffset, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. + */ + public static int sendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, buffer, flags, inetAddress, port); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. + */ + public static int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, bytes, byteOffset, byteCount, flags, inetAddress, port); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>. + */ + /** @hide */ public static int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress address) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, bytes, byteOffset, byteCount, flags, address); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setegid.2.html">setegid(2)</a>. + */ + public static void setegid(int egid) throws ErrnoException { Libcore.os.setegid(egid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/setenv.3.html">setenv(3)</a>. + */ + public static void setenv(String name, String value, boolean overwrite) throws ErrnoException { Libcore.os.setenv(name, value, overwrite); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/seteuid.2.html">seteuid(2)</a>. + */ + public static void seteuid(int euid) throws ErrnoException { Libcore.os.seteuid(euid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setgid.2.html">setgid(2)</a>. + */ + public static void setgid(int gid) throws ErrnoException { Libcore.os.setgid(gid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setpgid.2.html">setpgid(2)</a>. + */ + /** @hide */ public static void setpgid(int pid, int pgid) throws ErrnoException { Libcore.os.setpgid(pid, pgid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setregid.2.html">setregid(2)</a>. + */ + /** @hide */ public static void setregid(int rgid, int egid) throws ErrnoException { Libcore.os.setregid(rgid, egid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setreuid.2.html">setreuid(2)</a>. + */ + /** @hide */ public static void setreuid(int ruid, int euid) throws ErrnoException { Libcore.os.setreuid(ruid, euid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setsid.2.html">setsid(2)</a>. + */ + public static int setsid() throws ErrnoException { return Libcore.os.setsid(); } + + /** @hide */ public static void setsockoptByte(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptByte(fd, level, option, value); } + /** @hide */ public static void setsockoptIfreq(FileDescriptor fd, int level, int option, String value) throws ErrnoException { Libcore.os.setsockoptIfreq(fd, level, option, value); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setsockopt.2.html">setsockopt(2)</a>. + */ + public static void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptInt(fd, level, option, value); } + + /** @hide */ public static void setsockoptIpMreqn(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptIpMreqn(fd, level, option, value); } + /** @hide */ public static void setsockoptGroupReq(FileDescriptor fd, int level, int option, StructGroupReq value) throws ErrnoException { Libcore.os.setsockoptGroupReq(fd, level, option, value); } + /** @hide */ public static void setsockoptLinger(FileDescriptor fd, int level, int option, StructLinger value) throws ErrnoException { Libcore.os.setsockoptLinger(fd, level, option, value); } + /** @hide */ public static void setsockoptTimeval(FileDescriptor fd, int level, int option, StructTimeval value) throws ErrnoException { Libcore.os.setsockoptTimeval(fd, level, option, value); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setuid.2.html">setuid(2)</a>. + */ + public static void setuid(int uid) throws ErrnoException { Libcore.os.setuid(uid); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/setxattr.2.html">setxattr(2)</a> + */ + public static void setxattr(String path, String name, byte[] value, int flags) throws ErrnoException { Libcore.os.setxattr(path, name, value, flags); }; + + /** + * See <a href="http://man7.org/linux/man-pages/man2/shutdown.2.html">shutdown(2)</a>. + */ + public static void shutdown(FileDescriptor fd, int how) throws ErrnoException { Libcore.os.shutdown(fd, how); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/socket.2.html">socket(2)</a>. + */ + public static FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException { return Libcore.os.socket(domain, type, protocol); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/socketpair.2.html">socketpair(2)</a>. + */ + public static void socketpair(int domain, int type, int protocol, FileDescriptor fd1, FileDescriptor fd2) throws ErrnoException { Libcore.os.socketpair(domain, type, protocol, fd1, fd2); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/stat.2.html">stat(2)</a>. + */ + public static StructStat stat(String path) throws ErrnoException { return Libcore.os.stat(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/statvfs.2.html">statvfs(2)</a>. + */ + public static StructStatVfs statvfs(String path) throws ErrnoException { return Libcore.os.statvfs(path); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/strerror.3.html">strerror(2)</a>. + */ + public static String strerror(int errno) { return Libcore.os.strerror(errno); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/strsignal.3.html">strsignal(3)</a>. + */ + public static String strsignal(int signal) { return Libcore.os.strsignal(signal); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/symlink.2.html">symlink(2)</a>. + */ + public static void symlink(String oldPath, String newPath) throws ErrnoException { Libcore.os.symlink(oldPath, newPath); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/sysconf.3.html">sysconf(3)</a>. + */ + public static long sysconf(int name) { return Libcore.os.sysconf(name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/tcdrain.3.html">tcdrain(3)</a>. + */ + public static void tcdrain(FileDescriptor fd) throws ErrnoException { Libcore.os.tcdrain(fd); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/tcsendbreak.3.html">tcsendbreak(3)</a>. + */ + public static void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException { Libcore.os.tcsendbreak(fd, duration); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/umask.2.html">umask(2)</a>. + */ + public static int umask(int mask) { return Libcore.os.umask(mask); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/uname.2.html">uname(2)</a>. + */ + public static StructUtsname uname() { return Libcore.os.uname(); } + + /** + * @hide See <a href="http://man7.org/linux/man-pages/man2/unlink.2.html">unlink(2)</a>. + */ + public static void unlink(String pathname) throws ErrnoException { Libcore.os.unlink(pathname); } + + /** + * See <a href="http://man7.org/linux/man-pages/man3/unsetenv.3.html">unsetenv(3)</a>. + */ + public static void unsetenv(String name) throws ErrnoException { Libcore.os.unsetenv(name); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/waitpid.2.html">waitpid(2)</a>. + */ + public static int waitpid(int pid, MutableInt status, int options) throws ErrnoException { return Libcore.os.waitpid(pid, status, options); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/write.2.html">write(2)</a>. + */ + public static int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException, InterruptedIOException { return Libcore.os.write(fd, buffer); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/write.2.html">write(2)</a>. + */ + public static int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException, InterruptedIOException { return Libcore.os.write(fd, bytes, byteOffset, byteCount); } + + /** + * See <a href="http://man7.org/linux/man-pages/man2/writev.2.html">writev(2)</a>. + */ + public static int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOException { return Libcore.os.writev(fd, buffers, offsets, byteCounts); } } diff --git a/android/system/StructAddrinfo.java b/android/system/StructAddrinfo.java index 2425946f..dab7590e 100644 --- a/android/system/StructAddrinfo.java +++ b/android/system/StructAddrinfo.java @@ -28,31 +28,31 @@ import libcore.util.Objects; * @hide */ public final class StructAddrinfo { - /** Flags describing the kind of lookup to be done. (Such as AI_ADDRCONFIG.) */ - public int ai_flags; + /** Flags describing the kind of lookup to be done. (Such as AI_ADDRCONFIG.) */ + public int ai_flags; - /** Desired address family for results. (Such as AF_INET6 for IPv6. AF_UNSPEC means "any".) */ - public int ai_family; + /** Desired address family for results. (Such as AF_INET6 for IPv6. AF_UNSPEC means "any".) */ + public int ai_family; - /** Socket type. (Such as SOCK_DGRAM. 0 means "any".) */ - public int ai_socktype; + /** Socket type. (Such as SOCK_DGRAM. 0 means "any".) */ + public int ai_socktype; - /** Protocol. (Such as IPPROTO_IPV6 IPv6. 0 means "any".) */ - public int ai_protocol; + /** Protocol. (Such as IPPROTO_IPV6 IPv6. 0 means "any".) */ + public int ai_protocol; - /** Address length. (Not useful in Java.) */ - // public int ai_addrlen; + /** Address length. (Not useful in Java.) */ + // public int ai_addrlen; - /** Address. */ - public InetAddress ai_addr; + /** Address. */ + public InetAddress ai_addr; - /** Canonical name of service location (if AI_CANONNAME provided in ai_flags). */ - // public String ai_canonname; + /** Canonical name of service location (if AI_CANONNAME provided in ai_flags). */ + // public String ai_canonname; - /** Next element in linked list. */ - public StructAddrinfo ai_next; + /** Next element in linked list. */ + public StructAddrinfo ai_next; - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructCapUserData.java b/android/system/StructCapUserData.java index af63caf7..331e2ead 100644 --- a/android/system/StructCapUserData.java +++ b/android/system/StructCapUserData.java @@ -24,25 +24,25 @@ import libcore.util.Objects; * @hide */ public final class StructCapUserData { - /** Effective capability mask. */ - public final int effective; /* __u32 */ + /** Effective capability mask. */ + public final int effective; /* __u32 */ - /** Permitted capability mask. */ - public final int permitted; /* __u32 */ + /** Permitted capability mask. */ + public final int permitted; /* __u32 */ - /** Inheritable capability mask. */ - public final int inheritable; /* __u32 */ + /** Inheritable capability mask. */ + public final int inheritable; /* __u32 */ - /** - * Constructs an instance with the given field values. - */ - public StructCapUserData(int effective, int permitted, int inheritable) { - this.effective = effective; - this.permitted = permitted; - this.inheritable = inheritable; - } + /** + * Constructs an instance with the given field values. + */ + public StructCapUserData(int effective, int permitted, int inheritable) { + this.effective = effective; + this.permitted = permitted; + this.inheritable = inheritable; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructCapUserHeader.java b/android/system/StructCapUserHeader.java index abbb3954..fb03aa89 100644 --- a/android/system/StructCapUserHeader.java +++ b/android/system/StructCapUserHeader.java @@ -24,25 +24,25 @@ import libcore.util.Objects; * @hide */ public final class StructCapUserHeader { - /** - * Version of the header. Note this is not final as capget() may mutate the field when an - * invalid version is provided. See - * <a href="http://man7.org/linux/man-pages/man2/capget.2.html">capget(2)</a>. - */ - public int version; /* __u32 */ + /** + * Version of the header. Note this is not final as capget() may mutate the field when an + * invalid version is provided. See + * <a href="http://man7.org/linux/man-pages/man2/capget.2.html">capget(2)</a>. + */ + public int version; /* __u32 */ - /** Pid of the header. The pid a call applies to. */ - public final int pid; + /** Pid of the header. The pid a call applies to. */ + public final int pid; - /** - * Constructs an instance with the given field values. - */ - public StructCapUserHeader(int version, int pid) { - this.version = version; - this.pid = pid; - } + /** + * Constructs an instance with the given field values. + */ + public StructCapUserHeader(int version, int pid) { + this.version = version; + this.pid = pid; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructFlock.java b/android/system/StructFlock.java index 92cd95ab..0d934250 100644 --- a/android/system/StructFlock.java +++ b/android/system/StructFlock.java @@ -26,22 +26,22 @@ import libcore.util.Objects; * @hide */ public final class StructFlock { - /** The operation type, one of F_RDLCK, F_WRLCK, or F_UNLCK. */ - public short l_type; + /** The operation type, one of F_RDLCK, F_WRLCK, or F_UNLCK. */ + public short l_type; - /** How to interpret l_start, one of SEEK_CUR, SEEK_END, SEEK_SET. */ - public short l_whence; + /** How to interpret l_start, one of SEEK_CUR, SEEK_END, SEEK_SET. */ + public short l_whence; - /** Start offset. */ - public long l_start; /*off_t*/ + /** Start offset. */ + public long l_start; /*off_t*/ - /** Byte count to operate on. */ - public long l_len; /*off_t*/ + /** Byte count to operate on. */ + public long l_len; /*off_t*/ - /** Process blocking our lock (filled in by F_GETLK, otherwise unused). */ - public int l_pid; /*pid_t*/ + /** Process blocking our lock (filled in by F_GETLK, otherwise unused). */ + public int l_pid; /*pid_t*/ - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructGroupReq.java b/android/system/StructGroupReq.java index 8ed5950b..78db5f53 100644 --- a/android/system/StructGroupReq.java +++ b/android/system/StructGroupReq.java @@ -25,15 +25,15 @@ import libcore.util.Objects; * @hide */ public final class StructGroupReq { - public final int gr_interface; - public final InetAddress gr_group; + public final int gr_interface; + public final InetAddress gr_group; - public StructGroupReq(int gr_interface, InetAddress gr_group) { - this.gr_interface = gr_interface; - this.gr_group = gr_group; - } + public StructGroupReq(int gr_interface, InetAddress gr_group) { + this.gr_interface = gr_interface; + this.gr_group = gr_group; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructLinger.java b/android/system/StructLinger.java index 55ffc5c9..46d41325 100644 --- a/android/system/StructLinger.java +++ b/android/system/StructLinger.java @@ -25,22 +25,22 @@ import libcore.util.Objects; * @hide */ public final class StructLinger { - /** Whether or not linger is enabled. Non-zero is on. */ - public final int l_onoff; + /** Whether or not linger is enabled. Non-zero is on. */ + public final int l_onoff; - /** Linger time in seconds. */ - public final int l_linger; + /** Linger time in seconds. */ + public final int l_linger; - public StructLinger(int l_onoff, int l_linger) { - this.l_onoff = l_onoff; - this.l_linger = l_linger; - } + public StructLinger(int l_onoff, int l_linger) { + this.l_onoff = l_onoff; + this.l_linger = l_linger; + } - public boolean isOn() { - return l_onoff != 0; - } + public boolean isOn() { + return l_onoff != 0; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructPasswd.java b/android/system/StructPasswd.java index 93655c19..633a607d 100644 --- a/android/system/StructPasswd.java +++ b/android/system/StructPasswd.java @@ -25,24 +25,24 @@ import libcore.util.Objects; * @hide */ public final class StructPasswd { - public final String pw_name; - public final int pw_uid; - public final int pw_gid; - public final String pw_dir; - public final String pw_shell; + public final String pw_name; + public final int pw_uid; + public final int pw_gid; + public final String pw_dir; + public final String pw_shell; - /** - * Constructs an instance with the given field values. - */ - public StructPasswd(String pw_name, int pw_uid, int pw_gid, String pw_dir, String pw_shell) { - this.pw_name = pw_name; - this.pw_uid = pw_uid; - this.pw_gid = pw_gid; - this.pw_dir = pw_dir; - this.pw_shell = pw_shell; - } + /** + * Constructs an instance with the given field values. + */ + public StructPasswd(String pw_name, int pw_uid, int pw_gid, String pw_dir, String pw_shell) { + this.pw_name = pw_name; + this.pw_uid = pw_uid; + this.pw_gid = pw_gid; + this.pw_dir = pw_dir; + this.pw_shell = pw_shell; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructPollfd.java b/android/system/StructPollfd.java index 2ca117e9..2f40b8bc 100644 --- a/android/system/StructPollfd.java +++ b/android/system/StructPollfd.java @@ -24,26 +24,26 @@ import libcore.util.Objects; * Corresponds to C's {@code struct pollfd} from {@code <poll.h>}. */ public final class StructPollfd { - /** The file descriptor to poll. */ - public FileDescriptor fd; + /** The file descriptor to poll. */ + public FileDescriptor fd; - /** - * The events we're interested in. POLLIN corresponds to being in select(2)'s read fd set, - * POLLOUT to the write fd set. - */ - public short events; + /** + * The events we're interested in. POLLIN corresponds to being in select(2)'s read fd set, + * POLLOUT to the write fd set. + */ + public short events; - /** The events that actually happened. */ - public short revents; + /** The events that actually happened. */ + public short revents; - /** - * A non-standard extension that lets callers conveniently map back to the object - * their fd belongs to. This is used by Selector, for example, to associate each - * FileDescriptor with the corresponding SelectionKey. - */ - public Object userData; + /** + * A non-standard extension that lets callers conveniently map back to the object + * their fd belongs to. This is used by Selector, for example, to associate each + * FileDescriptor with the corresponding SelectionKey. + */ + public Object userData; - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructRlimit.java b/android/system/StructRlimit.java index 6bb05a9c..007757f4 100644 --- a/android/system/StructRlimit.java +++ b/android/system/StructRlimit.java @@ -25,15 +25,15 @@ import libcore.util.Objects; * @hide */ public final class StructRlimit { - public final long rlim_cur; - public final long rlim_max; + public final long rlim_cur; + public final long rlim_max; - public StructRlimit(long rlim_cur, long rlim_max) { - this.rlim_cur = rlim_cur; - this.rlim_max = rlim_max; - } + public StructRlimit(long rlim_cur, long rlim_max) { + this.rlim_cur = rlim_cur; + this.rlim_max = rlim_max; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructStat.java b/android/system/StructStat.java index a1e87296..a8b1fca4 100644 --- a/android/system/StructStat.java +++ b/android/system/StructStat.java @@ -23,99 +23,99 @@ import libcore.util.Objects; * Corresponds to C's {@code struct stat} from {@code <stat.h>}. */ public final class StructStat { - /** Device ID of device containing file. */ - public final long st_dev; /*dev_t*/ - - /** File serial number (inode). */ - public final long st_ino; /*ino_t*/ - - /** Mode (permissions) of file. */ - public final int st_mode; /*mode_t*/ - - /** Number of hard links to the file. */ - public final long st_nlink; /*nlink_t*/ - - /** User ID of file. */ - public final int st_uid; /*uid_t*/ - - /** Group ID of file. */ - public final int st_gid; /*gid_t*/ - - /** Device ID (if file is character or block special). */ - public final long st_rdev; /*dev_t*/ - - /** - * For regular files, the file size in bytes. - * For symbolic links, the length in bytes of the pathname contained in the symbolic link. - * For a shared memory object, the length in bytes. - * For a typed memory object, the length in bytes. - * For other file types, the use of this field is unspecified. - */ - public final long st_size; /*off_t*/ - - /** Seconds part of time of last access. */ - public final long st_atime; /*time_t*/ - - /** StructTimespec with time of last access. */ - public final StructTimespec st_atim; - - /** Seconds part of time of last data modification. */ - public final long st_mtime; /*time_t*/ - - /** StructTimespec with time of last modification. */ - public final StructTimespec st_mtim; - - /** Seconds part of time of last status change */ - public final long st_ctime; /*time_t*/ - - /** StructTimespec with time of last status change. */ - public final StructTimespec st_ctim; - - /** - * A file system-specific preferred I/O block size for this object. - * For some file system types, this may vary from file to file. - */ - public final long st_blksize; /*blksize_t*/ - - /** Number of blocks allocated for this object. */ - public final long st_blocks; /*blkcnt_t*/ - - /** - * Constructs an instance with the given field values. - */ - public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, - long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime, - long st_blksize, long st_blocks) { - this(st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, - st_rdev, st_size, new StructTimespec(st_atime, 0L), new StructTimespec(st_mtime, 0L), - new StructTimespec(st_ctime, 0L), st_blksize, st_blocks); - } - - /** - * Constructs an instance with the given field values. - */ - public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, - long st_rdev, long st_size, StructTimespec st_atim, StructTimespec st_mtim, - StructTimespec st_ctim, long st_blksize, long st_blocks) { - this.st_dev = st_dev; - this.st_ino = st_ino; - this.st_mode = st_mode; - this.st_nlink = st_nlink; - this.st_uid = st_uid; - this.st_gid = st_gid; - this.st_rdev = st_rdev; - this.st_size = st_size; - this.st_atime = st_atim.tv_sec; - this.st_mtime = st_mtim.tv_sec; - this.st_ctime = st_ctim.tv_sec; - this.st_atim = st_atim; - this.st_mtim = st_mtim; - this.st_ctim = st_ctim; - this.st_blksize = st_blksize; - this.st_blocks = st_blocks; - } - - @Override public String toString() { - return Objects.toString(this); - } + /** Device ID of device containing file. */ + public final long st_dev; /*dev_t*/ + + /** File serial number (inode). */ + public final long st_ino; /*ino_t*/ + + /** Mode (permissions) of file. */ + public final int st_mode; /*mode_t*/ + + /** Number of hard links to the file. */ + public final long st_nlink; /*nlink_t*/ + + /** User ID of file. */ + public final int st_uid; /*uid_t*/ + + /** Group ID of file. */ + public final int st_gid; /*gid_t*/ + + /** Device ID (if file is character or block special). */ + public final long st_rdev; /*dev_t*/ + + /** + * For regular files, the file size in bytes. + * For symbolic links, the length in bytes of the pathname contained in the symbolic link. + * For a shared memory object, the length in bytes. + * For a typed memory object, the length in bytes. + * For other file types, the use of this field is unspecified. + */ + public final long st_size; /*off_t*/ + + /** Seconds part of time of last access. */ + public final long st_atime; /*time_t*/ + + /** StructTimespec with time of last access. */ + public final StructTimespec st_atim; + + /** Seconds part of time of last data modification. */ + public final long st_mtime; /*time_t*/ + + /** StructTimespec with time of last modification. */ + public final StructTimespec st_mtim; + + /** Seconds part of time of last status change */ + public final long st_ctime; /*time_t*/ + + /** StructTimespec with time of last status change. */ + public final StructTimespec st_ctim; + + /** + * A file system-specific preferred I/O block size for this object. + * For some file system types, this may vary from file to file. + */ + public final long st_blksize; /*blksize_t*/ + + /** Number of blocks allocated for this object. */ + public final long st_blocks; /*blkcnt_t*/ + + /** + * Constructs an instance with the given field values. + */ + public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, + long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime, + long st_blksize, long st_blocks) { + this(st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, + st_rdev, st_size, new StructTimespec(st_atime, 0L), new StructTimespec(st_mtime, 0L), + new StructTimespec(st_ctime, 0L), st_blksize, st_blocks); + } + + /** + * Constructs an instance with the given field values. + */ + public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, + long st_rdev, long st_size, StructTimespec st_atim, StructTimespec st_mtim, + StructTimespec st_ctim, long st_blksize, long st_blocks) { + this.st_dev = st_dev; + this.st_ino = st_ino; + this.st_mode = st_mode; + this.st_nlink = st_nlink; + this.st_uid = st_uid; + this.st_gid = st_gid; + this.st_rdev = st_rdev; + this.st_size = st_size; + this.st_atime = st_atim.tv_sec; + this.st_mtime = st_mtim.tv_sec; + this.st_ctime = st_ctim.tv_sec; + this.st_atim = st_atim; + this.st_mtim = st_mtim; + this.st_ctim = st_ctim; + this.st_blksize = st_blksize; + this.st_blocks = st_blocks; + } + + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructStatVfs.java b/android/system/StructStatVfs.java index 942a39a8..3b192e7c 100644 --- a/android/system/StructStatVfs.java +++ b/android/system/StructStatVfs.java @@ -22,59 +22,59 @@ import libcore.util.Objects; * File information returned by {@link Os#fstatvfs} and {@link Os#statvfs}. */ public final class StructStatVfs { - /** File system block size (used for block counts). */ - public final long f_bsize; /*unsigned long*/ + /** File system block size (used for block counts). */ + public final long f_bsize; /*unsigned long*/ - /** Fundamental file system block size. */ - public final long f_frsize; /*unsigned long*/ + /** Fundamental file system block size. */ + public final long f_frsize; /*unsigned long*/ - /** Total block count. */ - public final long f_blocks; /*fsblkcnt_t*/ + /** Total block count. */ + public final long f_blocks; /*fsblkcnt_t*/ - /** Free block count. */ - public final long f_bfree; /*fsblkcnt_t*/ + /** Free block count. */ + public final long f_bfree; /*fsblkcnt_t*/ - /** Free block count available to non-root. */ - public final long f_bavail; /*fsblkcnt_t*/ + /** Free block count available to non-root. */ + public final long f_bavail; /*fsblkcnt_t*/ - /** Total file (inode) count. */ - public final long f_files; /*fsfilcnt_t*/ + /** Total file (inode) count. */ + public final long f_files; /*fsfilcnt_t*/ - /** Free file (inode) count. */ - public final long f_ffree; /*fsfilcnt_t*/ + /** Free file (inode) count. */ + public final long f_ffree; /*fsfilcnt_t*/ - /** Free file (inode) count available to non-root. */ - public final long f_favail; /*fsfilcnt_t*/ + /** Free file (inode) count available to non-root. */ + public final long f_favail; /*fsfilcnt_t*/ - /** File system id. */ - public final long f_fsid; /*unsigned long*/ + /** File system id. */ + public final long f_fsid; /*unsigned long*/ - /** Bit mask of ST_* flags. */ - public final long f_flag; /*unsigned long*/ + /** Bit mask of ST_* flags. */ + public final long f_flag; /*unsigned long*/ - /** Maximum filename length. */ - public final long f_namemax; /*unsigned long*/ + /** Maximum filename length. */ + public final long f_namemax; /*unsigned long*/ - /** - * Constructs an instance with the given field values. - */ - public StructStatVfs(long f_bsize, long f_frsize, long f_blocks, long f_bfree, long f_bavail, - long f_files, long f_ffree, long f_favail, - long f_fsid, long f_flag, long f_namemax) { - this.f_bsize = f_bsize; - this.f_frsize = f_frsize; - this.f_blocks = f_blocks; - this.f_bfree = f_bfree; - this.f_bavail = f_bavail; - this.f_files = f_files; - this.f_ffree = f_ffree; - this.f_favail = f_favail; - this.f_fsid = f_fsid; - this.f_flag = f_flag; - this.f_namemax = f_namemax; - } + /** + * Constructs an instance with the given field values. + */ + public StructStatVfs(long f_bsize, long f_frsize, long f_blocks, long f_bfree, long f_bavail, + long f_files, long f_ffree, long f_favail, + long f_fsid, long f_flag, long f_namemax) { + this.f_bsize = f_bsize; + this.f_frsize = f_frsize; + this.f_blocks = f_blocks; + this.f_bfree = f_bfree; + this.f_bavail = f_bavail; + this.f_files = f_files; + this.f_ffree = f_ffree; + this.f_favail = f_favail; + this.f_fsid = f_fsid; + this.f_flag = f_flag; + this.f_namemax = f_namemax; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructTimespec.java b/android/system/StructTimespec.java index b5e192e5..c1067805 100644 --- a/android/system/StructTimespec.java +++ b/android/system/StructTimespec.java @@ -22,58 +22,58 @@ import libcore.util.Objects;; * Corresponds to C's {@code struct timespec} from {@code <time.h>}. */ public final class StructTimespec implements Comparable<StructTimespec> { - /** Seconds part of time of last data modification. */ - public final long tv_sec; /*time_t*/ + /** Seconds part of time of last data modification. */ + public final long tv_sec; /*time_t*/ - /** Nanoseconds (values are [0, 999999999]). */ - public final long tv_nsec; + /** Nanoseconds (values are [0, 999999999]). */ + public final long tv_nsec; - public StructTimespec(long tv_sec, long tv_nsec) { - this.tv_sec = tv_sec; - this.tv_nsec = tv_nsec; - if (tv_nsec < 0 || tv_nsec > 999_999_999) { - throw new IllegalArgumentException( - "tv_nsec value " + tv_nsec + " is not in [0, 999999999]"); - } - } + public StructTimespec(long tv_sec, long tv_nsec) { + this.tv_sec = tv_sec; + this.tv_nsec = tv_nsec; + if (tv_nsec < 0 || tv_nsec > 999_999_999) { + throw new IllegalArgumentException( + "tv_nsec value " + tv_nsec + " is not in [0, 999999999]"); + } + } - @Override - public int compareTo(StructTimespec other) { - if (tv_sec > other.tv_sec) { - return 1; - } - if (tv_sec < other.tv_sec) { - return -1; - } - if (tv_nsec > other.tv_nsec) { - return 1; - } - if (tv_nsec < other.tv_nsec) { - return -1; - } - return 0; - } + @Override + public int compareTo(StructTimespec other) { + if (tv_sec > other.tv_sec) { + return 1; + } + if (tv_sec < other.tv_sec) { + return -1; + } + if (tv_nsec > other.tv_nsec) { + return 1; + } + if (tv_nsec < other.tv_nsec) { + return -1; + } + return 0; + } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; - StructTimespec that = (StructTimespec) o; + StructTimespec that = (StructTimespec) o; - if (tv_sec != that.tv_sec) return false; - return tv_nsec == that.tv_nsec; - } + if (tv_sec != that.tv_sec) return false; + return tv_nsec == that.tv_nsec; + } - @Override - public int hashCode() { - int result = (int) (tv_sec ^ (tv_sec >>> 32)); - result = 31 * result + (int) (tv_nsec ^ (tv_nsec >>> 32)); - return result; - } + @Override + public int hashCode() { + int result = (int) (tv_sec ^ (tv_sec >>> 32)); + result = 31 * result + (int) (tv_nsec ^ (tv_nsec >>> 32)); + return result; + } - @Override - public String toString() { - return Objects.toString(this); - } + @Override + public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructTimeval.java b/android/system/StructTimeval.java index 8a155b4f..91a6f2ae 100644 --- a/android/system/StructTimeval.java +++ b/android/system/StructTimeval.java @@ -25,28 +25,28 @@ import libcore.util.Objects; * @hide */ public final class StructTimeval { - /** Seconds. */ - public final long tv_sec; - - /** Microseconds. */ - public final long tv_usec; - - private StructTimeval(long tv_sec, long tv_usec) { - this.tv_sec = tv_sec; - this.tv_usec = tv_usec; - } - - public static StructTimeval fromMillis(long millis) { - long tv_sec = millis / 1000; - long tv_usec = (millis - (tv_sec * 1000)) * 1000; - return new StructTimeval(tv_sec, tv_usec); - } - - public long toMillis() { - return (tv_sec * 1000) + (tv_usec / 1000); - } - - @Override public String toString() { - return Objects.toString(this); - } + /** Seconds. */ + public final long tv_sec; + + /** Microseconds. */ + public final long tv_usec; + + private StructTimeval(long tv_sec, long tv_usec) { + this.tv_sec = tv_sec; + this.tv_usec = tv_usec; + } + + public static StructTimeval fromMillis(long millis) { + long tv_sec = millis / 1000; + long tv_usec = (millis - (tv_sec * 1000)) * 1000; + return new StructTimeval(tv_sec, tv_usec); + } + + public long toMillis() { + return (tv_sec * 1000) + (tv_usec / 1000); + } + + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructUcred.java b/android/system/StructUcred.java index a1e3cd6e..e6e1479d 100644 --- a/android/system/StructUcred.java +++ b/android/system/StructUcred.java @@ -24,22 +24,22 @@ import libcore.util.Objects; * @hide */ public final class StructUcred { - /** The peer's process id. */ - public final int pid; + /** The peer's process id. */ + public final int pid; - /** The peer process' uid. */ - public final int uid; + /** The peer process' uid. */ + public final int uid; - /** The peer process' gid. */ - public final int gid; + /** The peer process' gid. */ + public final int gid; - public StructUcred(int pid, int uid, int gid) { - this.pid = pid; - this.uid = uid; - this.gid = gid; - } + public StructUcred(int pid, int uid, int gid) { + this.pid = pid; + this.uid = uid; + this.gid = gid; + } - @Override public String toString() { - return Objects.toString(this); - } + @Override public String toString() { + return Objects.toString(this); + } } diff --git a/android/system/StructUtsname.java b/android/system/StructUtsname.java index 37778380..9cfe21b0 100644 --- a/android/system/StructUtsname.java +++ b/android/system/StructUtsname.java @@ -23,33 +23,33 @@ import libcore.util.Objects; * Corresponds to C's {@code struct utsname} from {@code <sys/utsname.h>}. */ public final class StructUtsname { - /** The OS name, such as "Linux". */ - public final String sysname; - - /** The machine's unqualified name on some implementation-defined network. */ - public final String nodename; - - /** The OS release, such as "2.6.35-27-generic". */ - public final String release; - - /** The OS version, such as "#48-Ubuntu SMP Tue Feb 22 20:25:29 UTC 2011". */ - public final String version; - - /** The machine architecture, such as "armv7l" or "x86_64". */ - public final String machine; - - /** - * Constructs an instance with the given field values. - */ - public StructUtsname(String sysname, String nodename, String release, String version, String machine) { - this.sysname = sysname; - this.nodename = nodename; - this.release = release; - this.version = version; - this.machine = machine; - } - - @Override public String toString() { - return Objects.toString(this); - } + /** The OS name, such as "Linux". */ + public final String sysname; + + /** The machine's unqualified name on some implementation-defined network. */ + public final String nodename; + + /** The OS release, such as "2.6.35-27-generic". */ + public final String release; + + /** The OS version, such as "#48-Ubuntu SMP Tue Feb 22 20:25:29 UTC 2011". */ + public final String version; + + /** The machine architecture, such as "armv7l" or "x86_64". */ + public final String machine; + + /** + * Constructs an instance with the given field values. + */ + public StructUtsname(String sysname, String nodename, String release, String version, String machine) { + this.sysname = sysname; + this.nodename = nodename; + this.release = release; + this.version = version; + this.machine = machine; + } + + @Override public String toString() { + return Objects.toString(this); + } } |