From cecb74ae47ea94f53641740f18f2308ff4692f41 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 19 Feb 2002 05:58:44 +0000 Subject: * 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. --- winsup/cygwin/sigproc.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/sigproc.cc') 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) { -- cgit v1.2.3