mirror of
https://passt.top/passt
synced 2025-05-25 10:35:35 +02:00
pcap: Use clock_gettime() instead of gettimeofday()
POSIX.1-2008 declared gettimeofday() as obsolete, but I'm a dinosaur. Usually, C libraries translate that to the clock_gettime() system call anyway, but this doesn't happen in Jon's environment, and, there, seccomp happily kills pasta(1) when started with --pcap, because we didn't add gettimeofday() to our seccomp profiles. Use clock_gettime() instead. Reported-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
0761f29a14
commit
3fe9878db7
2 changed files with 14 additions and 13 deletions
1
util.h
1
util.h
|
@ -40,6 +40,7 @@
|
|||
#endif
|
||||
|
||||
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||
#define DIV_ROUND_CLOSEST(n, d) (((n) + (d) / 2) / (d))
|
||||
#define ROUND_DOWN(x, y) ((x) & ~((y) - 1))
|
||||
#define ROUND_UP(x, y) (((x) + (y) - 1) & ~((y) - 1))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue