2017-02-14 :-(
_ [NetBSD][sysctl][メモリ]sysctl の hw.physmem
3GB のメモリを積んでるマシンで実行すると溢れます。マニュアルを読んだら 32 ビットでちた。hw.physmem64 を使いましょう。
% man 7 sysctl
The hw.* subtree The string and integer information available for the hw level is detailed below. The changeable column shows whether a process with appropriate privilege may change the value. Second level name Type Changeable hw.alignbytes integer no hw.byteorder integer no hw.cnmagic string yes hw.disknames string no hw.diskstats struct no hw.machine string no hw.machine_arch string no hw.model string no hw.ncpu integer no hw.ncpuonline integer no hw.pagesize integer no hw.physmem integer no hw.physmem64 quad no hw.usermem integer no hw.usermem64 quad no
% /sbin/sysctl -n hw.physmem hw.physmem64 -1074204672 3220762624
[ツッコミを入れる]