| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
BUG=None
TEST=Run the base unit-tests
Review URL: http://codereview.chromium.org/119190
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17660 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On POSIX systems, system calls can be interrupted by signals. In this
case, they'll return EINTR, indicating that the system call needs to
be restarted.
(The situation is a little more complicated than this with SA_RESTART,
but you can read man 7 signal if you like.)
The short of it is that you need to catch EINTR and restart the call
for these system calls:
* read, readv, write, writev, ioctl
* open() when dealing with a fifo
* wait*
* Anything socket based (send*, recv*, connect, accept etc)
* flock and lock control with fcntl
* mq_ functions which can block
* futex
* sem_wait (and timed wait)
* pause, sigsuspend, sigtimedwait, sigwaitinfo
* poll, epoll_wait, select and 'p' versions of the same
* msgrcv, msgsnd, semop, semtimedop
* close (although, on Linux, EINTR won't happen here)
* any sleep functions (careful, you need to handle this are restart
with different arguments)
We've been a little sloppy with this until now. This patch adds a
macro for dealing with this and corrects every case of these system
calls (that I found).
The macro is HANDLE_EINTR in base/eintr_wrapper.h. It's safe to
include on Windows and is a no-op there.
On POSIX, it uses GCC magic to return the correct type based on the
expression and restarts the system call if it throws EINTR.
And you can use it like:
HANDLE_EINTR(close(fd));
Or:
ssize_t bytes_read = HANDLE_EINTR(read(fd, buffer, len));
*BEWARE* that it will evaluate the argument multiple times, so this is
not safe:
HANDLE_EINTR(close(FireMissiles()));
http://groups.google.com/group/chromium-dev/browse_thread/thread/41a35b2a457d73a0
http://codereview.chromium.org/100225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15102 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the process terminates, and retrieve what the process printed to the standard output.
That util function is needed for the new in-process test framework.
It is Windows only for now.
BUG=None
TEST=Covered by new unit test.
Review URL: http://codereview.chromium.org/87008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14135 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
It will replace popen call in chrome_process_util_linux.
I don't see much benefit in having a Windows implementation
(not many useful programs you can launch and get output),
so POSIX-only.
Review URL: http://codereview.chromium.org/67226
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13920 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need to check process count (which tends to induce flakiness).
In fact, we are already checking all important facts:
- after checking that process handle is a not-null handle we know
that the process started successfully
- after WaitForSingleProcess returns true we know that the process
finished successfully
BUG=8811
Review URL: http://codereview.chromium.org/42224
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11728 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
r10178 compares an int value 'written' with a size_t value 'sizeof(num_open_files)' in "base/process_util_unittest.cc" and it caused a compilation error on Mac and Linux.
As a quick fix, this change casts the int value 'written' to size_t.
TBR=xji
Review URL: http://codereview.chromium.org/28019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10179 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10177 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/27038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10170 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
not close the process handle that they do not own.
Review URL: http://codereview.chromium.org/24004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9400 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
- walk thru only processes for this user.
- properly handle walking the data collect.
- handle the number of processes increasing between count and data collection.
Enable the one unittest the uses the named process iterator.
Review URL: http://codereview.chromium.org/20122
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9305 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
Takano <takano.naoki@gmail.com>
Review URL: http://codereview.chromium.org/18192
Review URL: http://codereview.chromium.org/21097
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9263 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
for linux and mac. See BUG 6598.
Review URL: http://codereview.chromium.org/18801
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8892 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
possibly crashes) in ObserverListTest.BUG=6286
This CL has expanded to include some cleanup and refactoring of test_suite and related files, so that this logging change (and other improvements) are applied to all unit tests.
Review URL: http://codereview.chromium.org/18003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7977 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
- switch to FilePath inside CopyDirectory
- be less racy in ProcessUtilTest.KillSlowChild
Review URL: http://codereview.chromium.org/17013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7948 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as they now have to connect to the X server (not sure when
we added that, or where, but it's happening). In my case,
when running ProcessUtilTest.SpawnChild, it takes 1.7 seconds
after the main process starts waiting for the child
before the child finishes reading from the X server
and exits. So raise timeout from one second to five seconds.
Review URL: http://codereview.chromium.org/17022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7506 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a facility to LaunchProcess() to remap a given FD into a child process.
This change is needed for 2 reasons:
1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket.
2)The OS X Sandbox doesn't close FDs.
Review URL: http://codereview.chromium.org/14497
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7175 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
| |
Broke the build.
Review URL: http://codereview.chromium.org/15402
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7159 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a facility to LaunchProcess() to remap a given FD into a child process.
This change is needed for 2 reasons:
1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket.
2)The OS X Sandbox doesn't close FDs.
Review URL: http://codereview.chromium.org/14497
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7156 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
avoid some more Windows specific code.
Move Process and SharedMemory into the base namespace (most changes).
Review URL: http://codereview.chromium.org/10895
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5446 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/8781
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4320 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
Also switch to fork() from vfork(), since strace on my box
doesn't support vfork! It's deprecated, anyway.
Review URL: http://codereview.chromium.org/8880
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4315 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in a lookup table.
Previously we were using different mechanisms on each platform to look up
child process names at runtime. This broke on OS X where we strip the symbol
table on release executables.
2) Enable process_util_unittest on OS X.
Review URL: http://codereview.chromium.org/8864
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4165 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/7202
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3715 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
|
|
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98
|