public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Joel Sherrill <joel@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0
Date: Fri, 13 Sep 2019 12:52:00 -0000	[thread overview]
Message-ID: <20190913125244.84968.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9786b0559565616b1b35282157d9f42f239ed656

commit 9786b0559565616b1b35282157d9f42f239ed656
Author: Joel Sherrill <joel@rtems.org>
Date:   Tue Sep 10 10:49:11 2019 -0500

    libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0
    
    	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

Diff:
---
 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,


                 reply	other threads:[~2019-09-13 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190913125244.84968.qmail@sourceware.org \
    --to=joel@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).