* Handle architectures that don't have RLIMIT_AS (like OpenBSD).
This commit is contained in:
parent
b79efda114
commit
e551756f05
@ -143,7 +143,8 @@ memory. The value should set reasonably high so as not to interfer with normal
|
|||||||
program operation.
|
program operation.
|
||||||
|
|
||||||
\fBzzuf\fR uses the \fBsetrlimit\fR() call to set memory usage limitations and
|
\fBzzuf\fR uses the \fBsetrlimit\fR() call to set memory usage limitations and
|
||||||
relies on the operating system's ability to enforce such limitations.
|
relies on the operating system's ability to enforce such limitations. This
|
||||||
|
option is not available on the OpenBSD system.
|
||||||
.TP
|
.TP
|
||||||
\fB\-n\fR, \fB\-\-network\fR
|
\fB\-n\fR, \fB\-\-network\fR
|
||||||
Fuzz the application's network input. By default \fBzzuf\fR only fuzzes files.
|
Fuzz the application's network input. By default \fBzzuf\fR only fuzzes files.
|
||||||
|
|||||||
10
src/zzuf.c
10
src/zzuf.c
@ -75,6 +75,14 @@
|
|||||||
# define SIGKILL 9
|
# define SIGKILL 9
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined RLIMIT_AS
|
||||||
|
# define ZZUF_RLIMIT_CONST RLIMIT_AS
|
||||||
|
#elif defined RLIMIT_VMEM
|
||||||
|
# define ZZUF_RLIMIT_CONST RLIMIT_VMEM
|
||||||
|
#else
|
||||||
|
# undef HAVE_SETRLIMIT
|
||||||
|
#endif
|
||||||
|
|
||||||
/* We use file descriptor 17 as the debug channel */
|
/* We use file descriptor 17 as the debug channel */
|
||||||
#define DEBUG_FILENO 17
|
#define DEBUG_FILENO 17
|
||||||
#define DEBUG_FILENO_STR "17"
|
#define DEBUG_FILENO_STR "17"
|
||||||
@ -572,7 +580,7 @@ static void spawn_children(struct opts *opts)
|
|||||||
struct rlimit rlim;
|
struct rlimit rlim;
|
||||||
rlim.rlim_cur = opts->maxmem * 1000000;
|
rlim.rlim_cur = opts->maxmem * 1000000;
|
||||||
rlim.rlim_max = opts->maxmem * 1000000;
|
rlim.rlim_max = opts->maxmem * 1000000;
|
||||||
setrlimit(RLIMIT_AS, &rlim);
|
setrlimit(ZZUF_RLIMIT_CONST, &rlim);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user