Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Side by Side Diff: mozilla/nsprpub/pr/src/md/unix/uxproces.c

Issue 12089033: Update to NSPR 4.9.5 Beta 2, part 2: actual changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/nsprpub/pr/src/md/unix/unix_errors.c ('k') | mozilla/nsprpub/pr/src/md/unix/uxrng.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public 2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 #include "primpl.h" 6 #include "primpl.h"
7 7
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <fcntl.h> 10 #include <fcntl.h>
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 } 704 }
705 705
706 #endif /* !defined(_PR_NATIVE_THREADS) */ 706 #endif /* !defined(_PR_NATIVE_THREADS) */
707 707
708 static PRStatus _MD_InitProcesses(void) 708 static PRStatus _MD_InitProcesses(void)
709 { 709 {
710 #if !defined(_PR_NATIVE_THREADS) 710 #if !defined(_PR_NATIVE_THREADS)
711 int rv; 711 int rv;
712 int flags; 712 int flags;
713 #endif 713 #endif
714 #ifdef SUNOS4
715 #define _PR_NBIO_FLAG FNDELAY
716 #else
717 #define _PR_NBIO_FLAG O_NONBLOCK
718 #endif
719 714
720 #ifdef AIX 715 #ifdef AIX
721 { 716 {
722 void *handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); 717 void *handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
723 pr_wp.forkptr = (pid_t (*)(void)) dlsym(handle, "f_fork"); 718 pr_wp.forkptr = (pid_t (*)(void)) dlsym(handle, "f_fork");
724 if (!pr_wp.forkptr) { 719 if (!pr_wp.forkptr) {
725 pr_wp.forkptr = fork; 720 pr_wp.forkptr = fork;
726 } 721 }
727 dlclose(handle); 722 dlclose(handle);
728 } 723 }
729 #endif /* AIX */ 724 #endif /* AIX */
730 725
731 pr_wp.ml = PR_NewLock(); 726 pr_wp.ml = PR_NewLock();
732 PR_ASSERT(NULL != pr_wp.ml); 727 PR_ASSERT(NULL != pr_wp.ml);
733 728
734 #if defined(_PR_NATIVE_THREADS) 729 #if defined(_PR_NATIVE_THREADS)
735 pr_wp.numProcs = 0; 730 pr_wp.numProcs = 0;
736 pr_wp.cv = PR_NewCondVar(pr_wp.ml); 731 pr_wp.cv = PR_NewCondVar(pr_wp.ml);
737 PR_ASSERT(NULL != pr_wp.cv); 732 PR_ASSERT(NULL != pr_wp.cv);
738 #else 733 #else
739 rv = pipe(pr_wp.pipefd); 734 rv = pipe(pr_wp.pipefd);
740 PR_ASSERT(0 == rv); 735 PR_ASSERT(0 == rv);
741 flags = fcntl(pr_wp.pipefd[0], F_GETFL, 0); 736 flags = fcntl(pr_wp.pipefd[0], F_GETFL, 0);
742 fcntl(pr_wp.pipefd[0], F_SETFL, flags | _PR_NBIO_FLAG); 737 fcntl(pr_wp.pipefd[0], F_SETFL, flags | O_NONBLOCK);
743 flags = fcntl(pr_wp.pipefd[1], F_GETFL, 0); 738 flags = fcntl(pr_wp.pipefd[1], F_GETFL, 0);
744 fcntl(pr_wp.pipefd[1], F_SETFL, flags | _PR_NBIO_FLAG); 739 fcntl(pr_wp.pipefd[1], F_SETFL, flags | O_NONBLOCK);
745 740
746 #ifndef _PR_SHARE_CLONES 741 #ifndef _PR_SHARE_CLONES
747 pr_InstallSigchldHandler(); 742 pr_InstallSigchldHandler();
748 #endif 743 #endif
749 #endif /* !_PR_NATIVE_THREADS */ 744 #endif /* !_PR_NATIVE_THREADS */
750 745
751 pr_wp.thread = PR_CreateThread(PR_SYSTEM_THREAD, 746 pr_wp.thread = PR_CreateThread(PR_SYSTEM_THREAD,
752 WaitPidDaemonThread, NULL, PR_PRIORITY_NORMAL, 747 WaitPidDaemonThread, NULL, PR_PRIORITY_NORMAL,
753 #ifdef _PR_SHARE_CLONES 748 #ifdef _PR_SHARE_CLONES
754 PR_GLOBAL_THREAD, 749 PR_GLOBAL_THREAD,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 prerror = PR_INVALID_ARGUMENT_ERROR; 876 prerror = PR_INVALID_ARGUMENT_ERROR;
882 break; 877 break;
883 default: 878 default:
884 prerror = PR_UNKNOWN_ERROR; 879 prerror = PR_UNKNOWN_ERROR;
885 break; 880 break;
886 } 881 }
887 PR_SetError(prerror, oserror); 882 PR_SetError(prerror, oserror);
888 return PR_FAILURE; 883 return PR_FAILURE;
889 #endif 884 #endif
890 } /* _MD_KillUnixProcess */ 885 } /* _MD_KillUnixProcess */
OLDNEW
« no previous file with comments | « mozilla/nsprpub/pr/src/md/unix/unix_errors.c ('k') | mozilla/nsprpub/pr/src/md/unix/uxrng.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698