Commit Graph

9 Commits

Author SHA1 Message Date
Ben Noordhuis
b93cf8b594 linux: don't ignore OOM errors in uv_cpu_info() 2013-05-29 01:43:05 +02:00
Ben Noordhuis
31282a97e7 linux: fix memory leak in uv_cpu_info() error path
Any memory allocated to hold CPU model strings wasn't freed on error.
2013-05-29 01:43:05 +02:00
Ben Noordhuis
92c72f58bf linux: fix cpu model parsing on newer arm kernels
The format of /proc/cpuinfo on ARM kernels >= 3.8 has changed. Scan for
the string "model name" (like x86) first, "Processor" second.

Fixes #812.
2013-05-29 01:40:09 +02:00
Ben Noordhuis
cd10637d0b linux: don't use fopen() in uv_resident_set_memory()
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().
2013-04-22 08:26:53 +02:00
Ben Noordhuis
7e59f9bb53 linux: make uv_cpu_info() handle absent procfs
Return an error when reading from /proc files fails because the procfs
isn't mounted.
2013-03-02 01:48:44 +01:00
Ben Noordhuis
e89aced8d6 darwin: implement uv_set_process_title, part 2
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.
2013-02-24 03:56:02 +01:00
Ben Noordhuis
c98083ef26 unix: short-circuit on no-op io watcher changes
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.
2013-02-22 17:02:05 +01:00
Ben Noordhuis
26fa6f8031 linux: fix abort() on epoll_ctl() race condition
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().

Fixes joyent/node#4558.
2013-02-20 21:28:39 +01:00
Ben Noordhuis
b607a7fed7 linux: move files out of src/unix/linux
Flattens the source tree and simplifies the Makefile.
2013-01-29 17:07:41 +01:00