mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
b80eb88b80d26ded9a0b07c161b8d3dca5dc7455
This change adds (most) of the ioctl API for the Linux HIDRAW interface. Reading and writing non-numbered HID reports is done using the read and write system calls respectively. Some of the HIDIOC* request numbers are exported directly while others are kept unexported. This is because some of the #defines require a len attribute that doesn't have a specific well defined value. Wrapper types are added for most of the request numbers as is standard. No wrapper is added for HIDIOCGRDESCSIZE as it would just be IoctlGetUint32. The HIDIOC[GS]FEATURE, HIDIOC[GS]INPUT and HIDIOC[GS]OUTPUT request numbers, which are required for numbered HID reports, are entirely ommitted as the len attribute has to be a runtime variable. These could be added later by doing something like `HIDIOCGFEATURE(0) | (len << _IOC_SIZESHIFT)`, with care taken that len doesn't overflow _IOC_XSIZEMASK. Outdated documentation for the HIDRAW interface is available at: https://www.kernel.org/doc/Documentation/hid/hidraw.txt. Change-Id: I2ae5060f0f46150f6fb52959c2e55f50927c1f69 Reviewed-on: https://go-review.googlesource.com/c/sys/+/289169 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
sys
This repository holds supplemental Go packages for low-level interactions with the operating system.
Download/Install
The easiest way to install is to run go get -u golang.org/x/sys. You can
also manually git clone the repository to $GOPATH/src/golang.org/x/sys.
Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the sys repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/sys:" in the subject line, so it is easy to find.
Description
Languages
Go
85.8%
Assembly
12.3%
Shell
1.7%
C
0.1%