2021-08-12 07:42:14 +00:00
|
|
|
#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/calls/calls.h"
|
|
|
|
#include "libc/fmt/itoa.h"
|
|
|
|
#include "libc/runtime/sysconf.h"
|
|
|
|
#include "libc/stdio/stdio.h"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
int c, n;
|
2022-04-23 01:55:28 +00:00
|
|
|
char a[22], *p;
|
2021-08-12 07:42:14 +00:00
|
|
|
if ((c = GetCpuCount())) {
|
2022-04-23 01:55:28 +00:00
|
|
|
p = FormatInt64(a, c);
|
|
|
|
*p++ = '\n';
|
|
|
|
return write(1, a, p - a) == p - a ? 0 : 1;
|
2021-08-12 07:42:14 +00:00
|
|
|
} else {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|