mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Fix small matters and improve sysconf()
- Fix mkdeps.com out of memory error - Remove static memory from __get_cpu_count() - Add support for passing hyphen to cat in cocmd - Change more ZipOS errors from ENOTSUP to EROFS - Specify mem_unit in sysinfo() output on BSD OSes
This commit is contained in:
parent
eebc24b9cd
commit
3a9cac4892
55 changed files with 411 additions and 262 deletions
25
examples/sysconf.c
Normal file
25
examples/sysconf.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
#if 0
|
||||
/*─────────────────────────────────────────────────────────────────╗
|
||||
│ To the extent possible under law, Justine Tunney has waived │
|
||||
│ all copyright and related or neighboring rights to this file, │
|
||||
│ as it is written in the following disclaimers: │
|
||||
│ • http://unlicense.org/ │
|
||||
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
||||
╚─────────────────────────────────────────────────────────────────*/
|
||||
#endif
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
#define SYSCONF(NAME) printf("%s %,ld\n", #NAME, sysconf(NAME))
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
SYSCONF(_SC_CLK_TCK);
|
||||
SYSCONF(_SC_PAGESIZE);
|
||||
SYSCONF(_SC_ARG_MAX);
|
||||
SYSCONF(_SC_CHILD_MAX);
|
||||
SYSCONF(_SC_OPEN_MAX);
|
||||
SYSCONF(_SC_NPROCESSORS_CONF);
|
||||
SYSCONF(_SC_NPROCESSORS_ONLN);
|
||||
SYSCONF(_SC_PHYS_PAGES);
|
||||
SYSCONF(_SC_AVPHYS_PAGES);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue