]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix size calculation for file space preallocation on darwin
authorCherry Zhang <cherryyz@google.com>
Mon, 18 May 2020 19:23:46 +0000 (15:23 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 21 May 2020 14:48:43 +0000 (14:48 +0000)
commit39ea0ea05dcfa281dc5977410b60458f2d2adb99
tree81a3d8c2932b6d4e8364ca97f55058ce72fe0c5f
parentfed33d76bcf5d378f0322b308768d156239b0bfc
cmd/link: fix size calculation for file space preallocation on darwin

On darwin, we preallocate file storage space with fcntl
F_ALLOCATEALL in F_PEOFPOSMODE mode. This is specified as
allocating from the physical end of the file. So the size we give
it should be the increment, instead of the total size.

Fixes #39044.

Change-Id: I10c7ee8d51f237b4a7604233ac7abc6f91dcd602
Reviewed-on: https://go-review.googlesource.com/c/go/+/234481
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/fallocate_test.go [new file with mode: 0644]
src/cmd/link/internal/ld/outbuf_darwin.go