From: Andries.Brouwer@cwi.nl The patch below adds a new system call mknod64 for i386. If there are no objections I'll add it to the other architectures as well. Note that the prototype is mknod64(const char *name, int mode, unsigned int devhi, unsigned int devlo) (and not ... unsigned int major, unsigned int minor). 25-akpm/arch/i386/kernel/entry.S | 2 +- 25-akpm/fs/namei.c | 28 +++++++++++++++++++++++++--- 25-akpm/include/asm-i386/unistd.h | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff -puN arch/i386/kernel/entry.S~ia32-mknod64 arch/i386/kernel/entry.S --- 25/arch/i386/kernel/entry.S~ia32-mknod64 Tue Jun 3 11:03:47 2003 +++ 25-akpm/arch/i386/kernel/entry.S Tue Jun 3 11:04:07 2003 @@ -900,7 +900,7 @@ ENTRY(sys_call_table) .long sys_clock_gettime /* 265 */ .long sys_clock_getres .long sys_clock_nanosleep - .long sys_ni_syscall /* mknod64 */ + .long sys_mknod64 .long sys_statfs64 .long sys_fstatfs64 /* 270 */ diff -puN fs/namei.c~ia32-mknod64 fs/namei.c --- 25/fs/namei.c~ia32-mknod64 Tue Jun 3 11:03:47 2003 +++ 25-akpm/fs/namei.c Tue Jun 3 11:03:47 2003 @@ -1403,11 +1403,12 @@ int vfs_mknod(struct inode *dir, struct return error; } -asmlinkage long sys_mknod(const char __user * filename, int mode, dev_t dev) +static long +do_mknod(const char __user *filename, int mode, dev_t dev) { int error = 0; - char * tmp; - struct dentry * dentry; + char *tmp; + struct dentry *dentry; struct nameidata nd; if (S_ISDIR(mode)) @@ -1448,6 +1449,27 @@ out: return error; } +asmlinkage long +sys_mknod(const char __user *filename, int mode, unsigned int devnr) +{ + dev_t dev = devnr; + + if (dev != devnr) + return -EOVERFLOW; + return do_mknod(filename, mode, dev); +} + +asmlinkage long +sys_mknod64(const char __user *filename, int mode, + unsigned int major, unsigned int minor) +{ + dev_t dev = MKDEV(major, minor); + + if (MAJOR(dev) != major || MINOR(dev) != minor) + return -EOVERFLOW; + return do_mknod(filename, mode, dev); +} + int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) { int error = may_create(dir, dentry); diff -puN include/asm-i386/unistd.h~ia32-mknod64 include/asm-i386/unistd.h --- 25/include/asm-i386/unistd.h~ia32-mknod64 Tue Jun 3 11:03:47 2003 +++ 25-akpm/include/asm-i386/unistd.h Tue Jun 3 11:04:18 2003 @@ -273,7 +273,7 @@ #define __NR_clock_gettime (__NR_timer_create+6) #define __NR_clock_getres (__NR_timer_create+7) #define __NR_clock_nanosleep (__NR_timer_create+8) -#define __NR_for_mknod64 268 +#define __NR_mknod64 268 #define __NR_statfs64 269 #define __NR_fstatfs64 270 _