9front tools and scripts

drawterm

on 9 side

#!/bin/rc
auth/factotum -n
echo 'key proto=dp9ik dom=9front user=glenda !password=999999999' > /mnt/factotum/ctl
aux/listen1 -t tcp!*!rcpu /rc/bin/service/tcp17019 -R

on *nix system

drawterm -h youriphere -u user

simple C example

#include <u.h>
#include <libc.h>

void
main(int argc, char *argv[])
{
    /* output */
    print("hello\n");
    fprint(2, "error message\n");

    /* variables */
    int i;
    char *s = "string";
    char buf[1024];

    /* file work */
    int fd = open("file", OREAD);
    if(fd < 0) {
        fprint(2, "can't open: %r\n");
        exits("open failed");
    }
    read(fd, buf, sizeof(buf));
    close(fd);

    /* end */
    exits(0);
}