public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0
@ 2019-09-10 23:13 Joel Sherrill
  0 siblings, 0 replies; only message in thread
From: Joel Sherrill @ 2019-09-10 23:13 UTC (permalink / raw)
  To: newlib; +Cc: Joel Sherrill

	The FACE Technical Standard, Edition 3.0 and later require the
	definition of the subcommand SOCKCLOSE in <devctl.h>.
	Reference: https://www.opengroup.org/face
---
 newlib/libc/include/devctl.h | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/newlib/libc/include/devctl.h b/newlib/libc/include/devctl.h
index f6055fb..fd3409f 100644
--- a/newlib/libc/include/devctl.h
+++ b/newlib/libc/include/devctl.h
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2016 Joel Sherrill <joel@rtems.org>.  All rights reserved.
+ * Copyright (c) 2016,2019 Joel Sherrill <joel@rtems.org>.
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +28,28 @@
 #define _POSIX_DEVCTL_h_
 
 /*
+ * Nothing in this file should be visible unless _POSIX_26_C_SOURCE is
+ * defined.
+ */
+#ifdef _POSIX_26_C_SOURCE
+
+#include <sys/cdefs.h>
+
+#if defined(__rtems__)
+/*
+ * The FACE Technical Standard, Edition 3.0 and later require the
+ * definition of the subcommand SOCKCLOSE in <devctl.h>.
+ *
+ * Reference: https://www.opengroup.org/face
+ *
+ * Using 'D' should avoid the letters used by other users of <sys/ioccom.h>
+ */
+#include <sys/ioccom.h>
+
+#define SOCKCLOSE    _IO('D', 1)    /* socket close */
+#endif
+
+/*
  * The posix_devctl() method is defined by POSIX 1003.26-2003. Aside
  * from the single method, it adds the following requirements:
  *
@@ -35,10 +58,6 @@
  *   + application must define _POSIX_26_C_SOURCE to use posix_devctl().
  *   + posix_devctl() is prototyped in <devctl.h>
  */
-
-#ifdef _POSIX_26_C_SOURCE
-#include <sys/cdefs.h>
-
 int posix_devctl(
   int              fd,
   int              dcmd,
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-10 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 23:13 [PATCH] libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0 Joel Sherrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).