xref: /minix3/minix/lib/libc/sys/mknod.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include <sys/cdefs.h>
2*433d6423SLionel Sambuc #include "namespace.h"
3*433d6423SLionel Sambuc #include <lib.h>
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #include <string.h>
6*433d6423SLionel Sambuc #include <stdlib.h>
7*433d6423SLionel Sambuc #include <unistd.h>
8*433d6423SLionel Sambuc #include <sys/stat.h>
9*433d6423SLionel Sambuc 
mknod(const char * name,mode_t mode,dev_t dev)10*433d6423SLionel Sambuc int mknod(const char *name, mode_t mode, dev_t dev)
11*433d6423SLionel Sambuc {
12*433d6423SLionel Sambuc   message m;
13*433d6423SLionel Sambuc 
14*433d6423SLionel Sambuc   memset(&m, 0, sizeof(m));
15*433d6423SLionel Sambuc   m.m_lc_vfs_mknod.len = strlen(name) + 1;
16*433d6423SLionel Sambuc   m.m_lc_vfs_mknod.mode = mode;
17*433d6423SLionel Sambuc   m.m_lc_vfs_mknod.device = dev;
18*433d6423SLionel Sambuc   m.m_lc_vfs_mknod.name = (vir_bytes)name;
19*433d6423SLionel Sambuc   return(_syscall(VFS_PROC_NR, VFS_MKNOD, &m));
20*433d6423SLionel Sambuc }
21*433d6423SLionel Sambuc 
22*433d6423SLionel Sambuc #if defined(__minix) && defined(__weak_alias)
23*433d6423SLionel Sambuc __weak_alias(mknod, __mknod50)
24*433d6423SLionel Sambuc #endif
25