Ports over the following commits from FreeBSD: https://github.com/freebsd/freebsd-src/commit/b848a37d4eddb432629a799713cf6fb6f0fd8c3c https://github.com/freebsd/freebsd-src/commit/2cff354f1a56af10ad02164a9ee38c013ac80688 Fixes #14323. Change-Id: If75642a45fc76b50d4377e5a11cdb1ee64ab40ab Reviewed-on: https://review.haiku-os.org/c/haiku/+/10396 Tested-by: Commit checker robot <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>