Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Change mknodat(2) device argument type from uint32_t to dev_t.



details:   https://anonhg.NetBSD.org/src/rev/8f12e523801c
branches:  trunk
changeset: 790557:8f12e523801c
user:      njoly <njoly%NetBSD.org@localhost>
date:      Thu Oct 17 18:01:11 2013 +0000

description:
Change mknodat(2) device argument type from uint32_t to dev_t.
Adds needed extra PAD argument for 64bit alignment, and libc wrapper.

diffstat:

 lib/libc/sys/Makefile.inc           |   6 ++--
 lib/libc/sys/mknodat.c              |  41 +++++++++++++++++++++++++++++++++++++
 sys/compat/netbsd32/netbsd32_fs.c   |   8 ++++--
 sys/compat/netbsd32/syscalls.master |   6 ++--
 sys/kern/syscalls.master            |   4 +-
 sys/kern/vfs_syscalls.c             |   7 +++--
 sys/sys/stat.h                      |   4 +-
 7 files changed, 60 insertions(+), 16 deletions(-)

diffs (191 lines):

diff -r 86be51f84c81 -r 8f12e523801c lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Thu Oct 17 17:22:59 2013 +0000
+++ b/lib/libc/sys/Makefile.inc Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.219 2013/03/29 02:10:53 christos Exp $
+#      $NetBSD: Makefile.inc,v 1.220 2013/10/17 18:01:11 njoly Exp $
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -31,7 +31,7 @@
 # glue to provide compatibility between GCC 1.X and 2.X and for compat
 # with old syscall interfaces.
 GLUE+= ftruncate.c lseek.c mmap.c pread.c preadv.c pwrite.c \
-       pwritev.c truncate.c ntp_adjtime.c
+       pwritev.c truncate.c ntp_adjtime.c mknodat.c
 
 GLUE50+= adjtime.c clock_settime.c settimeofday.c
 
@@ -108,7 +108,7 @@
                _lwp_wakeup.S _lwp_detach.S _lwp_setprivate.S \
                _lwp_setname.S _lwp_getname.S _lwp_ctl.S \
        madvise.S mincore.S minherit.S mkdir.S mkdirat.S mkfifo.S mkfifoat.S \
-               __mknod50.S mknodat.S mlock.S mlockall.S modctl.S __mount50.S \
+               __mknod50.S mlock.S mlockall.S modctl.S __mount50.S \
                mprotect.S __msgctl50.S msgget.S munlock.S munlockall.S \
                munmap.S \
        nfssvc.S __ntp_gettime50.S \
diff -r 86be51f84c81 -r 8f12e523801c lib/libc/sys/mknodat.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/sys/mknodat.c    Thu Oct 17 18:01:11 2013 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: mknodat.c,v 1.1 2013/10/17 18:01:11 njoly Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly <njoly%NetBSD.org@localhost>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+int __mknodat(int, const char *, mode_t, int, dev_t);
+
+int
+mknodat(int fd, const char *path, mode_t mode, dev_t dev)
+{
+       return __mknodat(fd, path, mode, 0, dev);
+}
diff -r 86be51f84c81 -r 8f12e523801c sys/compat/netbsd32/netbsd32_fs.c
--- a/sys/compat/netbsd32/netbsd32_fs.c Thu Oct 17 17:22:59 2013 +0000
+++ b/sys/compat/netbsd32/netbsd32_fs.c Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_fs.c,v 1.68 2013/07/30 17:22:31 njoly Exp $   */
+/*     $NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $   */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.68 2013/07/30 17:22:31 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1063,13 +1063,15 @@
                syscallarg(int) fd;
                syscallarg(netbsd32_charp) path;
                syscallarg(mode_t) mode;
-               syscallarg(uint32_t) dev;
+               syscallarg(int) pad;
+               syscallarg(netbsd32_dev_t) dev;
        } */
        struct sys_mknodat_args ua;
 
        NETBSD32TO64_UAP(fd);
        NETBSD32TOP_UAP(path, const char);
        NETBSD32TO64_UAP(mode);
