Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From 870bf32e9591f26ed6f7012be683837cd70346b1 Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Thu, 4 Mar 2021 21:58:32 +0000
>Subject: [PATCH] init.c: Define "feature_test_macros" for "sbrk(2)",
> "popen(2)", and "pclose(2)"

  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 <bjarn...@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>
-- 
2.30.1



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.9-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to