| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* | 
 | 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 Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 28 |  | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 29 | #pragma once | 
 | 30 |  | 
 | 31 | /** | 
 | 32 |  * @file sys/sysinfo.h | 
 | 33 |  * @brief System information. | 
 | 34 |  */ | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 35 |  | 
 | 36 | #include <sys/cdefs.h> | 
 | 37 | #include <linux/kernel.h> | 
 | 38 |  | 
 | 39 | __BEGIN_DECLS | 
 | 40 |  | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 41 | /** | 
 | 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 |  */ | 
| zijunzhao | 4b8a126 | 2023-02-03 18:43:39 +0000 | [diff] [blame] | 46 | int sysinfo(struct sysinfo* _Nonnull __info); | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 47 |  | 
 | 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 Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 56 | int get_nprocs_conf(void) __INTRODUCED_IN(23); | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 57 |  | 
 | 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 Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 66 | int get_nprocs(void) __INTRODUCED_IN(23); | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 67 |  | 
 | 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 Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 76 | long get_phys_pages(void) __INTRODUCED_IN(23); | 
| Elliott Hughes | dd6763a | 2018-10-04 16:35:13 -0700 | [diff] [blame] | 77 |  | 
 | 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 Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 86 | long get_avphys_pages(void) __INTRODUCED_IN(23); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 87 |  | 
 | 88 | __END_DECLS |