blob: 2b7937cd7aca6f4ceb51ad55e6786e0c96252422 [file] [log] [blame]
Elliott Hughes7341b9e2011-03-24 13:51:38 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Elliott Hughes5d930ca2014-04-23 17:53:37 -070017package android.system;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070018
Elliott Hughesfe77f812014-04-29 17:59:30 -070019import libcore.util.Objects;
20
Elliott Hughes7341b9e2011-03-24 13:51:38 -070021/**
22 * Information returned by uname(2). Corresponds to C's
Elliott Hughes1c039d72011-05-04 16:04:04 -070023 * {@code struct utsname} from
Elliott Hughes7341b9e2011-03-24 13:51:38 -070024 * <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_utsname.h.html">&lt;sys/utsname.h&gt;</a>
Elliott Hughes5d930ca2014-04-23 17:53:37 -070025 *
26 * @hide
Elliott Hughes7341b9e2011-03-24 13:51:38 -070027 */
28public final class StructUtsname {
Elliott Hughesfe77f812014-04-29 17:59:30 -070029 /** The OS name, such as "Linux". */
30 public final String sysname;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070031
Elliott Hughesfe77f812014-04-29 17:59:30 -070032 /** The machine's unqualified name on some implementation-defined network. */
33 public final String nodename;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070034
Elliott Hughesfe77f812014-04-29 17:59:30 -070035 /** The OS release, such as "2.6.35-27-generic". */
36 public final String release;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070037
Elliott Hughesfe77f812014-04-29 17:59:30 -070038 /** The OS version, such as "#48-Ubuntu SMP Tue Feb 22 20:25:29 UTC 2011". */
39 public final String version;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070040
Elliott Hughesfe77f812014-04-29 17:59:30 -070041 /** The machine architecture, such as "armv7l" or "x86_64". */
42 public final String machine;
Elliott Hughes7341b9e2011-03-24 13:51:38 -070043
Elliott Hughesfe77f812014-04-29 17:59:30 -070044 public StructUtsname(String sysname, String nodename, String release, String version, String machine) {
45 this.sysname = sysname;
46 this.nodename = nodename;
47 this.release = release;
48 this.version = version;
49 this.machine = machine;
50 }
51
52 @Override public String toString() {
53 return Objects.toString(this);
54 }
Elliott Hughes7341b9e2011-03-24 13:51:38 -070055}