aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2017-03-02 17:26:53 +0100
committerCorinna Vinschen <corinna@vinschen.de>2019-02-03 12:08:59 +0100
commitf3d515f7f6e99e52dac30336d43411b0faf8ad0c (patch)
tree0574c1f657899a3a8f88883f71294d7fc84ad187
parent99fcc209dbb83c683a8e2c17e77bf427b70920c8 (diff)
downloadnewlib-f3d515f7f6e99e52dac30336d43411b0faf8ad0c.zip
newlib-f3d515f7f6e99e52dac30336d43411b0faf8ad0c.tar.gz
newlib-f3d515f7f6e99e52dac30336d43411b0faf8ad0c.tar.bz2
forkables: inline dll_list::forkables_supported
And LONG fits better for shared_info member forkable_hardlink_support.
-rw-r--r--winsup/cygwin/dlfcn.cc2
-rw-r--r--winsup/cygwin/dll_init.cc1
-rw-r--r--winsup/cygwin/dll_init.h6
-rw-r--r--winsup/cygwin/fork.cc1
-rw-r--r--winsup/cygwin/forkable.cc8
-rw-r--r--winsup/cygwin/shared_info.h4
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 d914e30..3e01e20 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 ();