commit 30bc6754a50243fd293a57d3563aa42a7aef3aff
parent d832f81d973441bceb09b50e977151815cc8abae
Author: qorg11 <qorg@vxempire.xyz>
Date: Sat, 8 Aug 2020 21:45:46 +0200
added a bunch of programs
Diffstat:
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/hostid.c b/src/hostid.c
@@ -0,0 +1,11 @@
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ long id = gethostid();
+ printf("%lx\n",id);
+
+ return 0;
+}
diff --git a/src/hostname.c b/src/hostname.c
@@ -0,0 +1,11 @@
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ char buf[64];
+ gethostname(buf,64);
+ puts(buf);
+ return 0;
+}
diff --git a/src/nproc.c b/src/nproc.c
@@ -0,0 +1,10 @@
+#include <sys/sysinfo.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ int cores = get_nprocs_conf();
+ printf("%i\n",cores);
+ return 0;
+}