blob: 4ecf986bc374420ffbb6da32cc0914d6cb3da305 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
Elliott Hughesff26a162017-08-17 22:34:21 +000028
Elliott Hughesdd6763a2018-10-04 16:35:13 -070029#pragma once
30
31/**
32 * @file sys/sysinfo.h
33 * @brief System information.
34 */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035
36#include <sys/cdefs.h>
37#include <linux/kernel.h>
38
39__BEGIN_DECLS
40
Elliott Hughesdd6763a2018-10-04 16:35:13 -070041/**
42 * [sysinfo(2)](http://man7.org/linux/man-pages/man2/sysinfo.2.html) queries system information.
43 *
44 * Returns 0 on success, and returns -1 and sets `errno` on failure.
45 */
Elliott Hughesff26a162017-08-17 22:34:21 +000046int sysinfo(struct sysinfo* __info);
Elliott Hughesdd6763a2018-10-04 16:35:13 -070047
48/**
49 * [get_nprocs_conf(3)](http://man7.org/linux/man-pages/man3/get_nprocs_conf.3.html) returns
50 * the total number of processors in the system.
51 *
52 * Available since API level 23.
53 *
54 * See also sysconf().
55 */
Josh Gao14adff12016-04-29 12:00:55 -070056int get_nprocs_conf(void) __INTRODUCED_IN(23);
Elliott Hughesdd6763a2018-10-04 16:35:13 -070057
58/**
59 * [get_nprocs(3)](http://man7.org/linux/man-pages/man3/get_nprocs.3.html) returns
60 * the number of processors in the system that are currently on-line.
61 *
62 * Available since API level 23.
63 *
64 * See also sysconf().
65 */
Josh Gao14adff12016-04-29 12:00:55 -070066int get_nprocs(void) __INTRODUCED_IN(23);
Elliott Hughesdd6763a2018-10-04 16:35:13 -070067
68/**
69 * [get_phys_pages(3)](http://man7.org/linux/man-pages/man3/get_phys_pages.3.html) returns
70 * the total number of physical pages in the system.
71 *
72 * Available since API level 23.
73 *
74 * See also sysconf().
75 */
Josh Gao14adff12016-04-29 12:00:55 -070076long get_phys_pages(void) __INTRODUCED_IN(23);
Elliott Hughesdd6763a2018-10-04 16:35:13 -070077
78/**
79 * [get_avphys_pages(3)](http://man7.org/linux/man-pages/man3/get_avphys_pages.3.html) returns
80 * the number of physical pages in the system that are currently available.
81 *
82 * Available since API level 23.
83 *
84 * See also sysconf().
85 */
Josh Gao14adff12016-04-29 12:00:55 -070086long get_avphys_pages(void) __INTRODUCED_IN(23);
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080087
88__END_DECLS