nproc add

This commit is contained in:
Your Name 2023-12-20 22:14:55 +03:00
parent cc03a9f1f6
commit 79ccb4ca4d
3 changed files with 14 additions and 0 deletions

View File

@ -1,2 +1,3 @@
#Example
#[SRC] [DST] [FS TYPE] [OPTIONS]
/dev/sda1 /boot ext4 rw

2
src/coreutils/nproc/build.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
echo ./*.c $CFLAGS $OUTPUT | xargs $CC

View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include <unistd.h>
int main(void) {
long count = sysconf(_SC_NPROCESSORS_ONLN);
if (count <= 0)
count = 1;
printf("%ld\n", count);
return 0;
}