1 /*
2  * mknodat() for uClibc
3  *
4  * Copyright (C) 2009 Analog Devices Inc.
5  *
6  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7  */
8 
9 #include <sys/syscall.h>
10 #include <sys/stat.h>
11 
12 #ifdef __NR_mknodat
mknodat(int fd,const char * path,mode_t mode,dev_t dev)13 int mknodat(int fd, const char *path, mode_t mode, dev_t dev)
14 {
15 	unsigned long long int k_dev;
16 
17 	/* We must convert the value to dev_t type used by the kernel.  */
18 	k_dev = (dev) & ((1ULL << 32) - 1);
19 
20 	return INLINE_SYSCALL(mknodat, 4, fd, path, mode, (unsigned int)k_dev);
21 }
22 libc_hidden_def(mknodat)
23 #else
24 /* should add emulation with mknod() and /proc/self/fd/ ... */
25 #endif
26