]> Cypherpunks repositories - gostls13.git/commit
os: emulate plan 9 libc in stat
authorDavid du Colombier <0intro@gmail.com>
Sun, 25 Jan 2015 01:19:39 +0000 (02:19 +0100)
committerDavid du Colombier <0intro@gmail.com>
Mon, 26 Jan 2015 06:34:07 +0000 (06:34 +0000)
commit2a74f436aa437d5392eb4a2cc58c0f54fa731d85
tree5015b5f90083074b2ecaa43e462cc18e79f5a45f
parente24e299f41fd0198ac2c3391505c01c63c580d0b
os: emulate plan 9 libc in stat

This change is a recreation of the CL written
by Nick Owens on http://golang.org/cl/150730043.

If the stat buffer is too short, the kernel
informs us by putting the 2-byte size in the
buffer, so we read that and try again.

This follows the same algorithm as /sys/src/libc/9sys/dirfstat.c.

Fixes #8781.

Change-Id: I01b4ad3a5e705dd4cab6673c7a119f8bef9bbd7c
Reviewed-on: https://go-review.googlesource.com/3281
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/stat_plan9.go