A tiny package to help with dealing with constructing Linux ioctl(2) request values that are not already included in the sys/unix standard package.
A good example are ioctl_ns(2) operations on Linux namespaces. For instance, this ioctl operation request value is defined in include/uapi/linux/nsfs.h in the Linux kernel C headers as follows:
#define NSIO 0xb7
/* Returns a file descriptor that refers to an owning user namespace */
#define NS_GET_USERNS _IO(NSIO, 0x1)
These definitions can now be applied to Go code as follows:
import "github.com/thediveo/ioctl"
const NSIO = 0xb7
var NS_GET_USERNS = ioctl.IO(NSIO, 0x1)
func main() {
fd, err := ioctl.RetFd(nsfd, NS_GET_USERNS)
}
make
: lists all targets.make coverage
: runs all tests with coverage and then updates the coverage badge inREADME.md
.make pkgsite
: installsx/pkgsite
, as well as thebrowser-sync
andnodemon
npm packages first, if not already done so. Then runs thepkgsite
and hot reloads it whenever the documentation changes.make report
: installs@gojp/goreportcard
if not yet done so and then runs it on the code base.make test
: runs all tests, always.make vuln
: installsx/vuln/cmd/govulncheck
and then runs it.
Copyright 2023 Harald Albrecht, licensed under the Apache License, Version 2.0.