/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1989-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Eduardo Krell <ekrell@adexus.cl> *
* *
***********************************************************************/
#pragma prototyped
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#else
#define mkdir ______mkdir
#endif
#include "3d.h"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
#else
#endif
/*
* mkdir() will always create a directory on the highest layer
* mkdir() will create intermediate directories if they virtually exist
* mkdir() will do a chdir() if a virtual dot directory is created
*/
int
{
register char* sp;
register char* cp;
register int r;
#if FS
#endif
{
#if FS
mp = 0;
#endif
}
#if FS
#endif
else
{
#if FS
#endif
return(-1);
}
if (state.path.level || state.level && (sp == state.pwd || streq(sp, state.pwd)) || (r = MKDIR(sp, mode)) && errno == ENOENT)
{
/*
* copy canonicalized pathname into buf
*/
if (*sp != '/')
{
/*
* create intermediate dirs if they exist in lower view
*/
char* a;
char* b;
int oerrno;
a = tmp;
b = buf;
while (*a++ = *b++);
*b = 0;
for (;;)
{
return -1;
}
}
/*
* ok to create intermediate dirs
*/
do
{
while (*--cp != '/');
*cp = 0;
*cp = '/';
} while (r);
*cp = '/';
do
{
r = *++cp;
if (r == 0 || r == '/')
{
*cp = 0;
*cp = r;
if (!sp) return(-1);
#if FS
#endif
{
}
}
} while (*cp);
}
#if FS
if (!r)
{
}
#endif
return(r);
}
/*
* 3d internal mkdir to skip pathreal(path, ...)
*/
int
{
int r;
return(r);
}