You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fstatfs_zos.go
    path of file: ./repos/streamdal/apps/server/vendor/golang.org/x/sys/unix
    
    the code of the file until where you have to start completion: // Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build zos && s390x

package unix

import (
	"unsafe"
)

// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent.

func Fstatfs(fd int, stat *Statfs_t) (err error) {
	var stat_v Statvfs_t
	err = Fstatvfs(fd, &stat_v)
	if err == nil {
		// populate stat
		stat.Type = 0
		stat.Bsize = stat_v.Bsize
		stat.Blocks = stat_v.Blocks
		stat.Bfree = stat_v.Bfree
		stat.Bavail = stat_v.Bavail
		stat.Files = stat_v.Files
		stat.Ffree = stat_v.Ffree
		stat.Fsid = stat_v.Fsid
		stat.Namelen = stat_v.Namemax
		stat.Frsize = stat_v.Frsize
		
    
func Fstatfs(fd int, stat *Statfs_t) (err error) {
	var stat_v Statvfs_t
	err = Fstatvfs(fd, &stat_v)
	if err == nil {
		// populate stat
		stat.Type = 0
		stat.Bsize = stat_v.Bsize
		stat.Blocks = stat_v.Blocks
		stat.Bfree = stat_v.Bfree
		stat.Bavail = stat_v.Bavail
		stat.Files = stat_v.Files
		stat.Ffree = stat_v.Ffree
		stat.Fsid = stat_v.Fsid
		stat.Namelen = stat_v.Namemax
		stat.Frsize = stat_v.Frsize
		stat.Flags = stat_v.Flag
		for passn := 0; passn < 5; passn++ {
			switch passn {
			case 0:
				err = tryGetmntent64(stat)
				break
			case 1:
				err = tryGetmntent128(stat)
				break
			case 2:
				err = tryGetmntent256(stat)
				break
			case 3:
				err = tryGetmntent512(stat)
				break
			case 4:
				err = tryGetmntent1024(stat)
				break
			default:
				break
			}
			//proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred)
			if err == nil || err != nil && err != ERANGE {
				break
			}
		}
	}
	return err
}