Annotation of lucent/sys/src/9/boot/datakit.c, revision 1.1.1.1

1.1       root        1: #include <u.h>
                      2: #include <libc.h>
                      3: #include <../boot/boot.h>
                      4: 
                      5: static void
                      6: configdkconc(char *ctl, char *arg)
                      7: {
                      8:        int cfd;
                      9:        char buf[1024], *p;
                     10: /*
                     11:        if(fork() == 0){
                     12:                cfd = open("#c/klog", OREAD);
                     13:                while((n = read(cfd, buf, sizeof buf)) > 0)
                     14:                        if(write(1, buf, n) < 0)
                     15:                                break;
                     16:                _exits(0);
                     17:        }
                     18: */
                     19:        p = strchr(arg, ';');
                     20:        cfd = open(ctl, ORDWR);
                     21:        if(arg == 0 || p == 0 || cfd < 0){
                     22:                sprint(buf, "opening %s", ctl);
                     23:                fatal(buf);
                     24:        }
                     25:        *p++ = 0;
                     26:        sendmsg(cfd, "push conc");
                     27:        sendmsg(cfd, arg);
                     28:        close(cfd);
                     29:        ctl = "#Kconc/conc/0/ctl";
                     30:        cfd = open(ctl, ORDWR);
                     31:        if(cfd < 0){
                     32:                sprint(buf, "opening %s", ctl);
                     33:                fatal(buf);
                     34:        }
                     35:        sendmsg(cfd, "push dkmux");
                     36:        sendmsg(cfd, p);
                     37:        close(cfd);
                     38: }
                     39: 
                     40: static void
                     41: configdatakit(char *ctl, char *arg)
                     42: {
                     43:        int cfd;
                     44:        char buf[64];
                     45: 
                     46:        cfd = open(ctl, ORDWR);
                     47:        if(arg == 0 || cfd < 0){
                     48:                sprint(buf, "opening %s", ctl);
                     49:                fatal(buf);
                     50:        }
                     51:        sendmsg(cfd, "push dkmux");
                     52:        sendmsg(cfd, arg);
                     53:        close(cfd);
                     54: }
                     55: 
                     56: void
                     57: confighs(Method *mp)
                     58: {
                     59:        configdatakit("#h/ctl", mp->arg);
                     60: }
                     61: 
                     62: int
                     63: authhs(void)
                     64: {
                     65:        return dkauth();
                     66: }
                     67: 
                     68: int
                     69: connecths(void)
                     70: {
                     71:        return dkconnect();
                     72: }
                     73: 
                     74: void
                     75: configincon(Method *mp)
                     76: {
                     77:        configdatakit("#i/ctl", mp->arg);
                     78: }
                     79: 
                     80: int
                     81: authincon(void)
                     82: {
                     83:        return dkauth();
                     84: }
                     85: 
                     86: int
                     87: connectincon(void)
                     88: {
                     89:        return dkconnect();
                     90: }
                     91: 
                     92: void
                     93: configcincon(Method *mp)
                     94: {
                     95:        configdkconc("#i/ctl", mp->arg);
                     96: }
                     97: 
                     98: int
                     99: authcincon(void)
                    100: {
                    101:        return dkauth();
                    102: }
                    103: 
                    104: int
                    105: connectcincon(void)
                    106: {
                    107:        return dkconnect();
                    108: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.