This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Cygwin: Introduce FH_SOCKET for generic socket file ops
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 23 Feb 2018 20:02:11 -0000
- Subject: [newlib-cygwin] Cygwin: Introduce FH_SOCKET for generic socket file ops
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=eaf359574d7005cbebdc6603d77c850519265a56
commit eaf359574d7005cbebdc6603d77c850519265a56
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Fri Feb 23 19:45:59 2018 +0100
Cygwin: Introduce FH_SOCKET for generic socket file ops
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/devices.cc | 3 +++
winsup/cygwin/devices.h | 7 +++++--
winsup/cygwin/devices.in | 3 +++
winsup/cygwin/path.cc | 2 +-
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index 2b65108..8ba199d 100644
--- a/winsup/cygwin/devices.cc
+++ b/winsup/cygwin/devices.cc
@@ -120,6 +120,9 @@ const _device dev_piper_storage =
const _device dev_pipew_storage =
{"", {FH_PIPEW}, "", exists_internal};
+const _device dev_socket_storage =
+ {"", {FH_SOCKET}, "", exists_internal};
+
const _device dev_af_inet_storage =
{"", {FH_INET}, "", exists_internal};
diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h
index 9924bad..87e0330 100644
--- a/winsup/cygwin/devices.h
+++ b/winsup/cygwin/devices.h
@@ -242,6 +242,7 @@ enum fh_devices
FH_OSS_DSP = FHDEV (DEV_SOUND_MAJOR, 3),
DEV_SOCK_MAJOR = 30,
+ FH_SOCKET = FHDEV (DEV_SOCK_MAJOR, 0),
FH_INET = FHDEV (DEV_SOCK_MAJOR, 36),
FH_LOCAL = FHDEV (DEV_SOCK_MAJOR, 120),
@@ -390,10 +391,12 @@ extern const _device *ptmx_dev;
extern const _device *ptys_dev;
extern const _device *urandom_dev;
-extern const _device dev_af_local_storage;
-#define af_local_dev ((device *) &dev_af_local_storage)
+extern const _device dev_socket_storage;
+#define socket_dev ((device *) &dev_socket_storage)
extern const _device dev_af_inet_storage;
#define af_inet_dev ((device *) &dev_af_inet_storage)
+extern const _device dev_af_local_storage;
+#define af_local_dev ((device *) &dev_af_local_storage)
extern const _device dev_piper_storage;
#define piper_dev ((device *) &dev_piper_storage)
diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in
index 47d127c..c0108b8 100644
--- a/winsup/cygwin/devices.in
+++ b/winsup/cygwin/devices.in
@@ -116,6 +116,9 @@ const _device dev_piper_storage =
const _device dev_pipew_storage =
{"", {FH_PIPEW}, "", exists_internal};
+const _device dev_socket_storage =
+ {"", {FH_SOCKET}, "", exists_internal};
+
const _device dev_af_inet_storage =
{"", {FH_INET}, "", exists_internal};
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 2bf84ab..da45989 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -864,7 +864,7 @@ path_conv::check (const char *src, unsigned opt,
if (component == 0)
{
fileattr = 0;
- dev.parse (FH_INET);
+ dev.parse (FH_SOCKET);
}
break;
case virt_fsdir: