Si prosegue con le modifiche per l'inclusione degli esempi di codice.
[gapil.git] / listati / get_child_max.c
diff --git a/listati/get_child_max.c b/listati/get_child_max.c
new file mode 100644 (file)
index 0000000..9890abf
--- /dev/null
@@ -0,0 +1,12 @@
+get_child_max(void)
+{
+#ifdef CHILD_MAX
+    return CHILD_MAX;
+#else
+    int val = sysconf(_SC_CHILD_MAX);
+    if (val < 0) {
+        perror("fatal error");
+        exit(-1);
+    }
+    return val;
+}