os, syscall: Hurd fixes for a couple of tests

Based on patch by Svante Signell.
    
    Reviewed-on: https://go-review.googlesource.com/c/161520

From-SVN: r268605
This commit is contained in:
Ian Lance Taylor 2019-02-07 05:02:26 +00:00
parent 4a3e25712f
commit 18591d3ee7
3 changed files with 12 additions and 6 deletions

View File

@ -1,4 +1,4 @@
28b65174d9c9163f4ab2cfaf70dca646f1a7611f 9b66264ed6adcf3fd215dbfd125c12b022b7280e
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.

View File

@ -1336,6 +1336,10 @@ func TestSeek(t *testing.T) {
t.Logf("skipping test case #%d on nacl; https://golang.org/issue/21728", i) t.Logf("skipping test case #%d on nacl; https://golang.org/issue/21728", i)
continue continue
} }
if runtime.GOOS == "hurd" && tt.out > 1<<32 {
t.Logf("skipping test case #%d on Hurd: file too large", i)
continue
}
off, err := f.Seek(tt.in, tt.whence) off, err := f.Seek(tt.in, tt.whence)
if off != tt.out || err != nil { if off != tt.out || err != nil {
if e, ok := err.(*PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 && runtime.GOOS == "linux" { if e, ok := err.(*PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 && runtime.GOOS == "linux" {

View File

@ -46,11 +46,13 @@ func _() {
// fcntl file locking structure and constants // fcntl file locking structure and constants
var ( var (
_ = syscall.Flock_t{ _ = syscall.Flock_t{
Type: int16(0), // Comment out the Type and Whence tests because
Whence: int16(0), // on the Hurd they are int32, not int16.
Start: int64(0), // Type: int16(0),
Len: int64(0), // Whence: int16(0),
Pid: int32(0), Start: int64(0),
Len: int64(0),
Pid: int32(0),
} }
) )
const ( const (