File:  [XINU] / xinu / sys / unmount.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:02 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* unmount.c - unmount */

#include <conf.h>
#include <kernel.h>
#include <name.h>

/*------------------------------------------------------------------------
 *  unmount  -  remove an entry from the name prefix mapping table
 *------------------------------------------------------------------------
 */
SYSCALL	unmount(prefix)
char	*prefix;
{
	struct	nament	*nptr;
	PStype	ps;
	int	i;

	if (prefix == NULL)
		prefix = NULLSTR;
	else if (strlen(prefix) >= NAMPLEN)
		return(SYSERR);
	disable(ps);
	for (i=0 ; i<Nam.nnames ; i++) {
		nptr = &Nam.nametab[i];
		if (strcmp(prefix, nptr->npre) == 0) {
			for(Nam.nnames-- ; i<Nam.nnames ; i++)
				Nam.nametab[i] = Nam.nametab[i+1];
			restore(ps);
			return(OK);
		}
	}
	restore(ps);
	return(SYSERR);
}

unix.superglobalmegacorp.com

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