Open clausecker opened 4 months ago
Currently fixing some bugs with the patch set. The Tv field in Utmpx should be a Timeval (which is a structure), but it's an uint64 in all the files for some reason. This is wrong and will lead to wrong results. Apparently this was changed in 2fd3f03f8455356d7e0034fbeed6356dc15c2499 and I don't know why.
Also note that the utmp structure no longer exists, it appears to be a legacy of FreeBSD 9.
Thank you for your contribution! So are you still trying to edit this PR related to Tv
in Utmpx
? Then, we will wait to approve.
Also note that the utmp structure no longer exists, it appears to be a legacy of FreeBSD 9.
Yes, it is just for a compatibility. But, perhaps, we can remove because FreeBSD 9 was released 10 years ago.
So are you still trying to edit this PR related to Tv in Utmpx?
I'm not sure what to do here. The Tv
field is wrong on the other 64 bit architectures, too. It is always a structure, not a 64 bit integer. If I was to fix the behaviour of this field for riscv64, I would have to touch all other architectures, too.
Yes, it is just for a compatibility. But, perhaps, we can remove because FreeBSD 9 was released 10 years ago.
Maybe that would be a good idea indeed.
When I run build test by GOOS=freebsd GOARCH=riscv64 go test ./...
, build was failed on host
.
host/host_freebsd_riscv64.go:26:8: undefined: _cgopackage
host/host_freebsd.go:73:31: u.Tv undefined (type Utmpx has no field or method Tv)
I found #709 and remember why freebsd_headers
is included and Tv is not a struct.
Regarding the u.Tv undefined
error in utmpx.Tv, it seems that uint64_t
in utxdb.h
cannot be resolved, resulting in Pad_cgo_0. I have tried various approaches to solve this issue, but it also results in Pad_cgo_0 on amd64. Do you have any idea why this is happening? I believe it was not an issue when it was generated in the past.
For #1425. This enables gopsutil to work on riscv64 FreeBSD.
I also fixed an include directive so mktypes.sh would succeed.