summaryrefslogtreecommitdiffstats
path: root/base/process_util_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* Add memory stats for linux page cycler. On linux, we collecttc@google.com2009-05-111-0/+20
| | | | | | | | | the final RSS size and the total VM size. Review URL: http://codereview.chromium.org/113217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15814 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Add a macro for handling EINTR.agl@chromium.org2009-05-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 PPID is in kp_eproc, not kp_proc. (The field we were previously looking ↵avi@google.com2009-04-231-1/+1
| | | | | | | | at was always zero.) Review URL: http://codereview.chromium.org/96009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14316 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in chrome/browserphajdan.jr@chromium.org2009-03-251-1/+1
| | | | | | | | | | - make more things const - remove unreferenced declaration of GetGoButton - fix indentation in one place Review URL: http://codereview.chromium.org/53053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12475 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-6/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-5/+5
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite the mac named process iterator:thomasvl@chromium.org2009-02-061-67/+103
| | | | | | | | | | - 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
* Implement NamedProcessIterator in base/process_util_mac.mm. Patch by Naokimark@chromium.org2009-02-051-14/+104
| | | | | | | | | 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
* Use _NSGetEnviron instead of environ (see "man environ"). environ isn'tmark@chromium.org2009-02-031-5/+2
| | | | | | | | available in a dylib, and with this change, gyp/xcode is able to build libbase as a dylib. Review URL: http://codereview.chromium.org/21019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9089 0039d316-1c4b-4281-b951-d872f2087c98
* Add routine to close file descriptors on execjeremy@chromium.org2009-01-291-7/+1
| | | | | | | | 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
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-12/+52
| | | | | | | | | | | | * 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
* Reverting 7156.ojan@google.com2008-12-171-52/+12
| | | | | | | 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
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-12/+52
| | | | | | | | | | | | * 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
* Don't require tlslite to be installed, just use what's in the treemark@chromium.org2008-12-111-1/+5
| | | | | | Review URL: http://codereview.chromium.org/13745 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6794 0039d316-1c4b-4281-b951-d872f2087c98
* * Add timeout support to POSIX WaitForSingleProcess()jeremy@chromium.org2008-12-051-7/+0
| | | | | | | | * Unify Linux & Mac implementations of WaitForSingleProcess() Review URL: http://codereview.chromium.org/12969 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6416 0039d316-1c4b-4281-b951-d872f2087c98
* Add url_request_unittest to mac build.ericroman@google.com2008-11-191-6/+21
| | | | | | Review URL: http://codereview.chromium.org/11224 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5712 0039d316-1c4b-4281-b951-d872f2087c98
* More Mac & Linux fixes for base namespaces.brettw@google.com2008-11-141-2/+2
| | | | | | Review URL: http://codereview.chromium.org/10739 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5450 0039d316-1c4b-4281-b951-d872f2087c98
* make sure we match all the tests and files that linux has running. We were ↵pinkerton@google.com2008-11-111-0/+5
| | | | | | | | never building process_posix, but now the newly added unit tests use it. Review URL: http://codereview.chromium.org/10221 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5175 0039d316-1c4b-4281-b951-d872f2087c98
* Enable stats_tabe_unittest.cc on OS X.jeremy@chromium.org2008-10-271-0/+61
Review URL: http://codereview.chromium.org/8160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4024 0039d316-1c4b-4281-b951-d872f2087c98