| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/42155
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11593 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
new/private shared memory on POSIX. Transition base::SharedMemory
implementation to file/mmap() to prevent leaking of wired kernel
resources and allow easier cleanup. Enable one more shared_memory
unit test for POSIX. Enable stats_table_unittest.cc for Mac, and
modify it so it cleans up.
Review URL: http://codereview.chromium.org/19724
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9114 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/12489
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6099 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/11208
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5571 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
Still doesn't run layout tests, but it's unforked and runs.
Review URL: http://codereview.chromium.org/10905
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5413 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
This reverts commit 3bd600b37c5ee613c004c84736ee3cb69434562a.
Review URL: http://codereview.chromium.org/9774
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5184 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=4160
Review URL: http://codereview.chromium.org/9639
Patch from Paweł Hajdan jr.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5182 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
- Add some transition APIs.
- Start migrating some code to transition APIs.
Review URL: http://codereview.chromium.org/8825
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Replaced mktemp with mkstemp
- Implemented file_util::CopyFile for Linux, run FileUtilTest on Linux
- Cleaned up some invalid uses of c_str() on a temporary std::string
- Changed file_util::WriteFile to allow for partial writes
Patch by Matthias Reitinger <reimarvin@gmail.com>
http://codereview.chromium.org/1869
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2070 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1460 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1300 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
data file, we need some of PathService, which brings along with it a bunch of other needed functions. So here are a bunch of stubs, along with another file's worth of passing tests. (Based on a patch from Dean.)
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@921 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@634 0039d316-1c4b-4281-b951-d872f2087c98
|
|
* add file_util_posix.cc to mac port (NOTE: untested on linux)
* a bit of cleanup in path_service.cc related to this
* a few more cleanups to file_util.cc to make it build for mac
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@589 0039d316-1c4b-4281-b951-d872f2087c98
|