[newlib-cygwin] forkables: inline dll_list::forkables_supported

Corinna Vinschen corinna@sourceware.org
Fri Feb 8 11:38:00 GMT 2019


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

commit 22d68bada39c0b676af7525d5dae272fd688c1c6
Author: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date:   Thu Mar 2 17:26:53 2017 +0100

    forkables: inline dll_list::forkables_supported
    
    And LONG fits better for shared_info member forkable_hardlink_support.

Diff:
---
 winsup/cygwin/dlfcn.cc      | 2 +-
 winsup/cygwin/dll_init.cc   | 1 +
 winsup/cygwin/dll_init.h    | 6 ++++--
 winsup/cygwin/fork.cc       | 1 +
 winsup/cygwin/forkable.cc   | 8 +-------
 winsup/cygwin/shared_info.h | 4 ++--
 6 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index 7ef7dfd..c675a57 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -15,13 +15,13 @@ details. */
 #include "path.h"
 #include "fhandler.h"
 #include "dtable.h"
-#include "dll_init.h"
 #include "cygheap.h"
 #include "perprocess.h"
 #include "cygtls.h"
 #include "tls_pbuf.h"
 #include "ntdll.h"
 #include "shared_info.h"
+#include "dll_init.h"
 #include "pathfinder.h"
 
 /* Dumb allocator using memory from tmp_pathbuf.w_get ().
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 82b0656..4baa48d 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -8,6 +8,7 @@ details. */
 #include "cygerrno.h"
 #include "perprocess.h"
 #include "sync.h"
+#include "shared_info.h"
 #include "dll_init.h"
 #include "environ.h"
 #include "security.h"
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h
index 5c4cc0b..c4a133f 100644
--- a/winsup/cygwin/dll_init.h
+++ b/winsup/cygwin/dll_init.h
@@ -86,8 +86,10 @@ struct dll
 
 class dll_list
 {
-  /* forkables */
-  bool forkables_supported ();
+  bool forkables_supported ()
+  {
+    return cygwin_shared->forkable_hardlink_support >= 0;
+  }
   DWORD forkables_dirx_size;
   bool forkables_created;
   PWCHAR forkables_dirx_ntname;
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 530e423..7ae0404 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -20,6 +20,7 @@ details. */
 #include "child_info.h"
 #include "cygtls.h"
 #include "tls_pbuf.h"
+#include "shared_info.h"
 #include "dll_init.h"
 #include "cygmalloc.h"
 #include "ntdll.h"
diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc
index 05b2285..1e02a8a 100644
--- a/winsup/cygwin/forkable.cc
+++ b/winsup/cygwin/forkable.cc
@@ -10,7 +10,6 @@ details. */
 #include "cygerrno.h"
 #include "perprocess.h"
 #include "sync.h"
-#include "dll_init.h"
 #include "environ.h"
 #include "security.h"
 #include "path.h"
@@ -19,6 +18,7 @@ details. */
 #include "cygheap.h"
 #include "pinfo.h"
 #include "shared_info.h"
+#include "dll_init.h"
 #include "child_info.h"
 #include "cygtls.h"
 #include "exception.h"
@@ -501,12 +501,6 @@ dll::create_forkable ()
   return false;
 }
 
-bool
-dll_list::forkables_supported ()
-{
-  return cygwin_shared->forkable_hardlink_support >= 0;
-}
-
 /* return the number of characters necessary to store one forkable name */
 size_t
 dll_list::forkable_ntnamesize (dll_type type, PCWCHAR fullntname, PCWCHAR modname)
diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h
index 307306c..83a1fd1 100644
--- a/winsup/cygwin/shared_info.h
+++ b/winsup/cygwin/shared_info.h
@@ -33,7 +33,7 @@ public:
 /* Data accessible to all tasks */
 
 
-#define CURR_SHARED_MAGIC 0xc590e67eU
+#define CURR_SHARED_MAGIC 0x9f33cc5dU
 
 #define USER_VERSION   1
 
@@ -51,7 +51,7 @@ class shared_info
   mtinfo mt;
   loadavginfo loadavg;
   LONG pid_src;
-  char forkable_hardlink_support; /* single byte access always is atomic */
+  LONG forkable_hardlink_support;
 
   void initialize ();
   void init_obcaseinsensitive ();



More information about the Cygwin-cvs mailing list