+       NETBSD32TO64_UAP(PAD);
        NETBSD32TO64_UAP(dev);
 
        return sys_mknodat(l, &ua, retval);
diff -r 86be51f84c81 -r 8f12e523801c sys/compat/netbsd32/syscalls.master
--- a/sys/compat/netbsd32/syscalls.master       Thu Oct 17 17:22:59 2013 +0000
+++ b/sys/compat/netbsd32/syscalls.master       Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.97 2013/03/29 01:04:30 christos Exp $
+       $NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp $
 
 ;      from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
@@ -976,8 +976,8 @@
                            mode_t mode); }
 460    STD             { int|netbsd32||mknodat(int fd, \
                            const netbsd32_charp path, \
-                           mode_t mode, \
-                           uint32_t dev); }
+                           mode_t mode, int PAD, \
+                           netbsd32_dev_t dev); }
 461    STD             { int|netbsd32||mkdirat(int fd, \
                            const netbsd32_charp path, \
                            mode_t mode); }
diff -r 86be51f84c81 -r 8f12e523801c sys/kern/syscalls.master
--- a/sys/kern/syscalls.master  Thu Oct 17 17:22:59 2013 +0000
+++ b/sys/kern/syscalls.master  Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.263 2013/08/30 10:33:10 pooka Exp $
+       $NetBSD: syscalls.master,v 1.264 2013/10/17 18:01:11 njoly Exp $
 
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
 
@@ -902,7 +902,7 @@
 459    STD  RUMP       { int|sys||mkfifoat(int fd, const char *path, \
                            mode_t mode); }
 460    STD  RUMP       { int|sys||mknodat(int fd, const char *path, \
-                           mode_t mode, uint32_t dev); }
+                           mode_t mode, int PAD, dev_t dev); }
 461    STD  RUMP       { int|sys||mkdirat(int fd, const char *path, \
                            mode_t mode); }
 462    STD  RUMP       { int|sys||faccessat(int fd, const char *path, \
diff -r 86be51f84c81 -r 8f12e523801c sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Thu Oct 17 17:22:59 2013 +0000
+++ b/sys/kern/vfs_syscalls.c   Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.467 2013/07/20 15:55:57 njoly Exp $ */
+/*     $NetBSD: vfs_syscalls.c,v 1.468 2013/10/17 18:01:11 njoly Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.467 2013/07/20 15:55:57 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.468 2013/10/17 18:01:11 njoly Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -2162,7 +2162,8 @@
                syscallarg(int) fd;
                syscallarg(const char *) path;
                syscallarg(mode_t) mode;
-               syscallarg(uint32_t) dev;
+               syscallarg(int) pad;
+               syscallarg(dev_t) dev;
        } */
 
        return do_sys_mknodat(l, SCARG(uap, fd), SCARG(uap, path), 
diff -r 86be51f84c81 -r 8f12e523801c sys/sys/stat.h
--- a/sys/sys/stat.h    Thu Oct 17 17:22:59 2013 +0000
+++ b/sys/sys/stat.h    Thu Oct 17 18:01:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stat.h,v 1.67 2013/10/09 09:38:21 njoly Exp $  */
+/*     $NetBSD: stat.h,v 1.68 2013/10/17 18:01:11 njoly Exp $  */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -278,7 +278,7 @@
 int     fstatat(int, const char *, struct stat *, int);
 int     mkdirat(int, const char *, mode_t);
 int     mkfifoat(int, const char *, mode_t);
-int     mknodat(int, const char *, mode_t, uint32_t);
+int     mknodat(int, const char *, mode_t, dev_t);
 int     utimensat(int, const char *, const struct timespec *, int);
 #endif
 



Home | Main Index | Thread Index | Old Index