Module Name: src Committed By: christos Date: Fri Jan 19 18:39:15 UTC 2024
Modified Files: src/sys/compat/common: kern_time_50.c src/sys/compat/sys: mount.h resource.h statvfs.h Log Message: Add missing decls, make rusage_to_rusage50 static inline. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/kern_time_50.c cvs rdiff -u -r1.15 -r1.16 src/sys/compat/sys/mount.h cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/resource.h cvs rdiff -u -r1.4 -r1.5 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/common/kern_time_50.c diff -u src/sys/compat/common/kern_time_50.c:1.37 src/sys/compat/common/kern_time_50.c:1.38 --- src/sys/compat/common/kern_time_50.c:1.37 Tue Sep 7 07:43:02 2021 +++ src/sys/compat/common/kern_time_50.c Fri Jan 19 13:39:15 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_time_50.c,v 1.37 2021/09/07 11:43:02 riastradh Exp $ */ +/* $NetBSD: kern_time_50.c,v 1.38 2024/01/19 18:39:15 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.37 2021/09/07 11:43:02 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.38 2024/01/19 18:39:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -456,18 +456,6 @@ compat_50_sys_mq_timedreceive(struct lwp #endif } -void -rusage_to_rusage50(const struct rusage *ru, struct rusage50 *ru50) -{ - memset(ru50, 0, sizeof(*ru50)); - (void)memcpy(&ru50->ru_first, &ru->ru_first, - (char *)&ru50->ru_last - (char *)&ru50->ru_first + - sizeof(ru50->ru_last)); - ru50->ru_maxrss = ru->ru_maxrss; - timeval_to_timeval50(&ru->ru_utime, &ru50->ru_utime); - timeval_to_timeval50(&ru->ru_stime, &ru50->ru_stime); -} - int compat_50_sys_getrusage(struct lwp *l, const struct compat_50_sys_getrusage_args *uap, register_t *retval) Index: src/sys/compat/sys/mount.h diff -u src/sys/compat/sys/mount.h:1.15 src/sys/compat/sys/mount.h:1.16 --- src/sys/compat/sys/mount.h:1.15 Mon Aug 30 04:40:00 2021 +++ src/sys/compat/sys/mount.h Fri Jan 19 13:39:15 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.15 2021/08/30 08:40:00 riastradh Exp $ */ +/* $NetBSD: mount.h,v 1.16 2024/01/19 18:39:15 christos Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -194,6 +194,12 @@ int __compat___fhstat30(const struct com int __compat___fhstat40(const void *, size_t, struct stat30 *) __dso_hidden; struct stat; int __fhstat50(const void *, size_t, struct stat *); +int __fhopen40(const void *, size_t, int); +int fhopen(const struct compat_30_fhandle *, int); +int __getfh30(const char *, void*, size_t *); +int getfh(const char *path, struct compat_30_fhandle *fhp); +int mount(const char *, const char *, int, void *); +int __mount50(const char *, const char *, int, void *, size_t); #endif /* _NETBSD_SOURCE */ __END_DECLS Index: src/sys/compat/sys/resource.h diff -u src/sys/compat/sys/resource.h:1.5 src/sys/compat/sys/resource.h:1.6 --- src/sys/compat/sys/resource.h:1.5 Fri Oct 4 17:07:37 2013 +++ src/sys/compat/sys/resource.h Fri Jan 19 13:39:15 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: resource.h,v 1.5 2013/10/04 21:07:37 christos Exp $ */ +/* $NetBSD: resource.h,v 1.6 2024/01/19 18:39:15 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -57,7 +57,17 @@ struct rusage50 { long ru_nivcsw; /* involuntary " */ }; -void rusage_to_rusage50(const struct rusage *, struct rusage50 *); +static __inline void +rusage_to_rusage50(const struct rusage *ru, struct rusage50 *ru50) +{ + memset(ru50, 0, sizeof(*ru50)); + (void)memcpy(&ru50->ru_first, &ru->ru_first, + (char *)&ru50->ru_last - (char *)&ru50->ru_first + + sizeof(ru50->ru_last)); + ru50->ru_maxrss = ru->ru_maxrss; + timeval_to_timeval50(&ru->ru_utime, &ru50->ru_utime); + timeval_to_timeval50(&ru->ru_stime, &ru50->ru_stime); +} #ifndef _KERNEL __BEGIN_DECLS Index: src/sys/compat/sys/statvfs.h diff -u src/sys/compat/sys/statvfs.h:1.4 src/sys/compat/sys/statvfs.h:1.5 --- src/sys/compat/sys/statvfs.h:1.4 Tue Sep 7 07:43:05 2021 +++ src/sys/compat/sys/statvfs.h Fri Jan 19 13:39:15 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: statvfs.h,v 1.4 2021/09/07 11:43:05 riastradh Exp $ */ +/* $NetBSD: statvfs.h,v 1.5 2024/01/19 18:39:15 christos Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -155,6 +155,10 @@ int __getvfsstat90(struct statvfs *, siz int __getmntinfo90(struct statvfs **, int); +struct compat_30_fhandle; +int fhstatvfs(const struct compat_30_fhandle *, struct statvfs90 *); +int fhstatvfs1(const struct compat_30_fhandle *, struct statvfs90 *, int); + #endif /* __LIBC12_SOURCE__ */ #endif /* _KERNEL */