Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-02-19 08:58:44 +0300
committerChristopher Faylor <me@cgf.cx>2002-02-19 08:58:44 +0300
commitcecb74ae47ea94f53641740f18f2308ff4692f41 (patch)
tree3d6465173d491080977f5f0c76eba1ccb2082102 /winsup/cygwin/sigproc.cc
parentdda54ada03ddd741f0160a6a25b034bb6526e281 (diff)
* fork.cc (fork_parent): Use sec_user_nih to control process/thread
inheritance/permission. * spawn.cc (spawn_guts): Ditto. * security.cc (create_token): Initialize token so that it is not tested for bogus value later. Use sec_user to control process/thread creation. * security.h (__sec_user): Rename declaration from sec_user. (sec_user_nih): Declare here as inline function wrapper for __sec_user. (sec_user): Ditto. * sigproc.cc (czombies): Allocate a character array for zombies to avoid constructor overhead (extremely hackish, I know). (cpchildren): Ditto. (pchildren): New define. (zombies): Ditto. (getsem): Use sec_user_nih to control semaphore inheritance/permission.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index f0a31131c..573e4f581 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -103,11 +103,14 @@ Static HANDLE wait_sig_inited = NULL; // Control synchronization of
*/
Static HANDLE events[PSIZE + 1] = {0}; // All my children's handles++
#define hchildren (events + 1) // Where the children handles begin
-Static pinfo pchildren[PSIZE]; // All my children info
+Static char cpchildren[PSIZE * sizeof (pinfo)]; // All my children info
Static int nchildren = 0; // Number of active children
-Static pinfo zombies[NZOMBIES]; // All my deceased children info
+Static char czombies[NZOMBIES * sizeof (pinfo)]; // All my deceased children info
Static int nzombies = 0; // Number of deceased children
+#define pchildren ((pinfo *) cpchildren)
+#define zombies ((pinfo *) czombies)
+
Static waitq waitq_head = {0, 0, 0, 0, 0, 0, 0};// Start of queue for wait'ing threads
Static waitq waitq_main; // Storage for main thread
@@ -939,8 +942,8 @@ getsem (_pinfo *p, const char *str, int init, int max)
char sa_buf[1024];
DWORD winpid = GetCurrentProcessId ();
- h = CreateSemaphore (allow_ntsec ? sec_user_nih (sa_buf) : &sec_none_nih,
- init, max, str = shared_name (str, winpid));
+ h = CreateSemaphore (sec_user_nih (sa_buf), init, max,
+ str = shared_name (str, winpid));
p = myself;
if (!h)
{