Annotation of xinu/sys/shell/x_date.c, revision 1.1

1.1     ! root        1: /* x_date.c - x_date */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <sleep.h>
        !             6: #include <date.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  x_date  -  (command date) print the date and time
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: COMMAND        x_date(stdin, stdout, stderr, nargs, args)
        !            13: int    stdin, stdout, stderr, nargs;
        !            14: char   *args[];
        !            15: {
        !            16:        long    now;
        !            17:        char    str[80];
        !            18: 
        !            19:        if (nargs == 2)
        !            20:                clktime = 0L;
        !            21:        gettime(&now);
        !            22:        ascdate(now, str);
        !            23:        strcat(str, "\n");
        !            24:        write(stdout, str, strlen(str));
        !            25:        return(OK);
        !            26: }

unix.superglobalmegacorp.com

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