summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/con.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2022-06-07 22:38:04 +0000
committerOri Bernstein <ori@eigenstate.org>2022-06-07 22:38:04 +0000
commit4eeefed7b0c1c47329213f1da719820ebbbebf18 (patch)
tree5a26470746cd117ac61b2e2d7c090a18a8fb3581 /sys/src/cmd/cwfs/con.c
parent13065e16b3c4fba4d9200ed7fec89ee49338f12a (diff)
cwfs: fix iounit negotiation
cwfs had an issue with iounit negotiation as a result of the conversion to 9p2000 -- with the move to variable size messages, the fixed message overhead decreased, but the advertised message size was still adding the old fixed overhead. This meant that if the kernel negotiated the maximum io size, cwfs would negotiate something larger than it supported, and would hang up when an io of that size was made. In addition, the size of messages was stored in a short, which means that negotiating an iounit larger than 16384 bytes would overflow the message count, and cause things to fall over. Finally, whle we're here, we clean up some duplicated and unused constants.
Diffstat (limited to 'sys/src/cmd/cwfs/con.c')
-rw-r--r--sys/src/cmd/cwfs/con.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/cmd/cwfs/con.c b/sys/src/cmd/cwfs/con.c
index 2b418d8c6..d604f9241 100644
--- a/sys/src/cmd/cwfs/con.c
+++ b/sys/src/cmd/cwfs/con.c
@@ -711,9 +711,9 @@ cmd_time(int argc, char *argv[])
{
int i, len;
char *cmd;
- Timet t1, t2;
+ vlong t1, t2;
- t1 = time(nil);
+ t1 = nsec();
len = 0;
for(i=1; i<argc; i++)
len += 1 + strlen(argv[i]);
@@ -724,9 +724,9 @@ cmd_time(int argc, char *argv[])
strcat(cmd, argv[i]);
}
cmd_exec(cmd);
- t2 = time(nil);
+ t2 = nsec();
free(cmd);
- print("time = %ld ms\n", TK2MS(t2-t1));
+ print("time = %lld ns\n", t2-t1);
}
void