mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 14:21:18 +01:00
tcopy: Pick up max blocksize from sysctl kern.maxphys
This commit is contained in:
parent
0eb8cd1de2
commit
4ff782c06a
@ -52,6 +52,7 @@ static const char sccsid[] = "@(#)tcopy.c 8.2 (Berkeley) 4/17/94";
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <paths.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user