Annotation of researchv9/cmd/procmount.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: 
        !             3: #define GMOUNT 49
        !             4: #define MOUNT  0
        !             5: #define UNMOUNT        1
        !             6: 
        !             7: extern int errno;
        !             8: 
        !             9: int mntfstyp = 2;
        !            10: char mntdir[] = "/proc";
        !            11: 
        !            12: main(argc, argv)
        !            13: char **argv;
        !            14: {
        !            15:        register flag, n;
        !            16: 
        !            17:        flag = (argc > 1) ? UNMOUNT : MOUNT;
        !            18:        if (n = syscall(GMOUNT, mntfstyp, mntdir, flag)) {
        !            19:                printf("gmount(%d, \"%s\", %d) returned %d, errno = %d\n",
        !            20:                        mntfstyp, mntdir, flag, n, errno);
        !            21:                perror("gmount");
        !            22:        } else {
        !            23:                if (flag == MOUNT)
        !            24:                        printf("fstyp = %d mounted on %s\n", mntfstyp, mntdir);
        !            25:                else
        !            26:                        printf("fstyp = %d unmounted from %s\n", mntfstyp, mntdir);
        !            27:        }
        !            28:        exit(0);
        !            29: }

unix.superglobalmegacorp.com

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