#!/bin/bash
./mkerrors_sw64.sh |gofmt >zerrors_linux_sw64.go
./mksyscall.pl -tags linux,sw64 syscall_linux.go syscall_linux_sw64.go |gofmt >zsyscall_linux_sw64.go 
# Getpid、Getppid handle specially for sw64, currently manually remove the implements of Getpid and Getppid in zsyscall_linux_sw64.go
# getxuid、getxgid assignment mismatch: 2 variables but Syscall returns 3 values
./mksysnum_linux.pl /usr/include/asm/unistd.h |gofmt >zsysnum_linux_sw64.go
go tool cgo -godefs types_linux.go |go run mkpost.go >ztypes_linux_sw64.go
# replace ztypes_linux_sw64.go with this
# type Statfs_t struct {
#      Type    int64
#      Bsize   int64
#      Blocks  uint64
#      Bfree   uint64
#      Bavail  uint64
#      Files   uint64
#      Ffree   uint64
#      Fsid    Fsid
#      Namelen int64
#      Frsize  int64
#      Flags   int64
#      Spare   [4]int64
# }

# replace Blocks uint64 to int64 in ztypes_linux_sw64.go of Stat_t struct
