From af8a9059d3c7fcc767e9a22713e5e0d525d06912 Mon Sep 17 00:00:00 2001 From: cgd Date: Fri, 30 Apr 1999 23:07:01 +0000 Subject: [PATCH] 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). --- 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(-) diff --git a/sys/compat/freebsd/freebsd_exec.h b/sys/compat/freebsd/freebsd_exec.h index e8ff805b677f..2791840bd8b2 100644 --- a/sys/compat/freebsd/freebsd_exec.h +++ b/sys/compat/freebsd/freebsd_exec.h @@ -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 @@ int exec_freebsd_aout_makecmds __P((struct proc *, struct exec_package *)); #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 --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c index 61cddfbf5873..17475535a164 100644 --- a/sys/compat/ibcs2/ibcs2_exec.c +++ b/sys/compat/ibcs2/ibcs2_exec.c @@ -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 -#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 --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c index 338afc297ba7..33aec71424d9 100644 --- a/sys/compat/linux/common/linux_exec_elf32.c +++ b/sys/compat/linux/common/linux_exec_elf32.c @@ -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 @@ static int ELFNAME2(linux,gcc_signature) __P((struct proc *p, 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 --git a/sys/compat/svr4/svr4_exec.h b/sys/compat/svr4/svr4_exec.h index d941b831449b..8b69c2d9e18f 100644 --- a/sys/compat/svr4/svr4_exec.h +++ b/sys/compat/svr4/svr4_exec.h @@ -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 /*