]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ld, internal/syscall/unix: use posix_fallocate on netbsd
authorTobias Klauser <tklauser@distanz.ch>
Wed, 6 Aug 2025 15:50:14 +0000 (17:50 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Mon, 11 Aug 2025 22:25:38 +0000 (15:25 -0700)
commitce3f3e2ae73dcc0c270bc73a59ea5e7be6cf6a8d
treed2150a07215ad3569c725b23b4dca3df54be524e
parent3dbef65bf37f1b7ccd1f884761341a5a15456ffa
cmd/link/internal/ld, internal/syscall/unix: use posix_fallocate on netbsd

The posix_fallocate system call is available since NetBSD 7.0, see
https://man.netbsd.org/posix_fallocate.2

Re-use the syscall wrappers already in place for freebsd. Note that
posix_fallocate on netbsd also returns the result in r1 rather than in
errno:

> If successful, posix_fallocate() returns zero. It returns an error on failure, without
> setting errno.

Source: https://man.netbsd.org/posix_fallocate.2#RETURN%20VALUES

Cq-Include-Trybots: luci.golang.try:gotip-netbsd-arm64
Change-Id: Iaa1f6a805d511645da7f1d2737235bfd42da3407
Reviewed-on: https://go-review.googlesource.com/c/go/+/480475
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/link/internal/ld/fallocate_test.go
src/cmd/link/internal/ld/outbuf_bsd.go [moved from src/cmd/link/internal/ld/outbuf_freebsd.go with 90% similarity]
src/cmd/link/internal/ld/outbuf_mmap.go
src/cmd/link/internal/ld/outbuf_nofallocate.go
src/internal/syscall/unix/at_sysnum_netbsd.go
src/internal/syscall/unix/fallocate_bsd_386.go [moved from src/internal/syscall/unix/fallocate_freebsd_386.go with 85% similarity]
src/internal/syscall/unix/fallocate_bsd_64bit.go [moved from src/internal/syscall/unix/fallocate_freebsd_64bit.go with 82% similarity]
src/internal/syscall/unix/fallocate_bsd_arm.go [moved from src/internal/syscall/unix/fallocate_freebsd_arm.go with 90% similarity]