summaryrefslogtreecommitdiffstats
path: root/src/bfstd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bfstd.c')
-rw-r--r--src/bfstd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index 219b8d0..aee6930 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -775,6 +775,16 @@ long xsysconf(int name) {
return ret;
}
+long nproc(void) {
+ long nproc = xsysconf(_SC_NPROCESSORS_ONLN);
+
+ if (nproc < 1) {
+ return 1;
+ } else {
+ return nproc;
+ }
+}
+
size_t asciilen(const char *str) {
return asciinlen(str, strlen(str));
}