Source-Changes-HG archive

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

[src/trunk]: src/sys/compat compute the value to be used for e_arglen via how...



details:   https://anonhg.NetBSD.org/src/rev/c789b9b6aebb
branches:  trunk
changeset: 472512:c789b9b6aebb
user:      cgd <cgd%NetBSD.org@localhost>
date:      Fri Apr 30 23:07:01 1999 +0000

description:
compute the value to be used for e_arglen via howmany(value, sizeof (char *)),
rather than just "value / sizeof (char *)".  While in these cases the latter
works as well, the former's a better example for other uses to copy (since
it handles the non-integral multiple case correctly).

diffstat:

 sys/compat/freebsd/freebsd_exec.h          |  4 ++--
 sys/compat/ibcs2/ibcs2_exec.c              |  4 ++--
 sys/compat/linux/common/linux_exec_elf32.c |  4 ++--
 sys/compat/svr4/svr4_exec.h                |  6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diffs (75 lines):

diff -r 2b35b93900bc -r c789b9b6aebb sys/compat/freebsd/freebsd_exec.h
--- a/sys/compat/freebsd/freebsd_exec.h Fri Apr 30 23:02:06 1999 +0000
+++ b/sys/compat/freebsd/freebsd_exec.h Fri Apr 30 23:07:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: freebsd_exec.h,v 1.4 1999/02/09 20:17:50 christos Exp $        */
+/*     $NetBSD: freebsd_exec.h,v 1.5 1999/04/30 23:07:01 cgd Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -100,7 +100,7 @@
 #endif /* EXEC_AOUT */
 
 #ifdef EXEC_ELF32
-#define FREEBSD_ELF_AUX_ARGSIZ (sizeof(AuxInfo) * 8 / sizeof(char *))
+#define FREEBSD_ELF_AUX_ARGSIZ howmany(sizeof(AuxInfo) * 8, sizeof(char *))
 
 #define FREEBSD_ELF_BRAND_STRING "FreeBSD"
 #define FREEBSD_ELF_INTERP_PREFIX_STRING "/usr/libexec/ld-elf.so"
diff -r 2b35b93900bc -r c789b9b6aebb sys/compat/ibcs2/ibcs2_exec.c
--- a/sys/compat/ibcs2/ibcs2_exec.c     Fri Apr 30 23:02:06 1999 +0000
+++ b/sys/compat/ibcs2/ibcs2_exec.c     Fri Apr 30 23:07:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_exec.c,v 1.22 1999/02/09 20:22:37 christos Exp $ */
+/*     $NetBSD: ibcs2_exec.c,v 1.23 1999/04/30 23:07:01 cgd Exp $      */
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -69,7 +69,7 @@
 #include <compat/ibcs2/ibcs2_syscall.h>
 
 
-#define IBCS2_ELF_AUX_ARGSIZ   (sizeof(AuxInfo) * 8 / sizeof(char *))
+#define IBCS2_ELF_AUX_ARGSIZ   howmany(sizeof(AuxInfo) * 8, sizeof(char *))
 
 
 int exec_ibcs2_coff_prep_omagic __P((struct proc *, struct exec_package *,
diff -r 2b35b93900bc -r c789b9b6aebb sys/compat/linux/common/linux_exec_elf32.c
--- a/sys/compat/linux/common/linux_exec_elf32.c        Fri Apr 30 23:02:06 1999 +0000
+++ b/sys/compat/linux/common/linux_exec_elf32.c        Fri Apr 30 23:07:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec_elf32.c,v 1.41 1999/02/09 20:37:19 christos Exp $   */
+/*     $NetBSD: linux_exec_elf32.c,v 1.42 1999/04/30 23:07:01 cgd Exp $        */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
        struct exec_package *, Elf_Ehdr *));
 #endif
 
-#define LINUX_ELF_AUX_ARGSIZ (sizeof(AuxInfo) * 8 / sizeof(char *))
+#define LINUX_ELF_AUX_ARGSIZ howmany(sizeof(AuxInfo) * 8, sizeof(char *))
 
 
 extern char linux_sigcode[], linux_esigcode[];
diff -r 2b35b93900bc -r c789b9b6aebb sys/compat/svr4/svr4_exec.h
--- a/sys/compat/svr4/svr4_exec.h       Fri Apr 30 23:02:06 1999 +0000
+++ b/sys/compat/svr4/svr4_exec.h       Fri Apr 30 23:07:01 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_exec.h,v 1.12 1999/04/19 21:22:56 kleink Exp $     */
+/*     $NetBSD: svr4_exec.h,v 1.13 1999/04/30 23:07:01 cgd Exp $        */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -40,9 +40,9 @@
 #define        _SVR4_EXEC_H_
 
 #ifdef SVR4_COMPAT_SOLARIS2
-# define SVR4_AUX_ARGSIZ (sizeof(AuxInfo) * 12 / sizeof(char *))
+# define SVR4_AUX_ARGSIZ howmany(sizeof(AuxInfo) * 12, sizeof(char *))
 #else
-# define SVR4_AUX_ARGSIZ (sizeof(AuxInfo) * 8 / sizeof(char *))
+# define SVR4_AUX_ARGSIZ howmany(sizeof(AuxInfo) * 8, sizeof(char *))
 #endif
 
 /*



Home | Main Index | Thread Index | Old Index