#984553 init.c: Define "feature_test_macros" for "sbrk(2)", "popen(2)", and "pclose(2)"

Package:
src:nn
Source:
nn
Submitter:
Bjarni Ingi Gislason
Date:
2021-03-04 22:09:12 UTC
Severity:
normal
Tags:
#984553#5
Date:
2021-03-04 22:07:49 UTC
From:
To:
Dear Maintainer,

  Define "_DEFAULT_SOURCE" for the declaration of "sbrk(2)",
if not defined.

  Define "_POSIX_C_SOURCE" for the declaration of "popen(2)" and
"pclose(2)".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 init.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/init.c b/init.c
index dd722bb..33a755d 100644
--- a/init.c
+++ b/init.c
@@ -5,6 +5,14 @@
  *	.nn/init file handling
  */

+/* For sbrk(2) */
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE 1
+#endif
+
+/* For popen(2) and pclose(2) */
+#define _POSIX_C_SOURCE 200809L
+
 #include <unistd.h>
 #include <stdint.h> /* For type intptr_t */
 #include <stdlib.h>