RSS is a reflection of the number of pages that a process has mapped.
glibc implements fopen() in terms of mmap() which means that trying
to read the number of mapped pages changes it. Switch to open().
Make changes to the process title visible to tools like `ps`.
The argv clobber technique is reasonably portable across Unices;
the common code has been moved into src/unix/proctitle.c and is used
on Linux and OS X. Other platforms will probably follow in the future.
Don't add the io watcher to the watcher queue if the requested change
is effectively a no-op, that is, when the event mask doesn't change.
The exception here is sunos because the event ports backend requires
that watched file descriptors are re-added on every turn of the event
loop.
This commit is a micro-optimization, it does not change the event
loop's observable behavior in any way.
Don't check the return value of epoll_ctl(EPOLL_CTL_DEL). When the
file descriptor is closed, we're potentially racing with another
thread and that means the errno is not a reliable indicator of
the actual error.
The other event mechanisms (kqueue, event ports) are not affected
because:
* kqueue returns either EBADF or ENOENT. Both are handled by libuv.
* event ports rearms all file descriptors on each call to port_getn().
Fixesjoyent/node#4558.