Changeset 1630
- Timestamp:
- Nov 14, 2004, 12:28:29 PM (21 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 6 added
- 3 deleted
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/InnoTekLIBC/sharedpm.h
-
Property cvs2svn:cvs-rev
changed from
1.16
to1.17
r1629 r1630 99 99 /** Structure size. */ 100 100 unsigned cb; 101 /** Process I D. */101 /** Process Id. */ 102 102 pid_t pid; 103 /** Process Group Id. */ 104 pid_t pgrp; 103 105 /** Exit code. */ 104 106 int iExitCode; … … 542 544 unsigned cSigMaxActive; 543 545 /** 112 - Notification event semaphore. 544 * This semaphore is signaled when an event occurs. 546 * This semaphore is signaled when an event occurs. An event is either a signal 547 * or a child notification. 548 * At the moment this isn't used by anyone, but it's being signaled just in case. 545 549 */ 546 550 unsigned long hevNotify; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/signal.h
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1629 r1630 160 160 /** Don't mask the signal which is being delivered. */ 161 161 #define SA_NODEFER 0x00000010 162 /** Don't keep zombies around for wait*(). Not implmented on OS/2.*/162 /** Don't keep zombies around for wait*(). */ 163 163 #define SA_NOCLDWAIT 0x00000020 164 164 /** Signal the handler with the full set of arguments. */ … … 407 407 /** Signal code. (See SI_* and FPE_* macros.) */ 408 408 int si_code; 409 /** Timestamp when the signal was generated - LIBC extension. */409 /** LIBC Extension: Timestamp when the signal was generated. */ 410 410 unsigned si_timestamp; 411 /** Flags - LIBC extension. __LIBC_SI_* */411 /** LIBC Extension: Flags. __LIBC_SI_* */ 412 412 unsigned si_flags; 413 413 /** Process sending the signal. */ 414 414 __pid_t si_pid; 415 /** Thread sending the signal - LIBC extension. */ 415 /** LIBC Extension: the program group of the sender. */ 416 unsigned si_pgrp; 417 /** LIBC Extension: Thread sending the signal. */ 416 418 unsigned si_tid; 417 /** User sending the signal (r uid). (Usually 0 for OS/2)*/419 /** User sending the signal (real uid). */ 418 420 __uid_t si_uid; 419 421 /** Exit value. (SIGCHLD) */ … … 428 430 int si_fd; 429 431 /** Reserve a little bit for future usage. */ 430 unsigned auReserved[ 3];432 unsigned auReserved[6]; 431 433 } siginfo_t; 432 434 … … 435 437 * @{ */ 436 438 /** If set the signal was queue. */ 437 #define __LIBC_SI_QUEUED 0x00000001439 #define __LIBC_SI_QUEUED 0x00000001 438 440 /** Internal signal generated by LIBC. */ 439 #define __LIBC_SI_INTERNAL 0x00000002 441 #define __LIBC_SI_INTERNAL 0x00000002 442 /** Don't notify the child wait facilities. (Signal origins there.) */ 443 #define __LIBC_SI_NO_NOTIFY_CHILD 0x00000004 440 444 /** @} */ 441 445 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/wait.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1629 r1630 103 103 pid_t wait(int *); 104 104 pid_t waitpid(pid_t, int *, int); 105 #if 0 /* bird: old __BSD_VISIBLE */106 105 struct rusage; 107 106 pid_t wait3(int *, int, struct rusage *); 108 107 pid_t wait4(pid_t, int *, int, struct rusage *); 109 #endif110 108 111 109 … … 118 116 /** Wait for processes that have exited. */ 119 117 #define WEXITED 8 120 /** Wait for processes that have stopped. */ 121 #define WSTOPPED 16 122 /** Keep the wait state around for later wait calls, i.e. just peek at the stuff. */ 123 #define WNOWAIT 32 118 /** Wait for processes that have stopped. Same as WUNTRACED atm. */ 119 #define WSTOPPED WUNTRACED 120 /** Keep the wait state around for later wait calls, i.e. just peek at the stuff. 121 * Very logical name, not chance at all that anyone will confuse it for WNOHANG. */ 122 #define WNOWAIT 16 124 123 125 124 /* The following values are used by the `waitid' function. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.def
-
Property cvs2svn:cvs-rev
changed from
1.77
to1.78
r1629 r1630 1264 1264 "__std_setruid" @1286 1265 1265 "__std_waitid" @1287 1266 "__std_wait3" @1288 1267 "__std_wait4" @1289 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/wait.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 1 /* wait.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 1 /* $Id: waitid.c,v 1.1 2004/11/08 09:57:37 bird Exp $ */ 2 /** @file 3 * 4 * LIBC - wait(). 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird@innotek.de> 7 * 8 * 9 * This file is part of InnoTek LIBC. 10 * 11 * InnoTek LIBC is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License as published 13 * by the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * InnoTek LIBC is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with InnoTek LIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 2 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 3 31 #include "libc-alias.h" 4 #include <stdlib.h> 5 #include <process.h> 32 #include <sys/wait.h> 6 33 #include <errno.h> 7 #include < emx/syscalls.h>34 #include <InnoTekLIBC/backend.h> 8 35 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_PROCESS 9 36 #include <InnoTekLIBC/logstrict.h> 10 37 11 int _STD(wait)(int *status) 38 39 /** 40 * Waits/polls for a child process to change it's running status. 41 * 42 * @returns Process id of the child. 43 * @returns -1 and errno on failure. 44 * @param piStatus Where to return the status. 45 */ 46 pid_t _STD(wait)(int *piStatus) 12 47 { 13 LIBCLOG_ENTER(" status=%p\n", status);14 int dummy;15 int rc;16 17 if (status == NULL)18 status = &dummy;19 rc = __wait(status);20 LIBCLOG_RETURN_ MSG(rc,"ret %d (%#x). *status=%#x\n", rc, rc, *status);48 LIBCLOG_ENTER("piStatus=%p\n", (void *)piStatus); 49 /* 50 * Just pass it along to waitpid. 51 */ 52 pid_t pid = waitpid(-1, piStatus, 0); 53 if (pid > 0) 54 LIBCLOG_RETURN_MSG(pid, "ret %d (%#x) iStatus=%#x\n", pid, pid, piStatus ? *piStatus : -1); 55 LIBCLOG_RETURN_INT(pid); 21 56 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/waitpid.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 1 /* waitpid.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 1 /* $Id: waitid.c,v 1.1 2004/11/08 09:57:37 bird Exp $ */ 2 /** @file 3 * 4 * LIBC - waitpid(). 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird@innotek.de> 7 * 8 * 9 * This file is part of InnoTek LIBC. 10 * 11 * InnoTek LIBC is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License as published 13 * by the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * InnoTek LIBC is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with InnoTek LIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 2 26 3 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 4 31 #include "libc-alias.h" 5 #include <stdlib.h> 6 #include <process.h> 32 #include <sys/wait.h> 7 33 #include <errno.h> 8 #include < emx/syscalls.h>34 #include <InnoTekLIBC/backend.h> 9 35 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_PROCESS 10 36 #include <InnoTekLIBC/logstrict.h> 11 37 12 int _STD(waitpid)(int pid, int *status, int options) 38 39 /** 40 * Waits/polls for a child process in a specified set of processes to change 41 * it's running status. 42 * 43 * @returns Process id of the child. 44 * @returns -1 and errno on failure. 45 * @param pid Pid to wait for. 46 * If -1, then any child process. 47 * If > 0, then wait for process with that id. 48 * If 0, then wait for any child process who is in the same process group id. 49 * If < -1, then wait any child process whose process group is -pid. 50 * @param piStatus Where to return the status. 51 * @param fOptions Same as waitid() in our implementation. 52 */ 53 pid_t _STD(waitpid)(pid_t pid, int *piStatus, int fOptions) 13 54 { 14 LIBCLOG_ENTER("pid=%d status=%p options=%#x\n", pid, status, options); 15 int dummy; 16 int rc; 55 LIBCLOG_ENTER("pid=%#x (%d) piStatus=%p fOptions=%#x\n", pid, pid, (void *)piStatus, fOptions); 17 56 18 if (status == NULL) 19 status = &dummy; 20 rc = __waitpid(pid, status, options); 21 LIBCLOG_RETURN_MSG(rc,"ret %d (%#x). *status=%#x\n", rc, rc, *status); 57 /* 58 * Call waitid to do the actual waiting. 59 */ 60 /* convert pid to enmIdType and Id. */ 61 id_t Id; 62 idtype_t enmIdType; 63 if (pid > 0) 64 { 65 enmIdType = P_PID; 66 Id = pid; 67 } 68 else if (pid == 0) 69 { 70 enmIdType = P_PGID; 71 Id = 0; 72 } 73 else if (pid == -1) 74 { 75 enmIdType = P_ALL; 76 Id = 0; 77 } 78 else 79 { 80 Id = -pid; 81 enmIdType = P_PGID; 82 } 83 84 /* do the call */ 85 siginfo_t SigInfo = {0}; 86 int rc = waitid(P_ALL, 0, &SigInfo, WEXITED); 87 if (!rc) 88 { 89 /* 90 * Convert signal info to status code. 91 */ 92 int iStatus; 93 switch (SigInfo.si_code) 94 { 95 default: 96 LIBC_ASSERTM_FAILED("Invalid si_code=%d\n", SigInfo.si_code); 97 case CLD_EXITED: iStatus = W_EXITCODE(SigInfo.si_status, 0); break; 98 case CLD_KILLED: iStatus = W_EXITCODE(0, SigInfo.si_status); break; 99 case CLD_DUMPED: iStatus = W_EXITCODE(0, SigInfo.si_status) | WCOREFLAG; break; 100 case CLD_TRAPPED: iStatus = W_STOPCODE(SigInfo.si_status); break; 101 case CLD_STOPPED: iStatus = W_STOPCODE(SigInfo.si_status); break; 102 case CLD_CONTINUED: iStatus = W_STOPCODE(SigInfo.si_status); break; 103 104 } 105 if (piStatus) 106 *piStatus = iStatus; 107 LIBCLOG_RETURN_MSG(SigInfo.si_pid, "ret %d (%#x) iStatus=%#x\n", 108 SigInfo.si_pid, SigInfo.si_pid, iStatus); 109 } 110 errno = -rc; 111 LIBCLOG_RETURN_INT(-1); 22 112 } 113 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fcntl.c
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1629 r1630 11 11 #define INCL_FSMACROS 12 12 #include <os2emx.h> 13 #include " fs.h"13 #include "b_fs.h" 14 14 #include <386/builtin.h> 15 15 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__init.c
-
Property cvs2svn:cvs-rev
changed from
1.18
to1.19
r1629 r1630 31 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_INITTERM 32 32 #include <InnoTekLIBC/logstrict.h> 33 #include " signals.h"33 #include "b_signal.h" 34 34 35 35 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__initdll.c
-
Property cvs2svn:cvs-rev
changed from
1.18
to1.19
r1629 r1630 34 34 #include <InnoTekLIBC/fork.h> 35 35 #include "syscalls.h" 36 #include " fs.h"37 #include " signals.h"36 #include "b_fs.h" 37 #include "b_signal.h" 38 38 #include <InnoTekLIBC/thread.h> 39 39 #include <InnoTekLIBC/libc.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__spawnve.c
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1629 r1630 12 12 #define INCL_FSMACROS 13 13 #include <os2emx.h> 14 #include "fs.h" 14 #include "b_fs.h" 15 #include "b_signal.h" 16 #include "b_process.h" 15 17 #include <emx/syscalls.h> 16 18 #include <InnoTekLIBC/sharedpm.h> … … 46 48 { 47 49 /* 48 * Allocate shared memory.50 * Get Signal stuff 49 51 */ 50 size_t cb = sizeof(__LIBC_SPMINHERIT) + ((cbFH + 3) & ~3) + ((cbFS + 3) & ~3);51 pRet = __libc_spmAlloc(cb);52 if ( pRet)52 size_t cbSig; 53 __LIBC_PSPMINHSIG pSig; 54 if (!__libc_back_signalInheritPack(&pSig, &cbSig)) 53 55 { 54 pRet->cb = sizeof(*pRet); 55 pRet->pFHBundles = (__LIBC_PSPMINHFHBHDR)(pRet + 1); 56 memcpy(pRet->pFHBundles, pFH, cbFH); 57 if (pFS) 56 /* 57 * Allocate shared memory. 58 */ 59 size_t cb = sizeof(__LIBC_SPMINHERIT) + ((cbFH + 3) & ~3) + ((cbFS + 3) & ~3) + ((cbSig + 3) & ~3); 60 pRet = __libc_spmAlloc(cb); 61 if (pRet) 58 62 { 59 pRet->pFS = (__LIBC_PSPMINHFS)((char *)pRet->pFHBundles + ((cbFH + 3) & ~3)); 60 memcpy(pRet->pFS, pFS, cbFS); 61 free(pFS); 63 /* fh */ 64 pRet->cb = sizeof(*pRet); 65 pRet->pFHBundles = (__LIBC_PSPMINHFHBHDR)(pRet + 1); 66 memcpy(pRet->pFHBundles, pFH, cbFH); 67 free(pFH); 68 69 /* fs */ 70 if (pFS) 71 { 72 pRet->pFS = (__LIBC_PSPMINHFS)((char *)pRet->pFHBundles + ((cbFH + 3) & ~3)); 73 memcpy(pRet->pFS, pFS, cbFS); 74 free(pFS); 75 } 76 else 77 pRet->pFS = NULL; 78 79 /* sig */ 80 if (pSig) 81 { 82 pRet->pSig = (__LIBC_PSPMINHSIG)((char *)pRet->pFHBundles + ((cbFH + 3) & ~3) + ((cbFS + 3) & ~3)); 83 memcpy(pRet->pSig, pSig, cbSig); 84 free(pFS); 85 } 86 87 /* done! */ 88 LIBCLOG_RETURN_P(pRet); 62 89 } 63 else 64 pRet->pFS = NULL; 65 free(pFH); 66 LIBCLOG_RETURN_P(pRet); 90 free(pSig); 67 91 } 68 92 free(pFS); … … 249 273 char szObj[40]; 250 274 int rc; 275 276 /* 277 * Notify the process waiter system. 278 */ 279 __libc_back_processWaitNotifyExec(); 251 280 252 281 /* -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirChangeRoot.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 30 30 *******************************************************************************/ 31 31 #include "libc-alias.h" 32 #include " fs.h"32 #include "b_fs.h" 33 33 #include <string.h> 34 34 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirCreate.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 34 34 #define INCL_ERRORS 35 35 #include <os2emx.h> 36 #include " fs.h"36 #include "b_fs.h" 37 37 #include "syscalls.h" 38 38 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirCurrentGet.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <string.h> 36 36 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirCurrentSet.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <InnoTekLIBC/backend.h> 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDirRemove.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 33 33 #define INCL_ERRORS 34 34 #include <os2emx.h> 35 #include " fs.h"35 #include "b_fs.h" 36 36 #include <errno.h> 37 37 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDriveDefaultGet.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <InnoTekLIBC/backend.h> 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsDriveDefaultSet.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <InnoTekLIBC/backend.h> 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsFileStat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include " fs.h"31 #include "b_fs.h" 32 32 #include <sys/stat.h> 33 33 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsFileStatFH.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <string.h> 36 36 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsNativeFileStat.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 33 33 #define INCL_FSMACROS 34 34 #include <os2emx.h> 35 #include " fs.h"35 #include "b_fs.h" 36 36 #include <string.h> 37 37 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsPathResolve.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 33 33 #define INCL_BASE 34 34 #include <os2emx.h> 35 #include " fs.h"35 #include "b_fs.h" 36 36 #include <errno.h> 37 37 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsStat.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 30 30 *******************************************************************************/ 31 31 #include "libc-alias.h" 32 #include " fs.h"32 #include "b_fs.h" 33 33 #include <stdlib.h> 34 34 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsSymlinkCreate.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 30 30 * Header Files * 31 31 *******************************************************************************/ 32 #include " fs.h"32 #include "b_fs.h" 33 33 #include <string.h> 34 34 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsSymlinkRead.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 30 30 * Header Files * 31 31 *******************************************************************************/ 32 #include " fs.h"32 #include "b_fs.h" 33 33 #include <string.h> 34 34 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_fsSymlinkStat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include " fs.h"31 #include "b_fs.h" 32 32 #include <sys/stat.h> 33 33 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_ioFileOpen.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 34 34 #define INCL_FSMACROS 35 35 #include <os2emx.h> 36 #include " fs.h"36 #include "b_fs.h" 37 37 #include <string.h> 38 38 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_ioFileSizeSet.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 33 33 #define INCL_ERRORS 34 34 #include <os2emx.h> 35 #include " fs.h"35 #include "b_fs.h" 36 36 #include <limits.h> 37 37 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_ioSeek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 32 32 #define INCL_FSMACROS 33 33 #include <os2emx.h> 34 #include " fs.h"34 #include "b_fs.h" 35 35 #include <limits.h> 36 36 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_mmanProtect.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 33 33 #define INCL_BASE 34 34 #include <os2emx.h> 35 #include " mman.h"35 #include "b_mman.h" 36 36 #include <string.h> 37 37 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_processWait.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 41 41 #include <sys/fmutex.h> 42 42 #include "backend.h" 43 #include "b_process.h" 43 44 #include <emx/startup.h> 44 45 #include <emx/umalloc.h> … … 47 48 #include <InnoTekLIBC/sharedpm.h> 48 49 #include <InnoTekLIBC/backend.h> 49 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_ SIGNAL50 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_PROCESS 50 51 #include <InnoTekLIBC/logstrict.h> 51 52 … … 68 69 /** Pointer to the previous node in the list. */ 69 70 volatile PWAITINFO pPrev; 71 /** Child process id. */ 72 pid_t pid; 70 73 /** Child process group. */ 71 pid_t pid; 72 /** Process group. (not implemented yet) */ 73 pid_t pgid; 74 pid_t pgrp; 74 75 /** Code (si_code for SIGCHLD). */ 75 76 int uCode; … … 105 106 * This is something which the signal subsystem controls, it 106 107 * will notify us when this state changes. */ 107 static volatile intgfNoWaitStatus;108 static volatile unsigned gfNoWaitStatus; 108 109 109 110 /** The event semaphore the callers are sleeping on. */ … … 122 123 static int waitChild(PWAITINFO pWait, int fNoWait, pid_t pidWait); 123 124 static int waitAllocInsert(const PWAITINFO pWaitInsert); 124 125 /* move us */ 126 void __libc_back_processWaitNotifyTerm(void); 127 void __libc_back_processWaitNotifyExec(void); 128 void __libc_back_processWaitNotifyChild(siginfo_t *pSigInfo, pid_t pgid); 125 static inline void waitInfoToSigInfo(const PWAITINFO pWait, siginfo_t *pSigInfo); 129 126 130 127 … … 344 341 case TC_EXIT: 345 342 pWait->uCode = CLD_EXITED; 346 pWait->uStatus = W_EXITCODE(resc.codeResult, 0);343 pWait->uStatus = resc.codeResult; 347 344 break; 348 345 349 346 case TC_HARDERROR: 350 347 pWait->uCode = CLD_KILLED; 351 pWait->uStatus = W_EXITCODE(resc.codeResult, SIGBUS);348 pWait->uStatus = SIGBUS; 352 349 break; 353 350 … … 355 352 case TC_EXCEPTION: 356 353 pWait->uCode = CLD_DUMPED; 357 pWait->uStatus = W_EXITCODE(resc.codeResult, SIGSEGV);354 pWait->uStatus = SIGSEGV; 358 355 break; 359 356 360 357 case TC_KILLPROCESS: 361 358 pWait->uCode = CLD_KILLED; 362 pWait->uStatus = W_EXITCODE(resc.codeResult, SIGKILL);359 pWait->uStatus = SIGKILL; 363 360 break; 364 361 365 362 default: 366 363 pWait->uCode = CLD_KILLED; 367 pWait->uStatus = W_EXITCODE(resc.codeResult, SIGSEGV);364 pWait->uStatus = SIGSEGV; 368 365 break; 369 366 } … … 382 379 LIBCLOG_MSG2("SPM Child %#lx (%ld) for reason %d and with code %d (%#x).\n", 383 380 pid, pid, Notify.enmDeathReason, Notify.iExitCode, Notify.iExitCode); 381 pWait->pgrp = Notify.pgrp; 384 382 385 383 switch (Notify.enmDeathReason) … … 387 385 case __LIBC_EXIT_REASON_EXIT: 388 386 pWait->uCode = CLD_EXITED; 389 pWait->uStatus = W_EXITCODE(Notify.iExitCode, 0);387 pWait->uStatus = Notify.iExitCode; 390 388 break; 391 389 392 390 case __LIBC_EXIT_REASON_HARDERROR: 393 391 pWait->uCode = CLD_KILLED; 394 pWait->uStatus = W_EXITCODE(Notify.iExitCode, SIGBUS);392 pWait->uStatus = SIGBUS; 395 393 break; 396 394 … … 398 396 case __LIBC_EXIT_REASON_XCPT: 399 397 pWait->uCode = CLD_DUMPED; 400 pWait->uStatus = W_EXITCODE(Notify.iExitCode, SIGSEGV);398 pWait->uStatus = SIGSEGV; 401 399 break; 402 400 403 401 case __LIBC_EXIT_REASON_KILL: 404 402 pWait->uCode = CLD_KILLED; 405 pWait->uStatus = W_EXITCODE(Notify.iExitCode, SIGKILL);403 pWait->uStatus = SIGKILL; 406 404 break; 407 405 … … 411 409 { 412 410 pWait->uCode = CLD_KILLED; 413 pWait->uStatus = W_EXITCODE(Notify.iExitCode, Notify.enmDeathReason - __LIBC_EXIT_REASON_SIGNAL_BASE);411 pWait->uStatus = Notify.enmDeathReason - __LIBC_EXIT_REASON_SIGNAL_BASE; 414 412 break; 415 413 } … … 421 419 } 422 420 421 /* 422 * Raise signal. 423 */ 424 siginfo_t SigInfo = {0}; 425 waitInfoToSigInfo(pWait, &SigInfo); 426 SigInfo.si_flags = __LIBC_SI_QUEUED | __LIBC_SI_INTERNAL | __LIBC_SI_NO_NOTIFY_CHILD; 427 rc = __libc_Back_signalRaise(SIGCHLD, &SigInfo, NULL, __LIBC_BSRF_QUEUED | __LIBC_BSRF_EXTERNAL); 428 LIBC_ASSERTM(rc >= 0, "failed raising SIGCHLD. rc=%d\n", rc); 429 423 430 return 0; 424 431 } … … 507 514 508 515 /** 516 * Informs the wait facilities that a SIGCHLD signal action change have 517 * action have modified the properties of the wait*() calls. 518 * 519 * If SIGCHLD action is either set to SIG_IGN or have the SA_NOCLDWAIT flag set 520 * zombies will no longer be kept around. What happens for normal child exits are 521 * simply that the wait selection get's empty and ECHILD is the correct reply. 522 * In the case of stopped and continued children is a bit of a mystery. ECHILD 523 * isn't the right one I think, it's also damn difficult to emulate. So, for now 524 * those situations will not be handled properly and may cause deadlocks. 525 * 526 * @param fNoWaitStatus New child wait mode. 527 */ 528 void __libc_back_processWaitNotifyNoWait(int fNoWaitStatus) 529 { 530 __atomic_xchg(&gfNoWaitStatus, fNoWaitStatus); 531 } 532 533 /** 509 534 * Notify the process wait facilities that a child 510 535 * process have posted a SIGCHLD signal to the parent. 511 */ 512 void __libc_back_processWaitNotifyChild(siginfo_t *pSigInfo, pid_t pgid) 513 { 514 LIBCLOG_ENTER("pSigInfo=%p{si_code=%d si_status=%d si_pid=%d} pgid=%d\n", (void *)pSigInfo, 515 pSigInfo->si_code, pSigInfo->si_status, pSigInfo->si_pid, pgid); 536 * 537 * @param pSigInfo The signal info of the SIGCHLD signal. 538 */ 539 void __libc_back_processWaitNotifyChild(siginfo_t *pSigInfo) 540 { 541 LIBCLOG_ENTER("pSigInfo=%p{si_code=%d si_status=%d si_pid=%#x si_pgrp=%#x}\n", (void *)pSigInfo, 542 pSigInfo->si_code, pSigInfo->si_status, pSigInfo->si_pid, pSigInfo->si_pgrp); 516 543 517 544 int rc = waitSemRequest(1); 518 if ( rc)545 if (!rc) 519 546 { 520 547 /* … … 536 563 /* fill node */ 537 564 pWait->pid = pSigInfo->si_pid; 538 pWait->pg id = pgid;565 pWait->pgrp = pSigInfo->si_pgrp; 539 566 pWait->uCode = pSigInfo->si_code; 540 567 pWait->uStatus = pSigInfo->si_status; … … 564 591 pSigInfo->si_signo = SIGCHLD; 565 592 pSigInfo->si_pid = pWait->pid; 593 pSigInfo->si_pgrp = pWait->pgrp; 566 594 pSigInfo->si_code = pWait->uCode; 567 595 pSigInfo->si_status = pWait->uStatus; 568 596 pSigInfo->si_timestamp = pWait->uTimestamp; 569 597 pSigInfo->si_uid = pWait->uid; 598 pSigInfo->si_flags = __LIBC_SI_NO_NOTIFY_CHILD; 570 599 } 571 600 … … 590 619 591 620 /* 621 * Make sure there is a worker around. 622 */ 623 if (!gtidThread) 624 __libc_back_processWaitNotifyExec(); 625 626 /* 592 627 * Validate options. 593 628 */ … … 607 642 LIBC_ASSERTM_FAILED("pSigInfo is NULL.\n"); 608 643 LIBCLOG_RETURN_INT(-EINVAL); 644 } 645 switch (enmIdType) 646 { 647 case P_ALL: 648 case P_PID: 649 case P_PGID: 650 break; 651 default: 652 LIBC_ASSERTM_FAILED("Invalid id type %d\n", enmIdType); 653 LIBCLOG_RETURN_INT(-EINVAL); 609 654 } 610 655 … … 651 696 fFlag = WEXITED; 652 697 break; 698 #if 0 /* not implemented! */ 653 699 case CLD_TRAPPED: 654 fFlag = WUNTRACED; /* ?? - not implemented anyway. */655 700 break; 701 #endif 656 702 case CLD_STOPPED: 657 fFlag = WSTOPPED ;703 fFlag = WSTOPPED | WUNTRACED; 658 704 break; 659 705 case CLD_CONTINUED: … … 668 714 if (enmIdType == P_ALL) 669 715 break; 670 if ( enmIdType == P_PID671 && pInfo->pid == (pid_t)Id)716 if ( (enmIdType == P_PID && pInfo->pid == (pid_t)Id) 717 || (enmIdType == P_PGID && pInfo->pgrp == (pid_t)Id)) 672 718 break; 673 719 } … … 715 761 * Verify the wait id (again). 716 762 */ 763 waitSemRelease(); 717 764 if ( enmIdType == P_ALL 718 765 || enmIdType == P_PID) … … 738 785 } 739 786 } 740 else if (enmIdType == P_PGID)741 {742 LIBC_ASSERTM_FAILED("Process groups are not implemented yet\n");743 LIBCLOG_RETURN_INT(-ENOSYS);744 }745 787 else 746 788 { 747 LIBC_ASSERTM_FAILED("Invalid enmIdType=%d!\n", enmIdType); 748 LIBCLOG_RETURN_INT(-EINVAL); 789 rc = __libc_Back_signalSendPGrp((pid_t)Id, 0); 790 if (rc) 791 LIBCLOG_RETURN_INT(rc); 749 792 } 750 793 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalInterrupt.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 35 35 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 36 36 #include <InnoTekLIBC/logstrict.h> 37 #include " signals.h"37 #include "b_signal.h" 38 38 39 39 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalMask.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1629 r1630 41 41 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 42 42 #include <InnoTekLIBC/logstrict.h> 43 #include " signals.h"43 #include "b_signal.h" 44 44 45 45 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalPending.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1629 r1630 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 37 #include <InnoTekLIBC/logstrict.h> 38 #include " signals.h"38 #include "b_signal.h" 39 39 40 40 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalQueue.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 35 35 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 36 36 #include <InnoTekLIBC/logstrict.h> 37 #include " signals.h"37 #include "b_signal.h" 38 38 #include "syscalls.h" 39 39 … … 66 66 */ 67 67 siginfo_t SigInfo = {0}; 68 SigInfo.si_signo = iSignalNo; 69 SigInfo.si_code = SI_QUEUE; 68 70 SigInfo.si_flags |= __LIBC_SI_QUEUED; 69 71 SigInfo.si_value = SigVal; 70 SigInfo.si_signo = iSignalNo;71 72 int rc; 72 73 if (pid == _sys_pid) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalSendPid.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 40 40 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 41 41 #include <InnoTekLIBC/logstrict.h> 42 #include " signals.h"42 #include "b_signal.h" 43 43 #include "syscalls.h" 44 44 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalStack.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 37 #include <InnoTekLIBC/logstrict.h> 38 #include " signals.h"38 #include "b_signal.h" 39 39 40 40 /** -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalSuspend.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 37 #include <InnoTekLIBC/logstrict.h> 38 #include " signals.h"38 #include "b_signal.h" 39 39 40 40 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_signalWait.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1629 r1630 37 37 #include <errno.h> 38 38 #include <386/builtin.h> 39 #include " signals.h"39 #include "b_signal.h" 40 40 #include <InnoTekLIBC/thread.h> 41 41 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/b_threadInit.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r1629 r1630 33 33 #include <emx/syscalls.h> 34 34 #include "syscalls.h" 35 #include " signals.h"35 #include "b_signal.h" 36 36 #include <InnoTekLIBC/thread.h> 37 37 #include <InnoTekLIBC/backend.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/exceptions.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1629 r1630 41 41 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SIGNAL 42 42 #include <InnoTekLIBC/logstrict.h> 43 #include " signals.h"43 #include "b_signal.h" 44 44 45 45 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filefind.c
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1629 r1630 10 10 #define INCL_FSMACROS 11 11 #include <os2emx.h> 12 #include " fs.h"12 #include "b_fs.h" 13 13 #include <stdlib.h> 14 14 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/fs.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1629 r1630 35 35 #define INCL_ERRORS 36 36 #include <os2emx.h> 37 #include " fs.h"37 #include "b_fs.h" 38 38 #include <stddef.h> 39 39 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sharedpm.c
-
Property cvs2svn:cvs-rev
changed from
1.19
to1.20
r1629 r1630 525 525 pTerm->iExitCode = 0; 526 526 pTerm->pid = -1; 527 pTerm->pgrp = pProcess->pgrp; 527 528 pTerm->pNext = NULL; 528 529 pProcess->pTerm = pTerm; … … 1513 1514 * Unlink it and free it. 1514 1515 */ 1515 /* statistics */ 1516 if (gpSPMSelf->pid != pSig->pidSender) 1517 { 1518 __LIBC_PSPMPROCESS pSender = spmQueryProcessInState(pSig->pidSender, __LIBC_PROCSTATE_ALIVE); 1519 if (pSender) 1520 pSender->cSigsSent--; 1521 } 1516 /* statistics (free signal update sender stats) */ 1522 1517 gpSPMHdr->cSigActive--; 1523 1518 … … 2138 2133 if (pParent) 2139 2134 { 2135 pTerm->pid = pProcess->pid; 2136 pTerm->pgrp = pProcess->pgrp; 2137 pTerm->pNext = NULL; 2140 2138 *pParent->ppChildNotifyTail = pTerm; 2141 2139 pParent->ppChildNotifyTail = &pTerm->pNext; 2142 pTerm->pNext = NULL;2143 2140 DosPostEventSem(gpSPMHdr->hevNotify); 2144 2141 } … … 2461 2458 pTerm->iExitCode = 0; 2462 2459 pTerm->pid = pid; 2460 pTerm->pgrp = pProcess->pgrp; 2463 2461 pTerm->pNext = NULL; 2464 2462 pProcess->pTerm = pTerm; … … 2734 2732 else 2735 2733 pSig->Info.si_flags &= ~__LIBC_SI_QUEUED; 2734 if (!pSig->Info.si_pid) 2735 pSig->Info.si_pid = gpSPMSelf->pid; 2736 if (!pSig->Info.si_pgrp) 2737 pSig->Info.si_pgrp = gpSPMSelf->pgrp; 2738 if (!pSig->Info.si_uid) 2739 pSig->Info.si_uid = gpSPMSelf->uid; 2736 2740 2737 2741 /* insert (FIFO) */ … … 2750 2754 gpSPMSelf->cSigsSent++; 2751 2755 gpSPMHdr->cSigActive++; 2756 2757 /* post notification sem. */ 2758 DosPostEventSem(gpSPMHdr->hevNotify); 2752 2759 } 2753 2760 else … … 2820 2827 static void spmFreeSignal(__LIBC_PSPMSIGNAL pSig) 2821 2828 { 2822 LIBCLOG_ENTER("pSig=%p\n", (void *)pSig); 2829 LIBCLOG_ENTER("pSig=%p {.pidSender=%#x}\n", (void *)pSig, pSig->pidSender); 2830 2831 /* 2832 * If it got a sender, update it's statistics. 2833 */ 2834 if (!pSig->pidSender && gpSPMSelf->pid != pSig->pidSender) 2835 { 2836 __LIBC_PSPMPROCESS pSender = spmQueryProcessInState(pSig->pidSender, __LIBC_PROCSTATE_ALIVE); 2837 if (pSender) 2838 pSender->cSigsSent--; 2839 } 2840 2841 /* 2842 * Decide whether to put it in the queue of free signals 2843 * or to return it to the memory pool. 2844 */ 2823 2845 if (gpSPMHdr->cSigFree < 32) 2824 2846 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/signals.c
-
Property cvs2svn:cvs-rev
changed from
1.10
to1.11
r1629 r1630 85 85 #include <InnoTekLIBC/logstrict.h> 86 86 #include "syscalls.h" 87 #include "signals.h" 87 #include "b_signal.h" 88 #include "b_process.h" 88 89 89 90 … … 589 590 if (!rc) 590 591 { 592 /* 593 * Process inherited signal setup. 594 */ 595 __LIBC_PSPMINHERIT pInherit = __libc_spmInheritRequest(); 596 if (pInherit) 597 { 598 if ( pInherit->pSig 599 && pInherit->pSig->cb >= sizeof(__LIBC_SPMINHSIG) 600 && !__SIGSET_ISEMPTY(&pInherit->pSig->SigSetIGN)) 601 { 602 /* Ignored signals. */ 603 int iSignalNo; 604 for (iSignalNo = 1; iSignalNo < __SIGSET_MAXSIGNALS; iSignalNo++) 605 if (__SIGSET_ISSET(&pInherit->pSig->SigSetIGN, iSignalNo) && iSignalNo != SIGCHLD) 606 gaSignalActions[iSignalNo].__sigaction_u.__sa_handler = SIG_IGN; 607 } 608 __libc_spmInheritRelease(); 609 } 610 591 611 FS_RESTORE(); 592 612 LIBCLOG_RETURN_INT(0); … … 915 935 int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags) 916 936 { 917 LIBCLOG_ENTER("iSignalNo=%d pSigInfo=%p{.si_signo=%d, .si_errno=%d, .si_code=%#x, .si_timestamp=%#x, .si_flags=%#x .si_pid=%#x, .si_ tid=%#x, .si_uid=%d, .si_status=%d, .si_addr=%p, .si_value=%p, .si_band=%ld, .si_fd=%d} pvXcptOrQueued=%p fFlags=%#x\n",937 LIBCLOG_ENTER("iSignalNo=%d pSigInfo=%p{.si_signo=%d, .si_errno=%d, .si_code=%#x, .si_timestamp=%#x, .si_flags=%#x .si_pid=%#x, .si_pgrp=%#x, .si_tid=%#x, .si_uid=%d, .si_status=%d, .si_addr=%p, .si_value=%p, .si_band=%ld, .si_fd=%d} pvXcptOrQueued=%p fFlags=%#x\n", 918 938 iSignalNo, (void *)pSigInfo, 919 939 pSigInfo ? pSigInfo->si_signo : 0, … … 923 943 pSigInfo ? pSigInfo->si_flags : 0, 924 944 pSigInfo ? pSigInfo->si_pid : 0, 945 pSigInfo ? pSigInfo->si_pgrp : 0, 925 946 pSigInfo ? pSigInfo->si_tid : 0, 926 947 pSigInfo ? pSigInfo->si_uid : 0, … … 1313 1334 NULL); 1314 1335 if (rc >= 0) 1336 { 1337 /* 1338 * Special handling of child notifications. 1339 */ 1340 if ( iSignalNo == SIGCHLD 1341 && (SigInfo.si_flags & (__LIBC_SI_INTERNAL | __LIBC_SI_NO_NOTIFY_CHILD)) == __LIBC_SI_INTERNAL) 1342 __libc_back_processWaitNotifyChild(&SigInfo); 1343 1315 1344 cSignals--; 1345 } 1316 1346 else 1317 1347 { … … 2149 2179 SigInfo = *pSigInfo; 2150 2180 SigInfo.si_signo = iSignalNo; 2181 if (pSigInfo) 2182 SigInfo.si_code = SI_USER; 2151 2183 if (SigInfo.si_pid) 2152 2184 SigInfo.si_pid = _sys_pid; … … 2329 2361 siginfo_t SigInfo = {0}; 2330 2362 SigInfo.si_signo = iSignalNo; 2363 SigInfo.si_code = SI_USER; 2331 2364 if (SigInfo.si_pid) 2332 2365 SigInfo.si_pid = _sys_pid; … … 2635 2668 && pSigAct->__sigaction_u.__sa_handler != SIG_HOLD) 2636 2669 { 2670 /* 2671 * Check if it's SIGCHLD and changes the way wait*() works. 2672 */ 2673 if ( iSignalNo == SIGCHLD 2674 && ( ( gaSignalActions[iSignalNo].__sigaction_u.__sa_handler != pSigAct->__sigaction_u.__sa_handler 2675 && ( pSigAct->__sigaction_u.__sa_handler == SIG_IGN 2676 || gaSignalActions[iSignalNo].__sigaction_u.__sa_handler == SIG_IGN)) 2677 || ((gaSignalActions[iSignalNo].sa_flags & SA_NOCLDWAIT) ^ (pSigAct->sa_flags & SA_NOCLDWAIT)) 2678 ) 2679 ) 2680 __libc_back_processWaitNotifyNoWait(*pSigAct->__sigaction_u.__sa_handler == SIG_IGN || (pSigAct->sa_flags & SA_NOCLDWAIT)); 2681 2637 2682 /* 2638 2683 * Update the handler. … … 2992 3037 2993 3038 3039 /** 3040 * Construct the inheritance packet for signals. 3041 * 3042 * @returns 0 on success. 3043 * @param ppSig Where to store the allocated data. 3044 * @param pcbSig Size of the packet. 3045 */ 3046 int __libc_back_signalInheritPack(__LIBC_PSPMINHSIG *ppSig, size_t *pcbSig) 3047 { 3048 /* 3049 * Allocate a packet. 3050 */ 3051 __LIBC_PSPMINHSIG pSig = _hmalloc(sizeof(*pSig)); 3052 if (!pSig) 3053 return -ENOMEM; 3054 3055 /* acquire the sem. */ 3056 int rc = __libc_back_signalSemRequest(); 3057 3058 /* 3059 * Fill the packet. 3060 */ 3061 pSig->cb = sizeof(*pSig); 3062 __SIGSET_EMPTY(&pSig->SigSetIGN); 3063 unsigned iSignalNo; 3064 for (iSignalNo = 1; iSignalNo < __SIGSET_MAXSIGNALS; iSignalNo++) 3065 if ( iSignalNo != SIGCHLD 3066 && gaSignalActions[iSignalNo].__sigaction_u.__sa_handler == SIG_IGN) 3067 __SIGSET_SET(&pSig->SigSetIGN, iSignalNo); 3068 3069 /* 3070 * Return 3071 */ 3072 if (!rc) 3073 __libc_back_signalSemRelease(); 3074 *ppSig = pSig; 3075 *pcbSig = sizeof(*pSig); 3076 return 0; 3077 } 3078 3079 2994 3080 2995 3081 _FORK_CHILD1(0x0000000f, signalForkChild) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/umask.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1629 r1630 29 29 *******************************************************************************/ 30 30 #include "libc-alias.h" 31 #include " fs.h"31 #include "b_fs.h" 32 32 #include <386/builtin.h> 33 33 #include <sys/stat.h> -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.