unix: rename Stat_t time fields to [AMCB]tim

Birthtime/Birthtimespec was renamed to Btim to match the others.
Also unexport the [ACMB]tim_ext fields on freebsd 386.
Update mkpost.go to do the renames.

Ran the following on the existing ztypes_*.go files:

  #!/bin/sh
  set -e

  for f in ztypes_*.go; do
      cat $f | go run mkpost.go | gofmt > $f.tmp
      mv $f.tmp $f
  done;

  cat ztypes_freebsd_386.go | env GOOS=freebsd GOARCH=386 go run mkpost.go | gofmt > ztypes_freebsd_386.go.tmp
  mv ztypes_freebsd_386.go{.tmp,}

Fixes golang/go#31735

Change-Id: I15765d690ee8d2be6bbb37f465322bc019722e08
Reviewed-on: https://go-review.googlesource.com/c/sys/+/175157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Yuval Pavel Zholkover
2019-05-15 19:05:49 +00:00
committed by Brad Fitzpatrick
parent 06a5c49444
commit 87c872767d
16 changed files with 354 additions and 335 deletions
+10
View File
@@ -58,3 +58,13 @@ func TestUname(t *testing.T) {
t.Logf("OS: %s/%s %s", utsname.Sysname[:], utsname.Machine[:], utsname.Release[:])
}
// Test that this compiles. (Issue #31735)
func TestStatFieldNames(t *testing.T) {
var st unix.Stat_t
var ts *unix.Timespec
ts = &st.Atim
ts = &st.Mtim
ts = &st.Ctim
_ = ts
}