projects
/
akaros.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port tests/timerfd.c
[akaros.git]
/
tests
/
ping.c
diff --git
a/tests/ping.c
b/tests/ping.c
index
50399da
..
bc0e707
100644
(file)
--- a/
tests/ping.c
+++ b/
tests/ping.c
@@
-7,19
+7,19
@@
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
-#include <parlib.h>
+#include <parlib
/parlib
.h>
#include <unistd.h>
#include <signal.h>
#include <unistd.h>
#include <signal.h>
-#include <iplib.h>
-#include <icmp.h>
+#include <iplib
/iplib
.h>
+#include <i
plib/i
cmp.h>
#include <ctype.h>
#include <pthread.h>
#include <ctype.h>
#include <pthread.h>
-#include <spinlock.h>
-#include <timing.h>
-#include <tsc-compat.h>
-#include <printf-ext.h>
-#include <alarm.h>
-#include <ndb.h>
+#include <
parlib/
spinlock.h>
+#include <
parlib/
timing.h>
+#include <
parlib/
tsc-compat.h>
+#include <p
arlib/p
rintf-ext.h>
+#include <
benchutil/
alarm.h>
+#include <ndb
lib/ndb
.h>
#define NR_MSG 4
#define SLEEPMS 1000
#define NR_MSG 4
#define SLEEPMS 1000
@@
-268,7
+268,7
@@
sender(int fd, int msglen, int interval, int n)
if(pingrint != 0)
extra = rand();
/* uth_sleep takes seconds, interval is in ms */
if(pingrint != 0)
extra = rand();
/* uth_sleep takes seconds, interval is in ms */
- uthread_
sleep((interval + extra) /
1000);
+ uthread_
usleep((interval + extra) *
1000);
}
r = calloc(sizeof *r, 1);
if (r == NULL){
}
r = calloc(sizeof *r, 1);
if (r == NULL){
@@
-592,7
+592,7
@@
int main(int argc, char **argv)
proto = &v6pr;
ds = netmkaddr(argv[0], proto->net, "1");
printf("ping: dial %s\n", ds);
proto = &v6pr;
ds = netmkaddr(argv[0], proto->net, "1");
printf("ping: dial %s\n", ds);
- fd = dial
(ds
, 0, 0, 0);
+ fd = dial
9(ds, 0
, 0, 0, 0);
if(fd < 0){
fprintf(stderr, "%s: couldn't dial %s: %r\n", argv0, ds);
exit(1);
if(fd < 0){
fprintf(stderr, "%s: couldn't dial %s: %r\n", argv0, ds);
exit(1);