> NetBSD: > a) setrlimit with RLIMIT_AS works. > b) No VMA iteration API exists.
Actually, on NetBSD 5.0, there is a /proc file system, like on FreeBSD. Let's extend get_rusage_as() accordingly. In practice it makes no difference, though, since iterating over /proc/curproc/maps yields the same value as the setrlimit based approach. 2011-01-23 Bruno Haible <br...@clisp.org> get-rusage-as: Improve on NetBSD. * lib/get-rusage-as.c (get_rusage_as_via_iterator): On NetBSD, use /proc, like on FreeBSD. --- lib/get-rusage-as.c.orig Sun Jan 23 20:35:07 2011 +++ lib/get-rusage-as.c Sun Jan 23 20:34:38 2011 @@ -61,7 +61,8 @@ NetBSD: a) setrlimit with RLIMIT_AS works. - b) No VMA iteration API exists. + b) The /proc/self/maps file contains a list of the virtual memory areas. + Both methods agree, OpenBSD: a) setrlimit exists, but RLIMIT_AS is not defined. @@ -328,7 +329,7 @@ /* Support for reading text files in the /proc file system. */ -#if defined __linux__ || defined __FreeBSD__ /* || defined __CYGWIN__ */ +#if defined __linux__ || defined __FreeBSD__ || defined __NetBSD__ /* || defined __CYGWIN__ */ /* Buffered read-only streams. We cannot use <stdio.h> here, because fopen() calls malloc(), and a malloc() @@ -462,7 +463,7 @@ rof_close (&rof); return total; -#elif defined __FreeBSD__ +#elif defined __FreeBSD__ || defined __NetBSD__ struct rofile rof; int c;