CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Sat Jan 20 08:40:37 UTC 2024 Modified Files: src/sys/compat/sys: resource.h Log Message: Now that rusage_to_rusage50() has switched from being an external function, to a static inline, we need for it to work. Not all callers provide that (and nor should they need to), so include it here. Should unbreak the builds. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/resource.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/resource.h diff -u src/sys/compat/sys/resource.h:1.6 src/sys/compat/sys/resource.h:1.7 --- src/sys/compat/sys/resource.h:1.6 Fri Jan 19 18:39:15 2024 +++ src/sys/compat/sys/resource.h Sat Jan 20 08:40:37 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: resource.h,v 1.6 2024/01/19 18:39:15 christos Exp $ */ +/* $NetBSD: resource.h,v 1.7 2024/01/20 08:40:37 kre Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -35,6 +35,7 @@ #define _COMPAT_SYS_RESOURCE_H_ #include +#include #include #include
CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Sat Jan 20 08:40:37 UTC 2024 Modified Files: src/sys/compat/sys: resource.h Log Message: Now that rusage_to_rusage50() has switched from being an external function, to a static inline, we need for it to work. Not all callers provide that (and nor should they need to), so include it here. Should unbreak the builds. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/resource.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: rin Date: Sat Jul 29 11:58:53 UTC 2023 Modified Files: src/sys/compat/sys: event.h Log Message: Sprinkle __inline to compat_100___kevent50_{fetch_changes,put_events} To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/event.h diff -u src/sys/compat/sys/event.h:1.3 src/sys/compat/sys/event.h:1.4 --- src/sys/compat/sys/event.h:1.3 Fri Jul 28 18:19:01 2023 +++ src/sys/compat/sys/event.h Sat Jul 29 11:58:53 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: event.h,v 1.3 2023/07/28 18:19:01 christos Exp $ */ +/* $NetBSD: event.h,v 1.4 2023/07/29 11:58:53 rin Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -63,7 +63,7 @@ kevent_to_kevent100(const struct kevent } #ifdef _KERNEL -static int +static __inline int compat_100___kevent50_fetch_changes(void *ctx, const struct kevent *changelist, struct kevent *changes, size_t index, int n) { @@ -88,7 +88,7 @@ leave: return error; } -static int +static __inline int compat_100___kevent50_put_events(void *ctx, struct kevent *events, struct kevent *eventlist, size_t index, int n) {
CVS commit: src/sys/compat/sys
Module Name:src Committed By: rin Date: Sat Jul 29 11:58:53 UTC 2023 Modified Files: src/sys/compat/sys: event.h Log Message: Sprinkle __inline to compat_100___kevent50_{fetch_changes,put_events} To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: riastradh Date: Mon Aug 30 08:40:00 UTC 2021 Modified Files: src/sys/compat/sys: mount.h Log Message: sys/compat: Don't clobber f_oflags with zero. Mistake was introduced in previous refactoring. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: riastradh Date: Mon Aug 30 08:40:00 UTC 2021 Modified Files: src/sys/compat/sys: mount.h Log Message: sys/compat: Don't clobber f_oflags with zero. Mistake was introduced in previous refactoring. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/mount.h diff -u src/sys/compat/sys/mount.h:1.14 src/sys/compat/sys/mount.h:1.15 --- src/sys/compat/sys/mount.h:1.14 Fri Jul 3 18:49:37 2020 +++ src/sys/compat/sys/mount.h Mon Aug 30 08:40:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.14 2020/07/03 18:49:37 jdolecek Exp $ */ +/* $NetBSD: mount.h,v 1.15 2021/08/30 08:40:00 riastradh Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -101,10 +101,12 @@ static __inline void statvfs_to_statfs12(const struct statvfs *fs, struct statfs12 *s12) { size_t i = 0; + + memset(s12, 0, sizeof(*s12)); + s12->f_type = 0; s12->f_oflags = (short)fs->f_flag; - memset(s12, 0, sizeof(*s12)); for (i = 0; i < sizeof(__nv) / sizeof(__nv[0]); i++) { if (strcmp(__nv[i].name, fs->f_fstypename) == 0) { s12->f_type = __nv[i].value;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Fri Jul 3 19:00:01 UTC 2020 Modified Files: src/sys/compat/sys: statvfs.h Log Message: sync with mount.h, always use the structure size. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/statvfs.h diff -u src/sys/compat/sys/statvfs.h:1.2 src/sys/compat/sys/statvfs.h:1.3 --- src/sys/compat/sys/statvfs.h:1.2 Fri Jul 3 10:08:53 2020 +++ src/sys/compat/sys/statvfs.h Fri Jul 3 15:00:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: statvfs.h,v 1.2 2020/07/03 14:08:53 christos Exp $ */ +/* $NetBSD: statvfs.h,v 1.3 2020/07/03 19:00:01 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -116,7 +116,7 @@ statvfs_to_statvfs90_copy(const void *vs int error; statvfs_to_statvfs90(vs, s90); - error = copyout(s90, vs90, l); + error = copyout(s90, vs90, sizeof(*s90)); kmem_free(s90, sizeof(*s90)); return error;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Fri Jul 3 19:00:01 UTC 2020 Modified Files: src/sys/compat/sys: statvfs.h Log Message: sync with mount.h, always use the structure size. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: jdolecek Date: Fri Jul 3 18:49:38 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: don't overallocate (follows similar change to compat/sys/statvfs.h) To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/mount.h diff -u src/sys/compat/sys/mount.h:1.13 src/sys/compat/sys/mount.h:1.14 --- src/sys/compat/sys/mount.h:1.13 Sat Jun 27 15:49:30 2020 +++ src/sys/compat/sys/mount.h Fri Jul 3 18:49:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.13 2020/06/27 15:49:30 christos Exp $ */ +/* $NetBSD: mount.h,v 1.14 2020/07/03 18:49:37 jdolecek Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -137,12 +137,12 @@ statvfs_to_statfs12(const struct statvfs static __inline int statvfs_to_statfs12_copy(const void *vs, void *vs12, size_t l) { - struct statfs12 *s12 = STATVFSBUF_GET(); + struct statfs12 *s12 = kmem_zalloc(sizeof(*s12), KM_SLEEP); int error; statvfs_to_statfs12(vs, s12); error = copyout(s12, vs12, sizeof(*s12)); - STATVFSBUF_PUT(s12); + kmem_free(s12, sizeof(*s12)); return error; }
CVS commit: src/sys/compat/sys
Module Name:src Committed By: jdolecek Date: Fri Jul 3 18:49:38 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: don't overallocate (follows similar change to compat/sys/statvfs.h) To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Fri Jul 3 14:08:53 UTC 2020 Modified Files: src/sys/compat/sys: statvfs.h Log Message: don't overallocate (requested by maxv@) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/statvfs.h diff -u src/sys/compat/sys/statvfs.h:1.1 src/sys/compat/sys/statvfs.h:1.2 --- src/sys/compat/sys/statvfs.h:1.1 Sun Sep 22 19:18:53 2019 +++ src/sys/compat/sys/statvfs.h Fri Jul 3 10:08:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: statvfs.h,v 1.1 2019/09/22 23:18:53 christos Exp $ */ +/* $NetBSD: statvfs.h,v 1.2 2020/07/03 14:08:53 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -112,12 +112,12 @@ statvfs_to_statvfs90(const struct statvf static __inline int statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l) { - struct statvfs90 *s90 = STATVFSBUF_GET(); + struct statvfs90 *s90 = kmem_zalloc(sizeof(*s90), KM_SLEEP); int error; statvfs_to_statvfs90(vs, s90); error = copyout(s90, vs90, l); - STATVFSBUF_PUT(s90); + kmem_free(s90, sizeof(*s90)); return error; } @@ -158,4 +158,4 @@ int __getmntinfo90(struct statvfs **, in __END_DECLS -#endif /* !_SYS_STATVFS_H_ */ +#endif /* !_COMPAT_SYS_STATVFS_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Fri Jul 3 14:08:53 UTC 2020 Modified Files: src/sys/compat/sys: statvfs.h Log Message: don't overallocate (requested by maxv@) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/compat/sys
> On Jun 28, 2020, at 10:24 AM, Robert Elz wrote: > >Date:Sat, 27 Jun 2020 11:49:30 -0400 >From:"Christos Zoulas" >Message-ID: <20200627154930.84e22f...@cvs.netbsd.org> > > | Modified Files: > |src/sys/compat/sys: mount.h > | > | Log Message: > | Ignore the supplied size, and always use the argument size that we know. > > Is this fix correct?Certainly looks more reasonable than > what was there before, as the supplied size (for no seemingly > good reason) is often 0, but in compat_20_sys_getfsstat() (in > sys/compat/common/vfs_syscalls_20.c) statvfs_to_statfs12_copy() > is called, via do_sys_getvfsstat() with a size of > sizeof(struct statvfs90) and a statvfs90 (compat/sys/statvfs.h) > is certainly not the same size as a statfs12 (compat/sys/mount.h) > > Or perhaps (probably more likely) compat_20_sys_getfsstat() should > be passing sizeof(struct statfs12) instead ? (And now may as well > just pass 0). No, it has to be sizeof(struct statfs12) because the function fills an array of struct statfs12 and needs to know how much to increment. Thanks, christos signature.asc Description: Message signed with OpenPGP
Re: CVS commit: src/sys/compat/sys
Date:Sat, 27 Jun 2020 11:49:30 -0400 From:"Christos Zoulas" Message-ID: <20200627154930.84e22f...@cvs.netbsd.org> | Modified Files: | src/sys/compat/sys: mount.h | | Log Message: | Ignore the supplied size, and always use the argument size that we know. Is this fix correct?Certainly looks more reasonable than what was there before, as the supplied size (for no seemingly good reason) is often 0, but in compat_20_sys_getfsstat() (in sys/compat/common/vfs_syscalls_20.c) statvfs_to_statfs12_copy() is called, via do_sys_getvfsstat() with a size of sizeof(struct statvfs90) and a statvfs90 (compat/sys/statvfs.h) is certainly not the same size as a statfs12 (compat/sys/mount.h) Or perhaps (probably more likely) compat_20_sys_getfsstat() should be passing sizeof(struct statfs12) instead ? (And now may as well just pass 0). kre
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sat Jun 27 15:49:30 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: Ignore the supplied size, and always use the argument size that we know. Found by maxv@ To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/mount.h diff -u src/sys/compat/sys/mount.h:1.12 src/sys/compat/sys/mount.h:1.13 --- src/sys/compat/sys/mount.h:1.12 Sat Jun 27 03:00:43 2020 +++ src/sys/compat/sys/mount.h Sat Jun 27 11:49:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.12 2020/06/27 07:00:43 maxv Exp $ */ +/* $NetBSD: mount.h,v 1.13 2020/06/27 15:49:30 christos Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -141,7 +141,7 @@ statvfs_to_statfs12_copy(const void *vs, int error; statvfs_to_statfs12(vs, s12); - error = copyout(s12, vs12, l); + error = copyout(s12, vs12, sizeof(*s12)); STATVFSBUF_PUT(s12); return error;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sat Jun 27 15:49:30 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: Ignore the supplied size, and always use the argument size that we know. Found by maxv@ To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maxv Date: Sat Jun 27 07:00:43 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: Yet another idiotic compat syscall that was developed with literally zero test made. Simply invoking this syscall with _valid parameters_ triggers a fatal fault, because the kernel tries to write to userland addresses. With specially-crafted parameters it is easy to completely escalate privileges into the kernel. Also the size of the allocation is just obviously wrong, but it looks like the callers are even more wrong, so not gonna fix it for now. Reported-by: syzbot+b05096f3114b2820d...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/mount.h diff -u src/sys/compat/sys/mount.h:1.11 src/sys/compat/sys/mount.h:1.12 --- src/sys/compat/sys/mount.h:1.11 Fri Oct 4 01:28:02 2019 +++ src/sys/compat/sys/mount.h Sat Jun 27 07:00:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.11 2019/10/04 01:28:02 christos Exp $ */ +/* $NetBSD: mount.h,v 1.12 2020/06/27 07:00:43 maxv Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -140,7 +140,7 @@ statvfs_to_statfs12_copy(const void *vs, struct statfs12 *s12 = STATVFSBUF_GET(); int error; - statvfs_to_statfs12(vs, vs12); + statvfs_to_statfs12(vs, s12); error = copyout(s12, vs12, l); STATVFSBUF_PUT(s12);
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maxv Date: Sat Jun 27 07:00:43 UTC 2020 Modified Files: src/sys/compat/sys: mount.h Log Message: Yet another idiotic compat syscall that was developed with literally zero test made. Simply invoking this syscall with _valid parameters_ triggers a fatal fault, because the kernel tries to write to userland addresses. With specially-crafted parameters it is easy to completely escalate privileges into the kernel. Also the size of the allocation is just obviously wrong, but it looks like the callers are even more wrong, so not gonna fix it for now. Reported-by: syzbot+b05096f3114b2820d...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/compat/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Sep 26 01:29:00 UTC 2019 Modified Files: src/sys/compat/sys: socket.h Log Message: accrightslen is always used in an unsigned context so make it. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Sep 26 01:29:00 UTC 2019 Modified Files: src/sys/compat/sys: socket.h Log Message: accrightslen is always used in an unsigned context so make it. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/socket.h diff -u src/sys/compat/sys/socket.h:1.18 src/sys/compat/sys/socket.h:1.19 --- src/sys/compat/sys/socket.h:1.18 Thu Apr 11 00:42:08 2019 +++ src/sys/compat/sys/socket.h Wed Sep 25 21:29:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: socket.h,v 1.18 2019/04/11 04:42:08 msaitoh Exp $ */ +/* $NetBSD: socket.h,v 1.19 2019/09/26 01:29:00 christos Exp $ */ /* * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 @@ -67,7 +67,7 @@ struct omsghdr { struct iovec *msg_iov; /* scatter/gather array */ int msg_iovlen; /* # elements in msg_iov */ void * msg_accrights; /* access rights sent/received */ - int msg_accrightslen; + u_int msg_accrightslen; }; /*
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Sep 22 23:18:53 UTC 2019 Added Files: src/sys/compat/sys: statvfs.h Log Message: new files for statvfs90 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Sep 22 23:18:53 UTC 2019 Added Files: src/sys/compat/sys: statvfs.h Log Message: new files for statvfs90 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/statvfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/compat/sys/statvfs.h diff -u /dev/null src/sys/compat/sys/statvfs.h:1.1 --- /dev/null Sun Sep 22 19:18:53 2019 +++ src/sys/compat/sys/statvfs.h Sun Sep 22 19:18:53 2019 @@ -0,0 +1,161 @@ +/* $NetBSD: statvfs.h,v 1.1 2019/09/22 23:18:53 christos Exp $ */ + +/*- + * Copyright (c) 2019 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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. + */ + +#ifndef _COMPAT_SYS_STATVFS_H_ +#define _COMPAT_SYS_STATVFS_H_ + +#include + +struct statvfs90 { + unsigned long f_flag; /* copy of mount exported flags */ + unsigned long f_bsize; /* file system block size */ + unsigned long f_frsize; /* fundamental file system block size */ + unsigned long f_iosize; /* optimal file system block size */ + + /* The following are in units of f_frsize */ + fsblkcnt_t f_blocks; /* number of blocks in file system, */ + fsblkcnt_t f_bfree; /* free blocks avail in file system */ + fsblkcnt_t f_bavail; /* free blocks avail to non-root */ + fsblkcnt_t f_bresvd; /* blocks reserved for root */ + + fsfilcnt_t f_files; /* total file nodes in file system */ + fsfilcnt_t f_ffree; /* free file nodes in file system */ + fsfilcnt_t f_favail; /* free file nodes avail to non-root */ + fsfilcnt_t f_fresvd; /* file nodes reserved for root */ + + uint64_t f_syncreads; /* count of sync reads since mount */ + uint64_t f_syncwrites; /* count of sync writes since mount */ + + uint64_t f_asyncreads; /* count of async reads since mount */ + uint64_t f_asyncwrites; /* count of async writes since mount */ + + fsid_t f_fsidx; /* NetBSD compatible fsid */ + unsigned long f_fsid; /* Posix compatible fsid */ + unsigned long f_namemax; /* maximum filename length */ + uid_t f_owner; /* user that mounted the file system */ + + uint32_t f_spare[4]; /* spare space */ + + char f_fstypename[_VFS_NAMELEN]; /* fs type name */ + char f_mntonname[_VFS_MNAMELEN]; /* directory on which mounted */ + char f_mntfromname[_VFS_MNAMELEN]; /* mounted file system */ +}; + +__BEGIN_DECLS +#ifndef _KERNEL +#include +#endif + +static __inline void +statvfs_to_statvfs90(const struct statvfs *s, struct statvfs90 *s90) +{ + s90->f_flag = s->f_flag; + s90->f_bsize = s->f_bsize; + s90->f_frsize = s->f_frsize; + s90->f_iosize = s->f_iosize; + + s90->f_blocks = s->f_blocks; + s90->f_bfree = s->f_bfree; + s90->f_bavail = s->f_bavail; + s90->f_bresvd = s->f_bresvd; + + s90->f_files = s->f_files; + s90->f_ffree = s->f_ffree; + s90->f_favail = s->f_favail; + s90->f_fresvd = s->f_fresvd; + + s90->f_syncreads = s->f_syncreads; + s90->f_syncwrites = s->f_syncwrites; + + s90->f_asyncreads = s->f_asyncreads; + s90->f_asyncwrites = s->f_asyncwrites; + + s90->f_fsidx = s->f_fsidx; + s90->f_fsid = s->f_fsid; + s90->f_namemax = s->f_namemax; + s90->f_owner = s->f_owner; + + memcpy(s90->f_fstypename, s->f_fstypename, sizeof(s90->f_fstypename)); + memcpy(s90->f_mntonname, s->f_mntonname, sizeof(s90->f_mntonname)); + memcpy(s90->f_mntfromname, s->f_mntfromname, sizeof(s90->f_mntfromname)); +} + +#ifdef _KERNEL +static __inline int +statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l) +{ + struct statvfs90 *s90 = STATVFSBUF_GET(); + int error; + + statvfs_to_statvfs90(vs, s90);
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Jun 30 14:37:33 UTC 2019 Modified Files: src/sys/compat/sys: sigtypes.h ucontext.h Log Message: This code is used in 32 bit arm emulations so always expose the stack32_t and the 32 bit machine context structure definition and types. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/sigtypes.h cvs rdiff -u -r1.7 -r1.8 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sigtypes.h diff -u src/sys/compat/sys/sigtypes.h:1.3 src/sys/compat/sys/sigtypes.h:1.4 --- src/sys/compat/sys/sigtypes.h:1.3 Wed Jun 26 21:58:49 2019 +++ src/sys/compat/sys/sigtypes.h Sun Jun 30 10:37:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sigtypes.h,v 1.3 2019/06/27 01:58:49 christos Exp $ */ +/* $NetBSD: sigtypes.h,v 1.4 2019/06/30 14:37:33 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -63,7 +63,7 @@ struct sigaltstack13 { #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */ -#if defined(_LP64) && defined(_KERNEL) +#ifdef _KERNEL struct __sigaltstack32 { uint32_t ss_sp; @@ -73,7 +73,7 @@ struct __sigaltstack32 { typedef struct __sigaltstack32 stack32_t; -#endif /* _LP64 && _KERNEL */ +#endif /* _KERNEL */ #endif /* !_COMPAT_SYS_SIGTYPES_H_ */ Index: src/sys/compat/sys/ucontext.h diff -u src/sys/compat/sys/ucontext.h:1.7 src/sys/compat/sys/ucontext.h:1.8 --- src/sys/compat/sys/ucontext.h:1.7 Wed Jun 26 21:58:49 2019 +++ src/sys/compat/sys/ucontext.h Sun Jun 30 10:37:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ucontext.h,v 1.7 2019/06/27 01:58:49 christos Exp $ */ +/* $NetBSD: ucontext.h,v 1.8 2019/06/30 14:37:33 christos Exp $ */ /*- * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include -#if defined(_LP64) && defined(_KERNEL) +#ifdef _KERNEL typedef struct __ucontext32 ucontext32_t; @@ -61,6 +61,6 @@ int cpu_mcontext32_validate(struct lwp * void cpu_getmcontext32(struct lwp *, mcontext32_t *, unsigned int *); int cpu_setmcontext32(struct lwp *, const mcontext32_t *, unsigned int); -#endif /* _LP64 && _KERNEL */ +#endif /* _KERNEL */ #endif /* !_COMPAT_SYS_UCONTEXT_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Jun 30 14:37:33 UTC 2019 Modified Files: src/sys/compat/sys: sigtypes.h ucontext.h Log Message: This code is used in 32 bit arm emulations so always expose the stack32_t and the 32 bit machine context structure definition and types. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/sigtypes.h cvs rdiff -u -r1.7 -r1.8 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: martin Date: Sun Jun 30 08:49:21 UTC 2019 Modified Files: src/sys/compat/sys: siginfo.h Log Message: Provide the compat structures even if not building 64bit kernels, as we have same-bitness netbsd32 emulations for different ABIs on some architectures. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/siginfo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: martin Date: Sun Jun 30 08:49:21 UTC 2019 Modified Files: src/sys/compat/sys: siginfo.h Log Message: Provide the compat structures even if not building 64bit kernels, as we have same-bitness netbsd32 emulations for different ABIs on some architectures. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/siginfo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/siginfo.h diff -u src/sys/compat/sys/siginfo.h:1.6 src/sys/compat/sys/siginfo.h:1.7 --- src/sys/compat/sys/siginfo.h:1.6 Thu Jun 27 01:58:49 2019 +++ src/sys/compat/sys/siginfo.h Sun Jun 30 08:49:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: siginfo.h,v 1.6 2019/06/27 01:58:49 christos Exp $ */ +/* $NetBSD: siginfo.h,v 1.7 2019/06/30 08:49:21 martin Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #ifndef _COMPAT_SYS_SIGINFO_H_ #define _COMPAT_SYS_SIGINFO_H_ -#if defined(_LP64) && defined(_KERNEL) +#ifdef _KERNEL typedef union sigval32 { int sival_int; @@ -83,6 +83,6 @@ typedef union siginfo32 { struct __ksiginfo32 _info; } siginfo32_t; -#endif /* _LP64 && _KERNEL */ +#endif /* _KERNEL */ #endif /* !_COMPAT_SYS_SIGINFO_H_ */
Re: CVS commit: src/sys/compat/sys
On Fri, Jun 28, 2019 at 05:03:37AM -0700, Jason Thorpe wrote: > > > On Jun 26, 2019, at 7:10 PM, matthew green wrote: > > > >> Always include the 32 bit structure and definitions on _LP64 regardless > >> of compat32 being on or off, because we want the headers to work when > >> compiling modular kernels. Of course the 32 bit structs do not make sense > >> on platforms that don't have 32 bit modes (alpha), but we don't have > >> a define for that and it does not hurt. > > > > i've been using _LP64 && !__alpha__ for this when it strikes. > > > > sub-optimal, but also easy to grep and find :-) > > Perhaps we should define "_LP64_ONLY" in for this type of > situation? > I'm a really huge fan of keeping structs the same across archs when it doesn't cost us very much. It's been a real blessing that netbsd is mostly consistent when porting programming languages, which often end up embedding a list of structs and their sizes, generated by very fragile code (or by hand!)
Re: CVS commit: src/sys/compat/sys
> On Jun 26, 2019, at 7:10 PM, matthew green wrote: > >> Always include the 32 bit structure and definitions on _LP64 regardless >> of compat32 being on or off, because we want the headers to work when >> compiling modular kernels. Of course the 32 bit structs do not make sense >> on platforms that don't have 32 bit modes (alpha), but we don't have >> a define for that and it does not hurt. > > i've been using _LP64 && !__alpha__ for this when it strikes. > > sub-optimal, but also easy to grep and find :-) Perhaps we should define "_LP64_ONLY" in for this type of situation? -- thorpej
re: CVS commit: src/sys/compat/sys
> Always include the 32 bit structure and definitions on _LP64 regardless > of compat32 being on or off, because we want the headers to work when > compiling modular kernels. Of course the 32 bit structs do not make sense > on platforms that don't have 32 bit modes (alpha), but we don't have > a define for that and it does not hurt. i've been using _LP64 && !__alpha__ for this when it strikes. sub-optimal, but also easy to grep and find :-) .mrg.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Jun 27 02:44:54 UTC 2019 Modified Files: src/sys/compat/sys: rnd.h Log Message: This actually needs the netbsd32 stuff present since the struct for the 32 bit syscall has a netbsd32_voidp... This header is used also for compat/common, so just revert (helped us to fix a bug though :-) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Jun 27 02:44:54 UTC 2019 Modified Files: src/sys/compat/sys: rnd.h Log Message: This actually needs the netbsd32 stuff present since the struct for the 32 bit syscall has a netbsd32_voidp... This header is used also for compat/common, so just revert (helped us to fix a bug though :-) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/rnd.h diff -u src/sys/compat/sys/rnd.h:1.6 src/sys/compat/sys/rnd.h:1.7 --- src/sys/compat/sys/rnd.h:1.6 Wed Jun 26 21:58:49 2019 +++ src/sys/compat/sys/rnd.h Wed Jun 26 22:44:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.6 2019/06/27 01:58:49 christos Exp $ */ +/* $NetBSD: rnd.h,v 1.7 2019/06/27 02:44:54 christos Exp $ */ /*- * Copyright (c) 1997,2011 The NetBSD Foundation, Inc. @@ -33,9 +33,18 @@ #ifndef _COMPAT_SYS_RND_H_ #define _COMPAT_SYS_RND_H_ +#if defined(_KERNEL_OPT) +#include "opt_compat_netbsd.h" +#include "opt_compat_netbsd32.h" +#endif + #include #include +#ifdef COMPAT_NETBSD32 +#include +#endif /* COMPAT_NETBSD32 */ + #include /* @@ -57,7 +66,7 @@ typedef struct { void *unused_state; /* was: internal state */ } rndsource50_t; -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 typedef struct { char name[16]; /* device name */ uint32_t unused_time; /* was: last time recorded */ @@ -68,7 +77,7 @@ typedef struct { uint32_t flags; /* flags */ netbsd32_voidp unused_state; /* was: internal state */ } rndsource50_32_t; -#endif /* _LP64 */ +#endif /* COMPAT_NETBSD32 */ /* * NetBSD-5 defined RND_MAXSTATCOUNT as 10. We define RND_MAXSTATCOUNT50 @@ -88,13 +97,13 @@ typedef struct { rndsource50_t source[RND_MAXSTATCOUNT50]; } rndstat50_t; -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 typedef struct { uint32_t start; uint32_t count; rndsource50_32_t source[RND_MAXSTATCOUNT50]; } rndstat50_32_t; -#endif /* _LP64 */ +#endif /* COMPAT_NETBSD32 */ /* * return information on a specific source by name @@ -104,12 +113,12 @@ typedef struct { rndsource50_t source; } rndstat_name50_t; -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 typedef struct { char name[16]; rndsource50_32_t source; } rndstat_name50_32_t; -#endif /* _LP64 */ +#endif /* COMPAT_NETBSD32 */ /* * NetBSD-5 defined RND_POOLWORDS as 128. In NetBSD-6, the value @@ -134,9 +143,9 @@ int compat32_50_rnd_ioctl(struct file *, #define RNDGETSRCNUM50 _IOWR('R', 102, rndstat50_t) #define RNDGETSRCNAME50 _IOWR('R', 103, rndstat_name50_t) -#ifdef _LP64 +#ifdef COMPAT_NETBSD32 #define RNDGETSRCNUM50_32 _IOWR('R', 102, rndstat50_32_t) #define RNDGETSRCNAME50_32 _IOWR('R', 103, rndstat_name50_32_t) -#endif +#endif /* COMPAT_NETBSD32 */ #endif /* !_COMPAT_SYS_RND_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Jun 27 01:58:49 UTC 2019 Modified Files: src/sys/compat/sys: rnd.h siginfo.h sigtypes.h ttycom.h ucontext.h Log Message: Always include the 32 bit structure and definitions on _LP64 regardless of compat32 being on or off, because we want the headers to work when compiling modular kernels. Of course the 32 bit structs do not make sense on platforms that don't have 32 bit modes (alpha), but we don't have a define for that and it does not hurt. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/rnd.h \ src/sys/compat/sys/siginfo.h cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/sigtypes.h cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/ttycom.h cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/rnd.h diff -u src/sys/compat/sys/rnd.h:1.5 src/sys/compat/sys/rnd.h:1.6 --- src/sys/compat/sys/rnd.h:1.5 Sat Jan 26 21:08:41 2019 +++ src/sys/compat/sys/rnd.h Wed Jun 26 21:58:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.5 2019/01/27 02:08:41 pgoyette Exp $ */ +/* $NetBSD: rnd.h,v 1.6 2019/06/27 01:58:49 christos Exp $ */ /*- * Copyright (c) 1997,2011 The NetBSD Foundation, Inc. @@ -33,18 +33,9 @@ #ifndef _COMPAT_SYS_RND_H_ #define _COMPAT_SYS_RND_H_ -#if defined(_KERNEL_OPT) -#include "opt_compat_netbsd.h" -#include "opt_compat_netbsd32.h" -#endif - #include #include -#ifdef COMPAT_NETBSD32 -#include -#endif /* COMPAT_NETBSD32 */ - #include /* @@ -66,7 +57,7 @@ typedef struct { void *unused_state; /* was: internal state */ } rndsource50_t; -#ifdef COMPAT_NETBSD32 +#ifdef _LP64 typedef struct { char name[16]; /* device name */ uint32_t unused_time; /* was: last time recorded */ @@ -77,7 +68,7 @@ typedef struct { uint32_t flags; /* flags */ netbsd32_voidp unused_state; /* was: internal state */ } rndsource50_32_t; -#endif /* COMPAT_NETBSD32 */ +#endif /* _LP64 */ /* * NetBSD-5 defined RND_MAXSTATCOUNT as 10. We define RND_MAXSTATCOUNT50 @@ -97,13 +88,13 @@ typedef struct { rndsource50_t source[RND_MAXSTATCOUNT50]; } rndstat50_t; -#ifdef COMPAT_NETBSD32 +#ifdef _LP64 typedef struct { uint32_t start; uint32_t count; rndsource50_32_t source[RND_MAXSTATCOUNT50]; } rndstat50_32_t; -#endif /* COMPAT_NETBSD32 */ +#endif /* _LP64 */ /* * return information on a specific source by name @@ -113,12 +104,12 @@ typedef struct { rndsource50_t source; } rndstat_name50_t; -#ifdef COMPAT_NETBSD32 +#ifdef _LP64 typedef struct { char name[16]; rndsource50_32_t source; } rndstat_name50_32_t; -#endif /* COMPAT_NETBSD32 */ +#endif /* _LP64 */ /* * NetBSD-5 defined RND_POOLWORDS as 128. In NetBSD-6, the value @@ -143,9 +134,9 @@ int compat32_50_rnd_ioctl(struct file *, #define RNDGETSRCNUM50 _IOWR('R', 102, rndstat50_t) #define RNDGETSRCNAME50 _IOWR('R', 103, rndstat_name50_t) -#ifdef COMPAT_NETBSD32 +#ifdef _LP64 #define RNDGETSRCNUM50_32 _IOWR('R', 102, rndstat50_32_t) #define RNDGETSRCNAME50_32 _IOWR('R', 103, rndstat_name50_32_t) -#endif /* COMPAT_NETBSD32 */ +#endif #endif /* !_COMPAT_SYS_RND_H_ */ Index: src/sys/compat/sys/siginfo.h diff -u src/sys/compat/sys/siginfo.h:1.5 src/sys/compat/sys/siginfo.h:1.6 --- src/sys/compat/sys/siginfo.h:1.5 Wed Jun 19 12:14:07 2019 +++ src/sys/compat/sys/siginfo.h Wed Jun 26 21:58:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: siginfo.h,v 1.5 2019/06/19 16:14:07 maya Exp $ */ +/* $NetBSD: siginfo.h,v 1.6 2019/06/27 01:58:49 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -32,11 +32,7 @@ #ifndef _COMPAT_SYS_SIGINFO_H_ #define _COMPAT_SYS_SIGINFO_H_ -#if defined(_KERNEL_OPT) -#include "opt_compat_netbsd32.h" -#endif - -#if defined(COMPAT_NETBSD32) && defined(_KERNEL) +#if defined(_LP64) && defined(_KERNEL) typedef union sigval32 { int sival_int; @@ -87,6 +83,6 @@ typedef union siginfo32 { struct __ksiginfo32 _info; } siginfo32_t; -#endif /* COMPAT_NETBSD32 && _KERNEL */ +#endif /* _LP64 && _KERNEL */ #endif /* !_COMPAT_SYS_SIGINFO_H_ */ Index: src/sys/compat/sys/sigtypes.h diff -u src/sys/compat/sys/sigtypes.h:1.2 src/sys/compat/sys/sigtypes.h:1.3 --- src/sys/compat/sys/sigtypes.h:1.2 Sun Dec 11 07:20:29 2005 +++ src/sys/compat/sys/sigtypes.h Wed Jun 26 21:58:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sigtypes.h,v 1.2 2005/12/11 12:20:29 christos Exp $ */ +/* $NetBSD: sigtypes.h,v 1.3 2019/06/27 01:58:49 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -39,10 +39,6 @@ #ifndef _COMPAT_SYS_SIGTYPES_H_ #define _COMPAT_SYS_SIGTYPES_H_ -#if defined(_KERNEL_OPT) -#include "opt_compat_netbsd32.h" -#endif - #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ defined(_NETBSD_SOURCE) @@ -67,7 +63,7 @@ struct sigaltstack13 { #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */ -#if
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Jun 27 01:58:49 UTC 2019 Modified Files: src/sys/compat/sys: rnd.h siginfo.h sigtypes.h ttycom.h ucontext.h Log Message: Always include the 32 bit structure and definitions on _LP64 regardless of compat32 being on or off, because we want the headers to work when compiling modular kernels. Of course the 32 bit structs do not make sense on platforms that don't have 32 bit modes (alpha), but we don't have a define for that and it does not hurt. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/rnd.h \ src/sys/compat/sys/siginfo.h cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/sigtypes.h cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/ttycom.h cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maya Date: Wed Jun 19 16:14:07 UTC 2019 Modified Files: src/sys/compat/sys: siginfo.h Log Message: Match the regular _ksiginfo size since sys/sys/siginfo.h:1.33 "Expand siginfo_t (struct size not changed) to new values for SIGTRAP TRAP_SCE/TRAP_SCX events." Fixes port-mips/54309: gdb doesn't work on mips64 (32bit userland, 64bit kernel) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/siginfo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maya Date: Wed Jun 19 16:14:07 UTC 2019 Modified Files: src/sys/compat/sys: siginfo.h Log Message: Match the regular _ksiginfo size since sys/sys/siginfo.h:1.33 "Expand siginfo_t (struct size not changed) to new values for SIGTRAP TRAP_SCE/TRAP_SCX events." Fixes port-mips/54309: gdb doesn't work on mips64 (32bit userland, 64bit kernel) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/siginfo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/siginfo.h diff -u src/sys/compat/sys/siginfo.h:1.4 src/sys/compat/sys/siginfo.h:1.5 --- src/sys/compat/sys/siginfo.h:1.4 Mon Apr 28 20:23:46 2008 +++ src/sys/compat/sys/siginfo.h Wed Jun 19 16:14:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: siginfo.h,v 1.4 2008/04/28 20:23:46 martin Exp $ */ +/* $NetBSD: siginfo.h,v 1.5 2019/06/19 16:14:07 maya Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -72,6 +72,13 @@ struct __ksiginfo32 { int32_t _band; int _fd; } _poll; + + struct { + int _sysnum; + int _retval[2]; + int _error; + uint64_t _args[8]; /* SYS_MAXSYSARGS */ + } _syscall; } _reason; };
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Thu Apr 11 04:43:40 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Restore sys/ioccom.h. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.16 src/sys/compat/sys/sockio.h:1.17 --- src/sys/compat/sys/sockio.h:1.16 Thu Apr 11 04:42:08 2019 +++ src/sys/compat/sys/sockio.h Thu Apr 11 04:43:40 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.16 2019/04/11 04:42:08 msaitoh Exp $ */ +/* $NetBSD: sockio.h,v 1.17 2019/04/11 04:43:40 msaitoh Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -32,6 +32,8 @@ #ifndef _COMPAT_SYS_SOCKIO_H_ #define _COMPAT_SYS_SOCKIO_H_ +#include + #define OIFNAMSIZ 16 struct oifreq {
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Thu Apr 11 04:43:40 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Restore sys/ioccom.h. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Thu Apr 11 04:42:08 UTC 2019 Modified Files: src/sys/compat/sys: socket.h sockio.h Log Message: Remove unused macro definitions. OK'd by pgoyette. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/compat/sys/socket.h cvs rdiff -u -r1.15 -r1.16 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/socket.h diff -u src/sys/compat/sys/socket.h:1.17 src/sys/compat/sys/socket.h:1.18 --- src/sys/compat/sys/socket.h:1.17 Sun Jan 27 02:08:41 2019 +++ src/sys/compat/sys/socket.h Thu Apr 11 04:42:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: socket.h,v 1.17 2019/01/27 02:08:41 pgoyette Exp $ */ +/* $NetBSD: socket.h,v 1.18 2019/04/11 04:42:08 msaitoh Exp $ */ /* * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 @@ -46,10 +46,6 @@ #define COMPAT_OSOCK #endif -#ifdef COMPAT_70 -#define COMPAT_SOCKCRED70 -#endif - #else #define COMPAT_OSOCK #endif Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.15 src/sys/compat/sys/sockio.h:1.16 --- src/sys/compat/sys/sockio.h:1.15 Wed Apr 10 04:37:00 2019 +++ src/sys/compat/sys/sockio.h Thu Apr 11 04:42:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.15 2019/04/10 04:37:00 msaitoh Exp $ */ +/* $NetBSD: sockio.h,v 1.16 2019/04/11 04:42:08 msaitoh Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -32,30 +32,6 @@ #ifndef _COMPAT_SYS_SOCKIO_H_ #define _COMPAT_SYS_SOCKIO_H_ -#ifdef _KERNEL_OPT - -#include "opt_compat_netbsd.h" -#include "opt_modular.h" - -#include - -#if defined(COMPAT_09) || defined(COMPAT_10) || defined(COMPAT_11) || \ -defined(COMPAT_12) || defined(COMPAT_13) || defined(COMPAT_14) || \ -defined(COMPAT_15) || defined(COMPAT_16) || defined(COMPAT_20) || \ -defined(COMPAT_30) || defined(COMPAT_40) || defined(MODULAR) -#define COMPAT_OIFREQ -#endif - -#if defined(COMPAT_09) || defined(COMPAT_10) || defined(COMPAT_11) || \ -defined(COMPAT_12) || defined(COMPAT_13) || defined(COMPAT_14) || \ -defined(COMPAT_15) || defined(COMPAT_16) || defined(COMPAT_20) || \ -defined(COMPAT_30) || defined(COMPAT_40) || defined(COMPAT_50) || \ -defined(MODULAR) -#define COMPAT_OIFDATA -#endif - -#endif /* _KERNEL_OPT */ - #define OIFNAMSIZ 16 struct oifreq {
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Thu Apr 11 04:42:08 UTC 2019 Modified Files: src/sys/compat/sys: socket.h sockio.h Log Message: Remove unused macro definitions. OK'd by pgoyette. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/compat/sys/socket.h cvs rdiff -u -r1.15 -r1.16 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Wed Apr 10 04:37:00 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Whitespace change. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.14 src/sys/compat/sys/sockio.h:1.15 --- src/sys/compat/sys/sockio.h:1.14 Wed Apr 10 04:28:03 2019 +++ src/sys/compat/sys/sockio.h Wed Apr 10 04:37:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.14 2019/04/10 04:28:03 msaitoh Exp $ */ +/* $NetBSD: sockio.h,v 1.15 2019/04/10 04:37:00 msaitoh Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -141,43 +141,41 @@ struct oifdatareq { zero ctrs*/ - - #define OBIOCGETIF _IOR('B', 107, struct oifreq) #define OBIOCSETIF _IOW('B', 108, struct oifreq) #define OTAPGIFNAME _IOR('e', 0, struct oifreq) -#define ifreqn2o(oi, ni) \ - do { \ - (void)memcpy((oi)->ifr_name, (ni)->ifr_name, \ - sizeof((oi)->ifr_name)); \ - (void)memcpy(&(oi)->ifr_ifru, &(ni)->ifr_ifru, \ - sizeof((oi)->ifr_ifru)); \ +#define ifreqn2o(oi, ni) \ + do { \ + (void)memcpy((oi)->ifr_name, (ni)->ifr_name, \ + sizeof((oi)->ifr_name)); \ + (void)memcpy(&(oi)->ifr_ifru, &(ni)->ifr_ifru, \ + sizeof((oi)->ifr_ifru)); \ } while (/*CONSTCOND*/0) -#define ifreqo2n(oi, ni) \ - do { \ - (void)memcpy((ni)->ifr_name, (oi)->ifr_name, \ - sizeof((oi)->ifr_name)); \ - (void)memcpy(&(ni)->ifr_ifru, &(oi)->ifr_ifru, \ - sizeof((oi)->ifr_ifru)); \ +#define ifreqo2n(oi, ni) \ + do { \ + (void)memcpy((ni)->ifr_name, (oi)->ifr_name, \ + sizeof((oi)->ifr_name)); \ + (void)memcpy(&(ni)->ifr_ifru, &(oi)->ifr_ifru, \ + sizeof((oi)->ifr_ifru)); \ } while (/*CONSTCOND*/0) -#define ifdatan2o(oi, ni) \ - do { \ - (void)memcpy((oi), (ni), sizeof(*(oi))); \ - (oi)->ifi_lastchange.tv_sec = \ - (int32_t)(ni)->ifi_lastchange.tv_sec; \ - (oi)->ifi_lastchange.tv_usec = \ - (ni)->ifi_lastchange.tv_nsec / 1000; \ +#define ifdatan2o(oi, ni) \ + do { \ + (void)memcpy((oi), (ni), sizeof(*(oi))); \ + (oi)->ifi_lastchange.tv_sec = \ + (int32_t)(ni)->ifi_lastchange.tv_sec; \ + (oi)->ifi_lastchange.tv_usec = \ + (ni)->ifi_lastchange.tv_nsec / 1000; \ } while (/*CONSTCOND*/0) -#define ifdatao2n(oi, ni) \ - do { \ - (void)memcpy((ni), (oi), sizeof(*(oi))); \ +#define ifdatao2n(oi, ni) \ + do { \ + (void)memcpy((ni), (oi), sizeof(*(oi))); \ (ni)->ifi_lastchange.tv_sec = (oi)->ifi_lastchange.tv_sec; \ - (ni)->ifi_lastchange.tv_nsec = \ - (oi)->ifi_lastchange.tv_usec * 1000; \ + (ni)->ifi_lastchange.tv_nsec = \ + (oi)->ifi_lastchange.tv_usec * 1000; \ } while (/*CONSTCOND*/0) #endif /* _COMPAT_SYS_SOCKIO_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Wed Apr 10 04:37:00 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Whitespace change. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Wed Apr 10 04:28:03 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Fix ifdata"o2n"() macro. This is not a real bug because this macro is not used from anywhere. Both of SIOCGIFDATA and SIOCZIFDATA use "n2o" because ZIFDATA is almost the same as GIFDATA except zeroing after read. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.13 src/sys/compat/sys/sockio.h:1.14 --- src/sys/compat/sys/sockio.h:1.13 Sun Jan 27 02:08:41 2019 +++ src/sys/compat/sys/sockio.h Wed Apr 10 04:28:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.13 2019/01/27 02:08:41 pgoyette Exp $ */ +/* $NetBSD: sockio.h,v 1.14 2019/04/10 04:28:03 msaitoh Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -175,7 +175,6 @@ struct oifdatareq { #define ifdatao2n(oi, ni) \ do { \ (void)memcpy((ni), (oi), sizeof(*(oi))); \ - sizeof((oi)->ifr_name)); \ (ni)->ifi_lastchange.tv_sec = (oi)->ifi_lastchange.tv_sec; \ (ni)->ifi_lastchange.tv_nsec = \ (oi)->ifi_lastchange.tv_usec * 1000; \
CVS commit: src/sys/compat/sys
Module Name:src Committed By: msaitoh Date: Wed Apr 10 04:28:03 UTC 2019 Modified Files: src/sys/compat/sys: sockio.h Log Message: Fix ifdata"o2n"() macro. This is not a real bug because this macro is not used from anywhere. Both of SIOCGIFDATA and SIOCZIFDATA use "n2o" because ZIFDATA is almost the same as GIFDATA except zeroing after read. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Thu Feb 21 08:25:00 UTC 2019 Modified Files: src/sys/compat/sys: ipc.h Log Message: include libkern.h or strings.h. should fix i386 build issues. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/ipc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Thu Feb 21 08:25:00 UTC 2019 Modified Files: src/sys/compat/sys: ipc.h Log Message: include libkern.h or strings.h. should fix i386 build issues. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/ipc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/ipc.h diff -u src/sys/compat/sys/ipc.h:1.6 src/sys/compat/sys/ipc.h:1.7 --- src/sys/compat/sys/ipc.h:1.6 Thu Feb 21 03:37:19 2019 +++ src/sys/compat/sys/ipc.h Thu Feb 21 08:25:00 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ipc.h,v 1.6 2019/02/21 03:37:19 mrg Exp $ */ +/* $NetBSD: ipc.h,v 1.7 2019/02/21 08:25:00 mrg Exp $ */ /* * Copyright (c) 1990, 1993 @@ -47,6 +47,12 @@ #ifndef _COMPAT_SYS_IPC_H_ #define _COMPAT_SYS_IPC_H_ +#ifdef _KERNEL +#include +#else +#include +#endif + __BEGIN_DECLS /* * Old IPC permission structure used before NetBSD 1.5.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pgoyette Date: Mon Jan 28 01:01:59 UTC 2019 Modified Files: src/sys/compat/sys: module.h Log Message: Use the correct macro name for dup-include checking To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/module.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pgoyette Date: Mon Jan 28 01:01:59 UTC 2019 Modified Files: src/sys/compat/sys: module.h Log Message: Use the correct macro name for dup-include checking To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/module.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/module.h diff -u src/sys/compat/sys/module.h:1.1 src/sys/compat/sys/module.h:1.2 --- src/sys/compat/sys/module.h:1.1 Sun Jan 27 18:29:10 2019 +++ src/sys/compat/sys/module.h Mon Jan 28 01:01:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: module.h,v 1.1 2019/01/27 18:29:10 christos Exp $ */ +/* $NetBSD: module.h,v 1.2 2019/01/28 01:01:59 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -26,8 +26,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _SYS_COMPAT_MODULE_H_ -#define _SYS_COMPAT_MODULE_H_ +#ifndef _COMPAT_SYS_MODULE_H_ +#define _COMPAT_SYS_MODULE_H_ /* * This structure intentionally has the same layout for 32 and 64 @@ -45,4 +45,4 @@ typedef struct omodstat { u_int oms_reserved[3]; } omodstat_t; -#endif /* !_SYS_COMPAT_MODULE_H_ */ +#endif /* !_COMPAT_SYS_MODULE_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Jan 27 02:58:48 UTC 2019 Modified Files: src/sys/compat/sys: cpuio.h Log Message: remove extra ifdef. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/compat/sys/cpuio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Sun Jan 27 02:58:48 UTC 2019 Modified Files: src/sys/compat/sys: cpuio.h Log Message: remove extra ifdef. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/compat/sys/cpuio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/cpuio.h diff -u src/sys/compat/sys/cpuio.h:1.9 src/sys/compat/sys/cpuio.h:1.10 --- src/sys/compat/sys/cpuio.h:1.9 Sat Jan 26 21:08:41 2019 +++ src/sys/compat/sys/cpuio.h Sat Jan 26 21:58:47 2019 @@ -1,7 +1,4 @@ -/* $NetBSD: cpuio.h,v 1.9 2019/01/27 02:08:41 pgoyette Exp $ */ - -#ifndef _SYS_COMPAT_CPUIO_H_ -#define _SYS_COMPAT_CPUIO_H_ +/* $NetBSD: cpuio.h,v 1.10 2019/01/27 02:58:47 christos Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc.
Re: CVS commit: src/sys/compat/sys
> Date: Fri, 15 Jun 2018 19:55:28 +0700 > From: Robert Elz > > Another way would be > > static const struct timespec50 zts = { 0 }; > and > *ts50 = zts; I have nothing substantive to add about the question at hand, but one tiny nit: there is no need for the initializer in this case, and indeed if you have -Werror=missing-field-initializers as I think we do by default, writing out the full initializer is a pain. It suffices to say static const struct timespec50 zts; and the implementation will guarantee it is initialized to all zero/null as appropriate.
Re: CVS commit: src/sys/compat/sys
On Fri, Jun 15, 2018 at 17:11:49 +0300, Valery Ushakov wrote: > It seems that with restrict we can just memset the whole struct and > the compiler will elide the memset completely when there's no pad to > scrub. Alas, with the real code the compiler cannot elide the memset. :( -uwe
Re: CVS commit: src/sys/compat/sys
On Fri, Jun 15, 2018 at 19:55:28 +0700, Robert Elz wrote: > Date:Fri, 15 Jun 2018 12:41:56 +0300 > From:Valery Ushakov > Message-ID: <20180615094156.gd3...@pony.stderr.spb.ru> > > | Re memset - I now wonder if > | compiler is even allowed to be smart here b/c strict aliasing > > Another way would be > > static const struct timespec50 zts = { 0 }; > and > *ts50 = zts; > > which is unlikely to have that problem, and which the compiler might > be smart enough to optimise into a single assignment where there is > padding, and perhaps even nothing where there is none. The compiler does field-by-field assignment in that case and uses "narrow" movl that doesn't scrub the pad. With memset you seem to also need to add "restrict" so that the compiler can elide the dead moves. The example I'm playing with is: #include struct s { int i; long l; }; struct s64 { long i; long l; }; //#define restrict void foo(struct s * restrict l, const struct s64 * restrict r) { #if 0 static const struct s s0 = { 0, 0 }; *l = s0; #else memset(l, 0, sizeof(*l)); #endif l->i = r->i; l->l = r->l; } > I'm also not really a fan of the #if that tests the number of bits in > int and long (by testing their max values) - that is assuming that > when long is wider than int, it also has wider alignment, which is > not necessarily so - a system with 4 byte ints and 8 byte long, > could have long with 4 byte alignment (and that struct be 12 bytes > long, alogned 4). The code as it is isn't wrong, ijust the attempt > to avoid the memset() when it isn't needed might fail, and do the > memset() when there is nothing to clear - and if the compiler doesn't > or even can't, optimise it away then it is wasteful. Yes, the #if test feels icky... It seems that with restrict we can just memset the whole struct and the compiler will elide the memset completely when there's no pad to scrub. -uwe
Re: CVS commit: src/sys/compat/sys
Date:Fri, 15 Jun 2018 12:41:56 +0300 From:Valery Ushakov Message-ID: <20180615094156.gd3...@pony.stderr.spb.ru> | Re memset - I now wonder if | compiler is even allowed to be smart here b/c strict aliasing Another way would be static const struct timespec50 zts = { 0 }; and *ts50 = zts; which is unlikely to have that problem, and which the compiler might be smart enough to optimise into a single assignment where there is padding, and perhaps even nothing where there is none. I'm also not really a fan of the #if that tests the number of bits in int and long (by testing their max values) - that is assuming that when long is wider than int, it also has wider alignment, which is not necessarily so - a system with 4 byte ints and 8 byte long, could have long with 4 byte alignment (and that struct be 12 bytes long, alogned 4). The code as it is isn't wrong, ijust the attempt to avoid the memset() when it isn't needed might fail, and do the memset() when there is nothing to clear - and if the compiler doesn't or even can't, optimise it away then it is wasteful. kre
Re: CVS commit: src/sys/compat/sys
On Fri, Jun 15, 2018 at 18:05:29 +1000, matthew green wrote: > "Robert Elz" writes: > > Module Name:src > > Committed By: kre > > Date: Fri Jun 15 07:46:59 UTC 2018 > > > > Modified Files: > > src/sys/compat/sys: time_types.h > > > > Log Message: > > If we are going to use offsetof() we'd need to include to > > get it defined. Rather than deal with potential namespace issues > > with that, just clear the entire struct, rather than attempting to > > stop after the potential padding field. If the compiler is good enough > > it should make no difference (there are just 3 fields, 2 named ones > > are assigned to, immediately after the memset() - the compiler can > > detect that, and not bother assigning (via memset()) to the unmamed > > 3rd padding field). If the compiler is not smart enough to deal > > with this, then I doubt writing 8 more zero bytes will make enough > > difference to matter. > > the compiler isn't smart apparently, and the previous change > should have fixed the problem. did we really need this too? Oh, thanks for fixing it, my bad. Re memset - I now wonder if compiler is even allowed to be smart here b/c strict aliasing (but I'm not re^n-reading that part of the standard just to satisfy my idle curiosity :) -uwe
CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Fri Jun 15 08:17:38 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: Revert previous, mrg's fix is better (even with possible namespace issues, which I guess are not great in compat includes) the perils of two people doing fixes at around the same time. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/time_types.h diff -u src/sys/compat/sys/time_types.h:1.4 src/sys/compat/sys/time_types.h:1.5 --- src/sys/compat/sys/time_types.h:1.4 Fri Jun 15 07:46:59 2018 +++ src/sys/compat/sys/time_types.h Fri Jun 15 08:17:38 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: time_types.h,v 1.4 2018/06/15 07:46:59 kre Exp $ */ +/* $NetBSD: time_types.h,v 1.5 2018/06/15 08:17:38 kre Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -97,7 +97,7 @@ static __inline void timespec_to_timespe struct timespec50 *ts50) { #if INT32_MAX < LONG_MAX /* scrub padding */ - memset(ts50, 0, sizeof(struct timespec50)); + memset(ts50, 0, offsetof(struct timespec50, tv_nsec)); #endif ts50->tv_sec = (int32_t)ts->tv_sec; ts50->tv_nsec = ts->tv_nsec;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Fri Jun 15 08:17:38 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: Revert previous, mrg's fix is better (even with possible namespace issues, which I guess are not great in compat includes) the perils of two people doing fixes at around the same time. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
re: CVS commit: src/sys/compat/sys
"Robert Elz" writes: > Module Name: src > Committed By: kre > Date: Fri Jun 15 07:46:59 UTC 2018 > > Modified Files: > src/sys/compat/sys: time_types.h > > Log Message: > If we are going to use offsetof() we'd need to include to > get it defined. Rather than deal with potential namespace issues > with that, just clear the entire struct, rather than attempting to > stop after the potential padding field. If the compiler is good enough > it should make no difference (there are just 3 fields, 2 named ones > are assigned to, immediately after the memset() - the compiler can > detect that, and not bother assigning (via memset()) to the unmamed > 3rd padding field). If the compiler is not smart enough to deal > with this, then I doubt writing 8 more zero bytes will make enough > difference to matter. the compiler isn't smart apparently, and the previous change should have fixed the problem. did we really need this too? .mrg.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Fri Jun 15 07:46:59 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: If we are going to use offsetof() we'd need to include to get it defined. Rather than deal with potential namespace issues with that, just clear the entire struct, rather than attempting to stop after the potential padding field. If the compiler is good enough it should make no difference (there are just 3 fields, 2 named ones are assigned to, immediately after the memset() - the compiler can detect that, and not bother assigning (via memset()) to the unmamed 3rd padding field). If the compiler is not smart enough to deal with this, then I doubt writing 8 more zero bytes will make enough difference to matter. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: kre Date: Fri Jun 15 07:46:59 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: If we are going to use offsetof() we'd need to include to get it defined. Rather than deal with potential namespace issues with that, just clear the entire struct, rather than attempting to stop after the potential padding field. If the compiler is good enough it should make no difference (there are just 3 fields, 2 named ones are assigned to, immediately after the memset() - the compiler can detect that, and not bother assigning (via memset()) to the unmamed 3rd padding field). If the compiler is not smart enough to deal with this, then I doubt writing 8 more zero bytes will make enough difference to matter. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/time_types.h diff -u src/sys/compat/sys/time_types.h:1.3 src/sys/compat/sys/time_types.h:1.4 --- src/sys/compat/sys/time_types.h:1.3 Fri Jun 15 07:33:27 2018 +++ src/sys/compat/sys/time_types.h Fri Jun 15 07:46:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: time_types.h,v 1.3 2018/06/15 07:33:27 mrg Exp $ */ +/* $NetBSD: time_types.h,v 1.4 2018/06/15 07:46:59 kre Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -97,7 +97,7 @@ static __inline void timespec_to_timespe struct timespec50 *ts50) { #if INT32_MAX < LONG_MAX /* scrub padding */ - memset(ts50, 0, offsetof(struct timespec50, tv_nsec)); + memset(ts50, 0, sizeof(struct timespec50)); #endif ts50->tv_sec = (int32_t)ts->tv_sec; ts50->tv_nsec = ts->tv_nsec;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Fri Jun 15 07:33:27 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: include libkern.h or string.h & stddef.h, to get the offsetof() and memset() definitions. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/time_types.h diff -u src/sys/compat/sys/time_types.h:1.2 src/sys/compat/sys/time_types.h:1.3 --- src/sys/compat/sys/time_types.h:1.2 Thu Jun 14 10:30:55 2018 +++ src/sys/compat/sys/time_types.h Fri Jun 15 07:33:27 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: time_types.h,v 1.2 2018/06/14 10:30:55 uwe Exp $ */ +/* $NetBSD: time_types.h,v 1.3 2018/06/15 07:33:27 mrg Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -34,6 +34,13 @@ #ifndef _COMPAT_SYS_TIME_TYPES_H_ #define _COMPAT_SYS_TIME_TYPES_H_ +#ifdef _KERNEL +#include +#else +#include +#include +#endif + /* * Structure returned by gettimeofday(2) system call, * and used in other calls.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Fri Jun 15 07:33:27 UTC 2018 Modified Files: src/sys/compat/sys: time_types.h Log Message: include libkern.h or string.h & stddef.h, to get the offsetof() and memset() definitions. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/time_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pgoyette Date: Sun Apr 15 22:13:36 UTC 2018 Modified Files: src/sys/compat/sys: sockio.h Log Message: Remove unnecessary __BEGIN_DECLS ... __END_DECLS at Christos's suggestion. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.11 src/sys/compat/sys/sockio.h:1.12 --- src/sys/compat/sys/sockio.h:1.11 Thu Apr 12 18:50:13 2018 +++ src/sys/compat/sys/sockio.h Sun Apr 15 22:13:36 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.11 2018/04/12 18:50:13 christos Exp $ */ +/* $NetBSD: sockio.h,v 1.12 2018/04/15 22:13:36 pgoyette Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -183,7 +183,6 @@ struct oifdatareq { #ifdef _KERNEL -__BEGIN_DECLS extern int (*vec_compat_ifconf)(struct lwp *, u_long, void *); extern int (*vec_compat_ifdatareq)(struct lwp *, u_long, void *); @@ -191,7 +190,6 @@ void uipc_syscalls_40_init(void); void uipc_syscalls_40_fini(void); void uipc_syscalls_50_init(void); void uipc_syscalls_50_fini(void); -__END_DECLS #endif
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pgoyette Date: Sun Apr 15 22:13:36 UTC 2018 Modified Files: src/sys/compat/sys: sockio.h Log Message: Remove unnecessary __BEGIN_DECLS ... __END_DECLS at Christos's suggestion. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Mar 15 03:22:23 UTC 2018 Modified Files: src/sys/compat/sys: uvm.h Log Message: tidy up To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/uvm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/uvm.h diff -u src/sys/compat/sys/uvm.h:1.1 src/sys/compat/sys/uvm.h:1.2 --- src/sys/compat/sys/uvm.h:1.1 Wed Mar 14 23:13:51 2018 +++ src/sys/compat/sys/uvm.h Wed Mar 14 23:22:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm.h,v 1.1 2018/03/15 03:13:51 christos Exp $ */ +/* $NetBSD: uvm.h,v 1.2 2018/03/15 03:22:23 christos Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,17 +32,6 @@ #ifndef _COMPAT_SYS_UVM_H_ #define _COMPAT_SYS_UVM_H_ -void uvm_13_init(void); -void uvm_50_init(void); -void uvm_13_fini(void); -void uvm_50_fini(void); - -struct sys_swapctl_args; - -int (*uvm_swap_stats13)(const struct sys_swapctl_args *, register_t *); -int (*uvm_swap_stats50)(const struct sys_swapctl_args *, register_t *); - -#endif /* _COMPAT_SYS_UVM_H_ */ /* * NetBSD 1.3 swapctl(SWAP_STATS, ...) swapent structure; uses 32 bit * dev_t and has no se_path[] member. @@ -67,3 +56,19 @@ struct swapent50 { int se50_priority; /* priority of this device */ char se50_path[PATH_MAX+1]; /* path name */ }; + +__BEGIN_DECLS + +void uvm_13_init(void); +void uvm_50_init(void); +void uvm_13_fini(void); +void uvm_50_fini(void); + +struct sys_swapctl_args; + +extern int (*uvm_swap_stats13)(const struct sys_swapctl_args *, register_t *); +extern int (*uvm_swap_stats50)(const struct sys_swapctl_args *, register_t *); + +__END_DECLS + +#endif /* _COMPAT_SYS_UVM_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Thu Mar 15 03:22:23 UTC 2018 Modified Files: src/sys/compat/sys: uvm.h Log Message: tidy up To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/uvm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maxv Date: Sat Jul 29 06:12:50 UTC 2017 Modified Files: src/sys/compat/sys: socket.h Log Message: Only compat_43 needs compat_osock. Note that the use of vec_compat_ifioctl is racy. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/socket.h diff -u src/sys/compat/sys/socket.h:1.14 src/sys/compat/sys/socket.h:1.15 --- src/sys/compat/sys/socket.h:1.14 Thu Apr 7 17:48:40 2016 +++ src/sys/compat/sys/socket.h Sat Jul 29 06:12:50 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: socket.h,v 1.14 2016/04/07 17:48:40 mrg Exp $ */ +/* $NetBSD: socket.h,v 1.15 2017/07/29 06:12:50 maxv Exp $ */ /* * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 @@ -43,8 +43,7 @@ #include "opt_compat_43.h" #include "opt_modular.h" -#if defined(COMPAT_43) || defined(COMPAT_LINUX) || defined(COMPAT_SVR4) || \ -defined(COMPAT_ULTRIX) || defined(MODULAR) +#if defined(COMPAT_43) || defined(MODULAR) #define COMPAT_OSOCK #endif
CVS commit: src/sys/compat/sys
Module Name:src Committed By: maxv Date: Sat Jul 29 06:12:50 UTC 2017 Modified Files: src/sys/compat/sys: socket.h Log Message: Only compat_43 needs compat_osock. Note that the use of vec_compat_ifioctl is racy. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: dholland Date: Sat Aug 27 18:54:24 UTC 2016 Modified Files: src/sys/compat/sys: stat.h Log Message: update comment To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/stat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: dholland Date: Sat Aug 27 18:54:24 UTC 2016 Modified Files: src/sys/compat/sys: stat.h Log Message: update comment To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/stat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/stat.h diff -u src/sys/compat/sys/stat.h:1.6 src/sys/compat/sys/stat.h:1.7 --- src/sys/compat/sys/stat.h:1.6 Fri Oct 4 21:07:37 2013 +++ src/sys/compat/sys/stat.h Sat Aug 27 18:54:24 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: stat.h,v 1.6 2013/10/04 21:07:37 christos Exp $ */ +/* $NetBSD: stat.h,v 1.7 2016/08/27 18:54:24 dholland Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -87,7 +87,7 @@ struct stat12 {/* NetBSD-1.2 stat st * stat structure used to contain timespecs, which had different * alignment constraints than a time_t and a long alone. The padding * should be removed the next time the stat structure ABI is changed. - * (This will happen whever we change to 8 byte time_t.) + * (This happened when we changed to 8 byte time_t.) */ #if defined(_LP64) /* && _BSD_TIME_T_ == int */ #define __STATPAD(x) int x;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Thu Apr 7 17:48:40 UTC 2016 Modified Files: src/sys/compat/sys: socket.h Log Message: include opt_compat_netbsd.h to get COMPAT_SOCKCRED70 defined. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/socket.h diff -u src/sys/compat/sys/socket.h:1.13 src/sys/compat/sys/socket.h:1.14 --- src/sys/compat/sys/socket.h:1.13 Wed Apr 6 19:45:45 2016 +++ src/sys/compat/sys/socket.h Thu Apr 7 17:48:40 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: socket.h,v 1.13 2016/04/06 19:45:45 roy Exp $ */ +/* $NetBSD: socket.h,v 1.14 2016/04/07 17:48:40 mrg Exp $ */ /* * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 @@ -36,6 +36,7 @@ #ifdef _KERNEL_OPT +#include "opt_compat_netbsd.h" #include "opt_compat_linux.h" #include "opt_compat_svr4.h" #include "opt_compat_ultrix.h"
CVS commit: src/sys/compat/sys
Module Name:src Committed By: mrg Date: Thu Apr 7 17:48:40 UTC 2016 Modified Files: src/sys/compat/sys: socket.h Log Message: include opt_compat_netbsd.h to get COMPAT_SOCKCRED70 defined. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/compat/sys/socket.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: nat Date: Tue Apr 14 06:11:15 UTC 2015 Modified Files: src/sys/compat/sys: rnd.h Log Message: Include rndio.h for missing defines. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/rnd.h diff -u src/sys/compat/sys/rnd.h:1.2 src/sys/compat/sys/rnd.h:1.3 --- src/sys/compat/sys/rnd.h:1.2 Tue Dec 20 16:38:06 2011 +++ src/sys/compat/sys/rnd.h Tue Apr 14 06:11:15 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.2 2011/12/20 16:38:06 drochner Exp $ */ +/* $NetBSD: rnd.h,v 1.3 2015/04/14 06:11:15 nat Exp $ */ /*- * Copyright (c) 1997,2011 The NetBSD Foundation, Inc. @@ -46,6 +46,7 @@ #endif /* COMPAT_NETBSD32 */ #include sys/rnd.h +#include sys/rndio.h /* * NetBSD-5 used void *state in the rndsource_t struct. rndsource_t
CVS commit: src/sys/compat/sys
Module Name:src Committed By: nat Date: Tue Apr 14 06:11:15 UTC 2015 Modified Files: src/sys/compat/sys: rnd.h Log Message: Include rndio.h for missing defines. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: riastradh Date: Tue Apr 14 12:19:57 UTC 2015 Modified Files: src/sys/compat/sys: rnd.h Log Message: No need for sys/rnd.h here either. Missed this one yesterday too. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/rnd.h diff -u src/sys/compat/sys/rnd.h:1.3 src/sys/compat/sys/rnd.h:1.4 --- src/sys/compat/sys/rnd.h:1.3 Tue Apr 14 06:11:15 2015 +++ src/sys/compat/sys/rnd.h Tue Apr 14 12:19:57 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.3 2015/04/14 06:11:15 nat Exp $ */ +/* $NetBSD: rnd.h,v 1.4 2015/04/14 12:19:57 riastradh Exp $ */ /*- * Copyright (c) 1997,2011 The NetBSD Foundation, Inc. @@ -45,7 +45,6 @@ #include compat/netbsd32/netbsd32.h #endif /* COMPAT_NETBSD32 */ -#include sys/rnd.h #include sys/rndio.h /*
CVS commit: src/sys/compat/sys
Module Name:src Committed By: riastradh Date: Tue Apr 14 12:19:57 UTC 2015 Modified Files: src/sys/compat/sys: rnd.h Log Message: No need for sys/rnd.h here either. Missed this one yesterday too. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Tue Jan 28 01:29:35 UTC 2014 Modified Files: src/sys/compat/sys: dirent.h Log Message: add a struct for the 4.3BSD struct direct To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/dirent.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/dirent.h diff -u src/sys/compat/sys/dirent.h:1.2 src/sys/compat/sys/dirent.h:1.3 --- src/sys/compat/sys/dirent.h:1.2 Sun Dec 11 07:20:29 2005 +++ src/sys/compat/sys/dirent.h Mon Jan 27 20:29:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: dirent.h,v 1.2 2005/12/11 12:20:29 christos Exp $ */ +/* $NetBSD: dirent.h,v 1.3 2014/01/28 01:29:35 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,6 +34,13 @@ #ifndef _COMPAT_SYS_DIRENT_H_ #define _COMPAT_SYS_DIRENT_H_ +struct dirent43 { + u_int32_t d_fileno; /* file number of entry */ + u_int16_t d_reclen; /* length of this record */ + u_int16_t d_namlen; /* length of string in d_name */ + char d_name[255 + 1]; /* name must be no longer than this */ +}; + struct dirent12 { u_int32_t d_fileno; /* file number of entry */ u_int16_t d_reclen; /* length of this record */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Tue Jan 28 01:29:35 UTC 2014 Modified Files: src/sys/compat/sys: dirent.h Log Message: add a struct for the 4.3BSD struct direct To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/sys/dirent.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: apb Date: Fri Oct 19 17:16:55 UTC 2012 Modified Files: src/sys/compat/sys: ttycom.h Log Message: Fix NetBSD version number in a comment To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/ttycom.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/ttycom.h diff -u src/sys/compat/sys/ttycom.h:1.1 src/sys/compat/sys/ttycom.h:1.2 --- src/sys/compat/sys/ttycom.h:1.1 Fri Oct 19 16:55:22 2012 +++ src/sys/compat/sys/ttycom.h Fri Oct 19 17:16:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ttycom.h,v 1.1 2012/10/19 16:55:22 apb Exp $ */ +/* $NetBSD: ttycom.h,v 1.2 2012/10/19 17:16:55 apb Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ /* * The cn and sn fields in struct ptmget changed size from - * char[16] to char[PATH_MAX] in NetBSD-6.99.12. + * char[16] to char[PATH_MAX] in NetBSD-6.99.14. */ struct compat_60_ptmget { int cfd;
CVS commit: src/sys/compat/sys
Module Name:src Committed By: apb Date: Fri Oct 19 17:16:55 UTC 2012 Modified Files: src/sys/compat/sys: ttycom.h Log Message: Fix NetBSD version number in a comment To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/ttycom.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Wed Oct 10 22:51:12 UTC 2012 Added Files: src/sys/compat/sys: syslog.h Log Message: compat hook. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/syslog.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/compat/sys/syslog.h diff -u /dev/null src/sys/compat/sys/syslog.h:1.1 --- /dev/null Wed Oct 10 18:51:12 2012 +++ src/sys/compat/sys/syslog.h Wed Oct 10 18:51:12 2012 @@ -0,0 +1,73 @@ +/* $NetBSD: syslog.h,v 1.1 2012/10/10 22:51:12 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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. + */ +#ifndef _COMPAT_SYS_SYSLOG_H_ +#define _COMPAT_SYS_SYSLOG_H_ + +struct syslog_data60 { + int log_file; + int connected; + int opened; + int log_stat; + const char *log_tag; + int log_fac; + int log_mask; +}; + +__BEGIN_DECLS +#ifdef __LIBC12_SOURCE__ +void closelog_r(struct syslog_data60 *); +void openlog_r(const char *, int, int, struct syslog_data60 *); +int setlogmask_r(int, struct syslog_data60 *); +void syslog_r(int, struct syslog_data60 *, const char *, ...) +__printflike(3, 4); +void vsyslog_r(int, struct syslog_data60 *, const char *, __va_list) +__printflike(3, 0); +void syslogp_r(int, struct syslog_data60 *, const char *, const char *, +const char *, ...) __printflike(5, 6); +void vsyslogp_r(int, struct syslog_data60 *, const char *, const char *, +const char *, __va_list) __printflike(5, 0); + +struct syslog_data; +void __closelog_r60(struct syslog_data *); +void __openlog_r60(const char *, int, int, struct syslog_data *); +int __setlogmask_r60(int, struct syslog_data *); +void __syslog_r60(int, struct syslog_data *, const char *, ...) +__printflike(3, 4); +void __vsyslog_r60(int, struct syslog_data *, const char *, __va_list) +__printflike(3, 0); +void __syslogp_r60(int, struct syslog_data *, const char *, const char *, +const char *, ...) __printflike(5, 6); +void __vsyslogp_r60(int, struct syslog_data *, const char *, const char *, +const char *, __va_list) __printflike(5, 0); +#endif +__END_DECLS + +#endif /* !_COMPAT_SYS_SYSLOG_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Wed Oct 10 22:51:12 UTC 2012 Added Files: src/sys/compat/sys: syslog.h Log Message: compat hook. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/syslog.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: njoly Date: Sun Mar 18 21:48:47 UTC 2012 Modified Files: src/sys/compat/sys: ucontext.h Log Message: Add missing semi-colon. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/ucontext.h diff -u src/sys/compat/sys/ucontext.h:1.4 src/sys/compat/sys/ucontext.h:1.5 --- src/sys/compat/sys/ucontext.h:1.4 Wed Feb 23 02:58:39 2011 +++ src/sys/compat/sys/ucontext.h Sun Mar 18 21:48:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ucontext.h,v 1.4 2011/02/23 02:58:39 joerg Exp $ */ +/* $NetBSD: ucontext.h,v 1.5 2012/03/18 21:48:47 njoly Exp $ */ /*- * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ struct __ucontext32 { }; #ifdef __UCONTEXT32_SIZE -__CTASSERT(sizeof(ucontext32_t) == __UCONTEXT32_SIZE) +__CTASSERT(sizeof(ucontext32_t) == __UCONTEXT32_SIZE); #endif #endif /* COMPAT_NETBSD32 _KERNEL */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: njoly Date: Sun Mar 18 21:48:47 UTC 2012 Modified Files: src/sys/compat/sys: ucontext.h Log Message: Add missing semi-colon. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/compat/sys
On Tue, 20 Dec 2011, Matthias Drochner wrote: Module Name:src Committed By: drochner Date: Tue Dec 20 16:38:06 UTC 2011 Modified Files: src/sys/compat/sys: rnd.h Log Message: allow kernels w/o COMPAT_50 to build What was the actual problem? Nothing defined by this file is supposed to be used in a kernel without COMPAT_50; if something is being used accidentally then I'd like to fix that. --apb (Alan Barrett)
Re: CVS commit: src/sys/compat/sys
On Tue, 20 Dec 2011, Alan Barrett wrote: On Tue, 20 Dec 2011, Matthias Drochner wrote: Modified Files: src/sys/compat/sys: rnd.h Log Message: allow kernels w/o COMPAT_50 to build What was the actual problem? Nothing defined by this file is supposed to be used in a kernel without COMPAT_50; if something is being used accidentally then I'd like to fix that. OK, I found it. rndpseudo_50.o is unconditionally compiled and added to libcompat in the kernel build directory. Everything else in sys/compat/common is handled in the same way. I am inclined to wrap most of the contents of compat/common/rndpseudo_50.c and compat/sys/rnd.h in #ifdef COMPAT_50 guards, although other files in compat/common and compat/sys do not seem to do this. --apb (Alan Barrett)
CVS commit: src/sys/compat/sys
Module Name:src Committed By: drochner Date: Tue Dec 20 16:38:06 UTC 2011 Modified Files: src/sys/compat/sys: rnd.h Log Message: allow kernels w/o COMPAT_50 to build To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/rnd.h diff -u src/sys/compat/sys/rnd.h:1.1 src/sys/compat/sys/rnd.h:1.2 --- src/sys/compat/sys/rnd.h:1.1 Mon Dec 19 21:53:52 2011 +++ src/sys/compat/sys/rnd.h Tue Dec 20 16:38:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.1 2011/12/19 21:53:52 apb Exp $ */ +/* $NetBSD: rnd.h,v 1.2 2011/12/20 16:38:06 drochner Exp $ */ /*- * Copyright (c) 1997,2011 The NetBSD Foundation, Inc. @@ -47,8 +47,6 @@ #include sys/rnd.h -#ifdef COMPAT_50 - /* * NetBSD-5 used void *state in the rndsource_t struct. rndsource_t * was used in rnstat_t and rnstat_name_t, which were used by @@ -149,6 +147,4 @@ int compat_50_rnd_ioctl(struct file *, u #define RNDGETSRCNAME50_32 _IOWR('R', 103, rndstat_name50_32_t) #endif /* COMPAT_NETBSD32 */ -#endif /* COMPAT_50 */ - #endif /* !_COMPAT_SYS_RND_H_ */
CVS commit: src/sys/compat/sys
Module Name:src Committed By: drochner Date: Tue Dec 20 16:38:06 UTC 2011 Modified Files: src/sys/compat/sys: rnd.h Log Message: allow kernels w/o COMPAT_50 to build To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/rnd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: joerg Date: Tue May 24 18:29:23 UTC 2011 Modified Files: src/sys/compat/sys: ipc.h Log Message: Give the body the same static inline treatment as the definition To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/ipc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/ipc.h diff -u src/sys/compat/sys/ipc.h:1.3 src/sys/compat/sys/ipc.h:1.4 --- src/sys/compat/sys/ipc.h:1.3 Mon Jan 19 19:39:41 2009 +++ src/sys/compat/sys/ipc.h Tue May 24 18:29:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ipc.h,v 1.3 2009/01/19 19:39:41 christos Exp $ */ +/* $NetBSD: ipc.h,v 1.4 2011/05/24 18:29:23 joerg Exp $ */ /* * Copyright (c) 1990, 1993 @@ -77,7 +77,7 @@ #undef CVT } -void +static inline void __native_to_ipc_perm14(const struct ipc_perm *perm, struct ipc_perm14 *operm) {
CVS commit: src/sys/compat/sys
Module Name:src Committed By: joerg Date: Tue May 24 18:29:23 UTC 2011 Modified Files: src/sys/compat/sys: ipc.h Log Message: Give the body the same static inline treatment as the definition To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/sys/ipc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: uebayasi Date: Sun Nov 14 15:36:47 UTC 2010 Modified Files: src/sys/compat/sys: sockio.h Log Message: Include sys/ioccom.h directly because it's used. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.9 src/sys/compat/sys/sockio.h:1.10 --- src/sys/compat/sys/sockio.h:1.9 Sun Nov 7 19:45:06 2010 +++ src/sys/compat/sys/sockio.h Sun Nov 14 15:36:47 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.9 2010/11/07 19:45:06 pooka Exp $ */ +/* $NetBSD: sockio.h,v 1.10 2010/11/14 15:36:47 uebayasi Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -37,6 +37,8 @@ #include opt_compat_netbsd.h #include opt_modular.h +#include sys/ioccom.h + #if defined(COMPAT_09) || defined(COMPAT_10) || defined(COMPAT_11) || \ defined(COMPAT_12) || defined(COMPAT_13) || defined(COMPAT_14) || \ defined(COMPAT_15) || defined(COMPAT_16) || defined(COMPAT_20) || \
CVS commit: src/sys/compat/sys
Module Name:src Committed By: uebayasi Date: Sun Nov 14 15:36:47 UTC 2010 Modified Files: src/sys/compat/sys: sockio.h Log Message: Include sys/ioccom.h directly because it's used. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pooka Date: Sun Nov 7 19:45:06 UTC 2010 Modified Files: src/sys/compat/sys: sockio.h Log Message: If someone wants to define COMPAT_OIFDATA / COMPAT_OIFREQ outside of config, let them. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/sockio.h diff -u src/sys/compat/sys/sockio.h:1.8 src/sys/compat/sys/sockio.h:1.9 --- src/sys/compat/sys/sockio.h:1.8 Sat Nov 28 22:11:42 2009 +++ src/sys/compat/sys/sockio.h Sun Nov 7 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sockio.h,v 1.8 2009/11/28 22:11:42 dsl Exp $ */ +/* $NetBSD: sockio.h,v 1.9 2010/11/07 19:45:06 pooka Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -52,11 +52,6 @@ #define COMPAT_OIFDATA #endif -#else /* !_KERNEL_OPT */ - -#undef COMPAT_OIFREQ -#undef COMPAT_OIFDATA - #endif /* _KERNEL_OPT */ struct oifreq {
CVS commit: src/sys/compat/sys
Module Name:src Committed By: pooka Date: Sun Nov 7 19:45:06 UTC 2010 Modified Files: src/sys/compat/sys: sockio.h Log Message: If someone wants to define COMPAT_OIFDATA / COMPAT_OIFREQ outside of config, let them. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sys/sockio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/sys
Module Name:src Committed By: christos Date: Wed Apr 1 21:15:23 UTC 2009 Modified Files: src/sys/compat/sys: shm.h Log Message: cast segsz to int. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/sys/shm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/sys/shm.h diff -u src/sys/compat/sys/shm.h:1.6 src/sys/compat/sys/shm.h:1.7 --- src/sys/compat/sys/shm.h:1.6 Mon Jan 19 14:39:41 2009 +++ src/sys/compat/sys/shm.h Wed Apr 1 17:15:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: shm.h,v 1.6 2009/01/19 19:39:41 christos Exp $ */ +/* $NetBSD: shm.h,v 1.7 2009/04/01 21:15:23 christos Exp $ */ /* * Copyright (c) 1994 Adam Glass @@ -115,7 +115,7 @@ #define CVT(x) oshmbuf-x = shmbuf-x #define CVTI(x) oshmbuf-x = (int)shmbuf-x - CVT(shm_segsz); + CVTI(shm_segsz); CVT(shm_lpid); CVT(shm_cpid); CVT(shm_nattch);