windows-nt/Source/XPSP1/NT/base/subsys/posix/programs/bsdlib/mknod.c

24 lines
412 B
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
/*
* MKNOD: DF_MSS
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
int mknod (const char *path, mode_t mode, int dev)
{
int ret;
if ((mode & S_IFMT) == S_IFDIR)
ret = mkdir(path, (mode & S_IFMT));
else if ((mode & S_IFMT) == S_IFIFO)
ret = mkfifo(path, (mode & S_IFMT));
else {
errno = EPERM;
ret = -1;
}
return ret;
}