[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 01/03: system: Define 'O_CLOEXEC' on Guile 2.2.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 01/03: system: Define 'O_CLOEXEC' on Guile 2.2. |
Date: |
Fri, 9 Sep 2022 11:48:02 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit ecdb172f0022d564d6902a816abe5ecc04a99279
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Sep 9 10:34:12 2022 +0200
system: Define 'O_CLOEXEC' on Guile 2.2.
* configure.ac: Check the value of O_CLOEXEC and substitute it.
* modules/shepherd/system.scm.in (O_CLOEXEC): New variable.
---
configure.ac | 6 ++++++
modules/shepherd/system.scm.in | 3 +++
2 files changed, 9 insertions(+)
diff --git a/configure.ac b/configure.ac
index cb9c9f1..b4c2684 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,12 @@ AC_COMPUTE_INT([_SC_OPEN_MAX], [_SC_OPEN_MAX], [#include
<unistd.h>])
AC_MSG_RESULT([$_SC_OPEN_MAX])
AC_SUBST([_SC_OPEN_MAX])
+dnl Guile 2.2.7 lacks a definition for O_CLOEXEC.
+AC_MSG_CHECKING([the 'O_CLOEXEC' value])
+AC_COMPUTE_INT([O_CLOEXEC], [O_CLOEXEC], [#include <fcntl.h>])
+AC_MSG_RESULT([$O_CLOEXEC])
+AC_SUBST([O_CLOEXEC])
+
AC_MSG_CHECKING([<sys/reboot.h> constants])
AC_COMPUTE_INT([RB_AUTOBOOT], [RB_AUTOBOOT], [#include <sys/reboot.h>])
case "$host_os" in
diff --git a/modules/shepherd/system.scm.in b/modules/shepherd/system.scm.in
index 48ca9db..29357aa 100644
--- a/modules/shepherd/system.scm.in
+++ b/modules/shepherd/system.scm.in
@@ -166,6 +166,9 @@ only (by default, Linux binds AF_INET6 addresses on IPv4 as
well)."
(module-define! (current-module) 'variable value)
(module-export! (current-module) '(variable)))))))
+;; Guile 2.2.7 lacks a definition for O_CLOEXEC.
+(define-as-needed O_CLOEXEC @O_CLOEXEC@)
+
(define-as-needed pipe2
;; Use 'define-as-needed' in case Guile > 3.0.8 comes with a same-named
;; binding.