diff options
author | Eric Dumazet <edumazet@google.com> | 2015-01-30 07:50:43 -0800 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2015-01-30 16:54:47 +0100 |
commit | 319840b83b70b49705928687dcbd40653709e305 (patch) | |
tree | 0b364897eea1e8ed52b4c9da876282ee949f693e /trafgen.c | |
parent | e6890cb3e59ec4bdbe57e999592b9488fcfa1f80 (diff) |
trafgen: disable timer slack
linux has default time slack of 50 usec, which means that trafgen
'gap' option is unable to precisely control delays.
Set the process timer slack to the minimum of 1 nsec.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'trafgen.c')
-rw-r--r-- | trafgen.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -14,6 +14,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <sys/fsuid.h> +#include <sys/prctl.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/wait.h> @@ -957,6 +958,7 @@ int main(int argc, char **argv) case 't': slow = true; ptr = optarg; + prctl(PR_SET_TIMERSLACK, 1UL); gap = strtoul(optarg, NULL, 0); for (j = i = strlen(optarg); i > 0; --i) { |