[2/5] lapi: Add utsname.h
diff mbox series

Message ID 20190707190016.27296-3-petr.vorel@gmail.com
State Accepted
Delegated to: Petr Vorel
Headers show
Series
  • setdomainname() converted to new API
Related show

Commit Message

Petr Vorel July 7, 2019, 7 p.m. UTC
Non-standard _UTSNAME_DOMAIN_LENGTH and _UTSNAME_LENGTH constants aren't
defined for MUSL and Bionic.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 configure.ac           |  1 +
 include/lapi/utsname.h | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 include/lapi/utsname.h

Comments

Petr Vorel July 17, 2019, 4:50 p.m. UTC | #1
Hi,

> Non-standard _UTSNAME_DOMAIN_LENGTH and _UTSNAME_LENGTH constants aren't
> defined for MUSL and Bionic.

merged the rest of the patchset.

Kind regards,
Petr

Patch
diff mbox series

diff --git a/configure.ac b/configure.ac
index f78db90ce..97991e85f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,7 @@  AC_CHECK_HEADERS([ \
     sys/prctl.h \
     sys/shm.h \
     sys/ustat.h \
+    sys/utsname.h \
     sys/xattr.h \
 ])
 
diff --git a/include/lapi/utsname.h b/include/lapi/utsname.h
new file mode 100644
index 000000000..6209eac47
--- /dev/null
+++ b/include/lapi/utsname.h
@@ -0,0 +1,16 @@ 
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 Petr Vorel <petr.vorel@gmail.com>
+ */
+
+#ifdef HAVE_SYS_UTSNAME_H
+# include <sys/utsname.h>
+#endif
+
+#ifndef _UTSNAME_LENGTH
+# define _UTSNAME_LENGTH 65
+#endif
+
+#ifndef _UTSNAME_DOMAIN_LENGTH
+# define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
+#endif