Changeset 1799 for zzuf


Ignore:
Timestamp:
Jul 10, 2007, 4:26:08 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Rename ZZUF_RLIMIT_CONST into ZZUF_RLIMIT_MEM because we're going to have the _CPU one as well.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzuf.c

    r1796 r1799  
    7777
    7878#if defined RLIMIT_AS
    79 #   define ZZUF_RLIMIT_CONST RLIMIT_AS
     79#   define ZZUF_RLIMIT_MEM RLIMIT_AS
    8080#elif defined RLIMIT_VMEM
    81 #   define ZZUF_RLIMIT_CONST RLIMIT_VMEM
     81#   define ZZUF_RLIMIT_MEM RLIMIT_VMEM
    8282#elif defined RLIMIT_DATA
    83 #   define ZZUF_RLIMIT_CONST RLIMIT_DATA
     83#   define ZZUF_RLIMIT_MEM RLIMIT_DATA
    8484#else
    85 #   undef HAVE_SETRLIMIT
     85#   undef ZZUF_RLIMIT_MEM
     86#endif
     87
     88#if defined RLIMIT_CPU
     89#   define ZZUF_RLIMIT_CPU RLIMIT_CPU
     90#else
     91#   undef ZZUF_RLIMIT_CPU
    8692#endif
    8793
     
    152158#   define OPTSTR_REGEX ""
    153159#endif
    154 #if defined HAVE_SETRLIMIT
    155 #   define OPTSTR_RLIMIT "M:"
     160#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
     161#   define OPTSTR_RLIMIT_MEM "M:"
    156162#else
    157 #   define OPTSTR_RLIMIT ""
    158 #endif
    159 #define OPTSTR OPTSTR_REGEX OPTSTR_RLIMIT \
     163#   define OPTSTR_RLIMIT_MEM ""
     164#endif
     165#define OPTSTR OPTSTR_REGEX OPTSTR_RLIMIT_MEM \
    160166            "Ab:B:C:dD:f:F:imnp:P:qr:R:s:ST:vxhV"
    161167#define MOREINFO "Try `%s --help' for more information.\n"
     
    267273            opts->md5 = 1;
    268274            break;
    269 #if defined HAVE_SETRLIMIT
     275#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    270276        case 'M': /* --max-memory */
    271277            setenv("ZZUF_MEMORY", "1", 1);
     
    891897#endif
    892898
    893 #if defined HAVE_SETRLIMIT
     899#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    894900    if(opts->maxmem >= 0)
    895901    {
     
    897903        rlim.rlim_cur = opts->maxmem * 1000000;
    898904        rlim.rlim_max = opts->maxmem * 1000000;
    899         setrlimit(ZZUF_RLIMIT_CONST, &rlim);
     905        setrlimit(ZZUF_RLIMIT_MEM, &rlim);
    900906    }
    901907#endif
     
    11041110#endif
    11051111    printf("              [-f fuzzing] [-D delay] [-F forks] [-C crashes] [-B bytes]\n");
    1106 #if defined HAVE_SETRLIMIT
     1112#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    11071113    printf("              [-T seconds] [-M bytes] [-b ranges] [-P protect] [-R refuse]\n");
    11081114#else
     
    11391145#endif
    11401146    printf("  -m, --md5                 compute the output's MD5 hash\n");
    1141 #if defined HAVE_SETRLIMIT
     1147#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    11421148    printf("  -M, --max-memory <n>      maximum child virtual memory size in MB\n");
    11431149#endif
Note: See TracChangeset for help on using the changeset viewer.