#include <u.h>
#include <libc.h>
void
main(int argc, char **argv)
{
int f, g, rc;
if(argc != 2 && argc != 3)
sysfatal("usage: %s target [local]\n", argv[0]);
f = open("/dev/kmesg", OREAD);
if(f < 0) sysfatal("open /dev/kmesg: %r");
g = dial(argv[1], argv[2], 0, 0);
if(g < 0) sysfatal("dialing %s: %r", argv[1]);
while(1) {
char buf[512];
rc = read(f, buf, sizeof buf);
if(rc == 0) sleep(1);
if(rc > 0)
write(g, buf, rc);
}
}
|