From 4ff782c06a56281b113df6dbf48bb397ddcb020a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 10 Aug 2023 14:56:53 +0000 Subject: [PATCH] tcopy: Pick up max blocksize from sysctl kern.maxphys --- usr.bin/tcopy/tcopy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/tcopy/tcopy.c b/usr.bin/tcopy/tcopy.c index 24dcc969a9af..ef0da430002e 100644 --- a/usr.bin/tcopy/tcopy.c +++ b/usr.bin/tcopy/tcopy.c @@ -52,6 +52,7 @@ static const char sccsid[] = "@(#)tcopy.c 8.2 (Berkeley) 4/17/94"; #include #include #include +#include #include #include #include @@ -82,6 +83,11 @@ main(int argc, char *argv[]) int ch, needeof; char *buff; const char *inf; + unsigned long maxphys = 0; + size_t l_maxphys = sizeof maxphys; + + if (!sysctlbyname("kern.maxphys", &maxphys, &l_maxphys, NULL, 0)) + maxblk = maxphys; msg = stdout; guesslen = 1;