Annotation of xinu/sys/rename.c, revision 1.1

1.1     ! root        1: /* rename.c - rename */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <file.h>
        !             6: #include <name.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  rename  -  rename a file (key is optional)
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: SYSCALL        rename(old, new)
        !            13: char   *old;
        !            14: char   *new;
        !            15: {
        !            16:        char    fullold[NAMLEN];
        !            17:        char    fullnew[NAMLEN];
        !            18:        struct  devsw   *devptr;
        !            19:        int     dev, dev2;
        !            20: 
        !            21:        /* map names through namespace and restrict to single device */
        !            22: 
        !            23:        if ( (dev = nammap(old, fullold)) == SYSERR ||
        !            24:             (dev2= nammap(new, fullnew)) == SYSERR ||
        !            25:              dev != dev2)
        !            26:                        return(SYSERR);
        !            27:        devptr = &devtab[dev];
        !            28:        return( (*devptr->dvcntl)(devptr,FLRENAME,fullold,fullnew) );
        !            29: }

unix.superglobalmegacorp.com

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