Changeset 1740


Ignore:
Timestamp:
Feb 8, 2007, 6:23:48 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • Handle architectures that don't have RLIMIT_AS (like OpenBSD).
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/doc/zzuf.1

    r1720 r1740  
    144144
    145145\fBzzuf\fR uses the \fBsetrlimit\fR() call to set memory usage limitations and
    146 relies on the operating system's ability to enforce such limitations.
     146relies on the operating system's ability to enforce such limitations. This
     147option is not available on the OpenBSD system.
    147148.TP
    148149\fB\-n\fR, \fB\-\-network\fR
  • zzuf/trunk/src/zzuf.c

    r1736 r1740  
    7474#if !defined SIGKILL
    7575#   define SIGKILL 9
     76#endif
     77
     78#if defined RLIMIT_AS
     79#   define ZZUF_RLIMIT_CONST RLIMIT_AS
     80#elif defined RLIMIT_VMEM
     81#   define ZZUF_RLIMIT_CONST RLIMIT_VMEM
     82#else
     83#   undef HAVE_SETRLIMIT
    7684#endif
    7785
     
    573581            rlim.rlim_cur = opts->maxmem * 1000000;
    574582            rlim.rlim_max = opts->maxmem * 1000000;
    575             setrlimit(RLIMIT_AS, &rlim);
     583            setrlimit(ZZUF_RLIMIT_CONST, &rlim);
    576584        }
    577585#endif
Note: See TracChangeset for help on using the changeset viewer.