mirror of
https://github.com/cheat/cheat.git
synced 2025-09-01 09:38:29 +02:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
0b80a608c3 | |||
3c1e24a0e8 | |||
2a6586b41b | |||
6421953183 | |||
0c47f44ff9 | |||
77f9c3fdd0 | |||
b53a14b1a7 | |||
f1e8602369 | |||
ddbe710881 | |||
d598d96fce | |||
4fdec50487 | |||
9de866dfb6 | |||
eb99a070ce | |||
73f80bde48 | |||
8130b2f3bd | |||
f4e6c76e58 | |||
85f5ae8ec7 | |||
484b447391 | |||
cfd1702bc6 | |||
7406ebfb5e | |||
0737af2fec | |||
a23d372d1f | |||
fe66ff3768 | |||
7fed1f63a6 | |||
a297d1619c | |||
ef1da90a77 | |||
d8f405c112 | |||
f8403ff241 | |||
65f6be3fd8 | |||
1cb53697d2 |
75
.github/workflows/build.yml
vendored
75
.github/workflows/build.yml
vendored
@ -1,57 +1,46 @@
|
|||||||
|
---
|
||||||
name: Go
|
name: Go
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# TODO: is it possible to DRY out these jobs? Aside from `runs-on`, they are
|
# TODO: is it possible to DRY out these jobs? Aside from `runs-on`, they are
|
||||||
# identical.
|
# identical.
|
||||||
|
# See: https://github.com/actions/runner/issues/1182
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: [ ubuntu-latest ]
|
runs-on: [ubuntu-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
- name: Set up Go
|
uses: actions/setup-go@v2
|
||||||
uses: actions/setup-go@v2
|
with:
|
||||||
with:
|
go-version: 1.19
|
||||||
go-version: 1.16
|
- name: Set up Revive (linter)
|
||||||
|
run: go get -u github.com/boyter/scc github.com/mgechev/revive
|
||||||
- name: Set up Revive (linter)
|
env:
|
||||||
run: go get -u github.com/boyter/scc github.com/mgechev/revive
|
GO111MODULE: "off"
|
||||||
env:
|
- name: Build
|
||||||
GO111MODULE: off
|
run: make build
|
||||||
|
- name: Test
|
||||||
|
run: make test
|
||||||
- name: Build
|
|
||||||
run: make build
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: make test
|
|
||||||
|
|
||||||
build-osx:
|
build-osx:
|
||||||
runs-on: [ macos-latest ]
|
runs-on: [macos-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Go
|
||||||
- name: Set up Go
|
uses: actions/setup-go@v2
|
||||||
uses: actions/setup-go@v2
|
with:
|
||||||
with:
|
go-version: 1.19
|
||||||
go-version: 1.16
|
- name: Set up Revive (linter)
|
||||||
|
run: go get -u github.com/boyter/scc github.com/mgechev/revive
|
||||||
- name: Set up Revive (linter)
|
env:
|
||||||
run: go get -u github.com/boyter/scc github.com/mgechev/revive
|
GO111MODULE: "off"
|
||||||
env:
|
- name: Build
|
||||||
GO111MODULE: off
|
run: make build
|
||||||
|
- name: Test
|
||||||
- name: Build
|
run: make test
|
||||||
run: make build
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: make test
|
|
||||||
|
|
||||||
# TODO: windows
|
|
||||||
|
34
.github/workflows/codeql-analysis.yml
vendored
34
.github/workflows/codeql-analysis.yml
vendored
@ -1,12 +1,11 @@
|
|||||||
|
---
|
||||||
name: CodeQL
|
name: CodeQL
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '45 23 * * 0'
|
- cron: '45 23 * * 0'
|
||||||
|
|
||||||
@ -14,23 +13,18 @@ jobs:
|
|||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'go' ]
|
language: [go]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Initialize CodeQL
|
||||||
- name: Initialize CodeQL
|
uses: github/codeql-action/init@v1
|
||||||
uses: github/codeql-action/init@v1
|
with:
|
||||||
with:
|
languages: ${{ matrix.language }}
|
||||||
languages: ${{ matrix.language }}
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
- name: Autobuild
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v1
|
|
||||||
|
4
.github/workflows/homebrew.yml
vendored
4
.github/workflows/homebrew.yml
vendored
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
name: homebrew
|
name: homebrew
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@ -11,7 +12,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: mislav/bump-homebrew-formula-action@v1
|
- uses: mislav/bump-homebrew-formula-action@v1
|
||||||
with:
|
with:
|
||||||
# A PR will be sent to github.com/Homebrew/homebrew-core to update this formula:
|
# A PR will be sent to github.com/Homebrew/homebrew-core to update
|
||||||
|
# this formula:
|
||||||
formula-name: cheat
|
formula-name: cheat
|
||||||
env:
|
env:
|
||||||
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
|
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
|
||||||
|
@ -19,7 +19,8 @@ tracker][issues] to discuss with the maintainer whether it would be considered
|
|||||||
for merging.
|
for merging.
|
||||||
|
|
||||||
`cheat` is mostly mature and feature-complete, but may still have some room for
|
`cheat` is mostly mature and feature-complete, but may still have some room for
|
||||||
new features.
|
new features. See [HACKING.md][hacking] for a quick-start guide to `cheat`
|
||||||
|
development.
|
||||||
|
|
||||||
#### Add documentation ####
|
#### Add documentation ####
|
||||||
Did you encounter features, bugs, edge-cases, use-cases, or environment
|
Did you encounter features, bugs, edge-cases, use-cases, or environment
|
||||||
@ -41,6 +42,7 @@ Please open all pull-requests against the `develop` branch.
|
|||||||
|
|
||||||
[cheat]: https://github.com/cheat/cheat
|
[cheat]: https://github.com/cheat/cheat
|
||||||
[cheatsheets]: https://github.com/cheat/cheatsheets
|
[cheatsheets]: https://github.com/cheat/cheatsheets
|
||||||
|
[hacking]: HACKING.md
|
||||||
[issues]: https://github.com/cheat/cheat/issues
|
[issues]: https://github.com/cheat/cheat/issues
|
||||||
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork
|
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork
|
||||||
[wiki]: https://github.com/cheat/cheat/wiki
|
[wiki]: https://github.com/cheat/cheat/wiki
|
||||||
|
57
HACKING.md
Normal file
57
HACKING.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
Hacking
|
||||||
|
=======
|
||||||
|
The following is a quickstart guide for developing `cheat`.
|
||||||
|
|
||||||
|
## 1. Install system dependencies
|
||||||
|
Before you begin, you must install a handful of system dependencies. The
|
||||||
|
following are required, and must be available on your `PATH`:
|
||||||
|
|
||||||
|
- `git`
|
||||||
|
- `go` (>= 1.17 is recommended)
|
||||||
|
- `make`
|
||||||
|
|
||||||
|
The following dependencies are optional:
|
||||||
|
- `docker`
|
||||||
|
- `pandoc` (necessary to generate a `man` page)
|
||||||
|
|
||||||
|
## 2. Install utility applications
|
||||||
|
Run `make setup` to install `scc` and `revive`, which are used by various
|
||||||
|
`make` targets.
|
||||||
|
|
||||||
|
## 3. Development workflow
|
||||||
|
After your environment has been configured, your development workflow will
|
||||||
|
resemble the following:
|
||||||
|
|
||||||
|
1. Make changes to the `cheat` source code.
|
||||||
|
2. Run `make test` to run unit-tests.
|
||||||
|
3. Fix compiler errors and failing tests as necessary.
|
||||||
|
4. Run `make`. A `cheat` executable will be written to the `dist` directory.
|
||||||
|
5. Use the new executable by running `dist/cheat <command>`.
|
||||||
|
6. Run `make install` to install `cheat` to your `PATH`.
|
||||||
|
7. Run `make build-release` to build cross-platform binaries in `dist`.
|
||||||
|
8. Run `make clean` to clean the `dist` directory when desired.
|
||||||
|
|
||||||
|
You may run `make help` to see a list of available `make` commands.
|
||||||
|
|
||||||
|
### Developing with docker
|
||||||
|
It may be useful to test your changes within a pristine environment. An
|
||||||
|
Alpine-based docker container has been provided for that purpose.
|
||||||
|
|
||||||
|
If you would like to build the docker container, run:
|
||||||
|
```sh
|
||||||
|
make docker-setup
|
||||||
|
```
|
||||||
|
|
||||||
|
To shell into the container, run:
|
||||||
|
```sh
|
||||||
|
make docker-sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The `cheat` source code will be mounted at `/app` within the container.
|
||||||
|
|
||||||
|
If you would like to destroy this container, you may run:
|
||||||
|
```sh
|
||||||
|
make distclean
|
||||||
|
```
|
||||||
|
|
||||||
|
[go]: https://go.dev/
|
77
INSTALLING.md
Normal file
77
INSTALLING.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
Installing
|
||||||
|
==========
|
||||||
|
`cheat` has no runtime dependencies. As such, installing it is generally
|
||||||
|
straightforward. There are a few methods available:
|
||||||
|
|
||||||
|
### Install manually
|
||||||
|
#### Unix-like
|
||||||
|
On Unix-like systems, you may simply paste the following snippet into your terminal:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd /tmp \
|
||||||
|
&& wget https://github.com/cheat/cheat/releases/download/4.3.1/cheat-linux-amd64.gz \
|
||||||
|
&& gunzip cheat-linux-amd64.gz \
|
||||||
|
&& chmod +x cheat-linux-amd64 \
|
||||||
|
&& sudo mv cheat-linux-amd64 /usr/local/bin/cheat
|
||||||
|
```
|
||||||
|
|
||||||
|
You may need to need to change the version number (`4.3.1`) and the archive
|
||||||
|
(`cheat-linux-amd64.gz`) depending on your platform.
|
||||||
|
|
||||||
|
See the [releases page][releases] for a list of supported platforms.
|
||||||
|
|
||||||
|
#### Windows
|
||||||
|
TODO: community support is requested here. Please open a PR if you'd like to
|
||||||
|
contribute installation instructions for Windows.
|
||||||
|
|
||||||
|
### Install via `go install`
|
||||||
|
If you have `go` version `>=1.17` available on your `PATH`, you can install
|
||||||
|
`cheat` via `go install`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go install github.com/cheat/cheat/cmd/cheat@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install via package manager
|
||||||
|
Several community-maintained packages are also available:
|
||||||
|
|
||||||
|
Package manager | Installing
|
||||||
|
---------------- | -----------
|
||||||
|
[brew][] | `brew install cheat`
|
||||||
|
[docker][] | `alias cheat='docker run --rm bannmann/docker-cheat'`
|
||||||
|
[nix][] | `nix-env -iA nixos.cheat`
|
||||||
|
[snap][] | `snap install cheat`
|
||||||
|
|
||||||
|
<!--[pacman][] |-->
|
||||||
|
|
||||||
|
## Configuring
|
||||||
|
Three things must be done before you can use `cheat`:
|
||||||
|
1. A config file must be generated
|
||||||
|
2. [`cheatpaths`][cheatpaths] must be configured
|
||||||
|
3. [Community cheatsheets][community] must be downloaded
|
||||||
|
|
||||||
|
On first run, `cheat` will run an installer that will do all of the above
|
||||||
|
automatically. After the installer is complete, it is strongly advised that you
|
||||||
|
view the configuration file that was generated, as you may want to change some
|
||||||
|
of its default values (to enable colorization, change the paginator, etc).
|
||||||
|
|
||||||
|
### conf.yml ###
|
||||||
|
`cheat` is configured by a YAML file that will be auto-generated on first run.
|
||||||
|
|
||||||
|
By default, the config file is assumed to exist on an XDG-compliant
|
||||||
|
configuration path like `~/.config/cheat/conf.yml`. If you would like to store
|
||||||
|
it elsewhere, you may export a `CHEAT_CONFIG_PATH` environment variable that
|
||||||
|
specifies its path:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export CHEAT_CONFIG_PATH="~/.dotfiles/cheat/conf.yml"
|
||||||
|
```
|
||||||
|
|
||||||
|
[brew]: https://formulae.brew.sh/formula/cheat
|
||||||
|
[cheatpaths]: README.md#cheatpaths
|
||||||
|
[community]: https://github.com/cheat/cheatsheets/
|
||||||
|
[docker]: https://github.com/bannmann/docker-cheat
|
||||||
|
[nix]: https://search.nixos.org/packages?channel=unstable&show=cheat&from=0&size=50&sort=relevance&type=packages&query=cheat
|
||||||
|
[pacman]: #
|
||||||
|
[releases]: https://github.com/cheat/cheat/releases
|
||||||
|
[snap]: https://snapcraft.io/cheat
|
5
Makefile
5
Makefile
@ -180,11 +180,6 @@ prepare: | $(dist_dir) clean generate vendor fmt lint vet test
|
|||||||
docker-setup:
|
docker-setup:
|
||||||
$(DOCKER) build -t $(docker_image) -f Dockerfile .
|
$(DOCKER) build -t $(docker_image) -f Dockerfile .
|
||||||
|
|
||||||
## docker-run: shell into the development docker container
|
|
||||||
.PHONY: docker-run
|
|
||||||
docker-run:
|
|
||||||
$(DOCKER) run -v `pwd`:/app -ti $(docker_image) sh
|
|
||||||
|
|
||||||
## docker-sh: shell into the docker development container
|
## docker-sh: shell into the docker development container
|
||||||
.PHONY: docker-sh
|
.PHONY: docker-sh
|
||||||
docker-sh:
|
docker-sh:
|
||||||
|
191
README.md
191
README.md
@ -42,114 +42,6 @@ tar -xjvf '/path/to/foo.tgz'
|
|||||||
tar -cjvf '/path/to/foo.tgz' '/path/to/foo/'
|
tar -cjvf '/path/to/foo.tgz' '/path/to/foo/'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Installing
|
|
||||||
----------
|
|
||||||
`cheat` has no dependencies. To install it, download the executable from the
|
|
||||||
[releases][] page and place it on your `PATH`.
|
|
||||||
|
|
||||||
Alternatively, if you have [go][] installed, you may install `cheat` using `go
|
|
||||||
get`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go get -u github.com/cheat/cheat/cmd/cheat
|
|
||||||
```
|
|
||||||
|
|
||||||
Configuring
|
|
||||||
-----------
|
|
||||||
### conf.yml ###
|
|
||||||
`cheat` is configured by a YAML file that will be auto-generated on first run.
|
|
||||||
|
|
||||||
By default, the config file is assumed to exist on an XDG-compliant
|
|
||||||
configuration path like `~/.config/cheat/conf.yml`. If you would like to store
|
|
||||||
it elsewhere, you may export a `CHEAT_CONFIG_PATH` environment variable that
|
|
||||||
specifies its path:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
export CHEAT_CONFIG_PATH="~/.dotfiles/cheat/conf.yml"
|
|
||||||
```
|
|
||||||
|
|
||||||
Cheatsheets
|
|
||||||
-----------
|
|
||||||
Cheatsheets are plain-text files with no file extension, and are named
|
|
||||||
according to the command used to view them:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cheat tar # file is named "tar"
|
|
||||||
cheat foo/bar # file is named "bar", in a "foo" subdirectory
|
|
||||||
```
|
|
||||||
|
|
||||||
Cheatsheet text may optionally be preceeded by a YAML frontmatter header that
|
|
||||||
assigns tags and specifies syntax:
|
|
||||||
|
|
||||||
```
|
|
||||||
---
|
|
||||||
syntax: javascript
|
|
||||||
tags: [ array, map ]
|
|
||||||
---
|
|
||||||
// To map over an array:
|
|
||||||
const squares = [1, 2, 3, 4].map(x => x * x);
|
|
||||||
```
|
|
||||||
|
|
||||||
The `cheat` executable includes no cheatsheets, but [community-sourced
|
|
||||||
cheatsheets are available][cheatsheets]. You will be asked if you would like to
|
|
||||||
install the community-sourced cheatsheets the first time you run `cheat`.
|
|
||||||
|
|
||||||
### Script ###
|
|
||||||
You can manage the cheatsheets via a script `cheatsheets`.
|
|
||||||
|
|
||||||
#### Download and install ####
|
|
||||||
```sh
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
wget -O ~/.local/bin/cheatsheets https://raw.githubusercontent.com/cheat/cheat/master/scripts/git/cheatsheets
|
|
||||||
chmod +x ~/.local/bin/cheatsheets
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Pull changes ####
|
|
||||||
To pull the community and personal cheatsheets call `cheatsheets pull`
|
|
||||||
|
|
||||||
#### Push changes ####
|
|
||||||
To push your personal cheatsheets call `cheatsheets push`
|
|
||||||
|
|
||||||
Cheatpaths
|
|
||||||
----------
|
|
||||||
Cheatsheets are stored on "cheatpaths", which are directories that contain
|
|
||||||
cheatsheets. Cheatpaths are specified in the `conf.yml` file.
|
|
||||||
|
|
||||||
It can be useful to configure `cheat` against multiple cheatpaths. A common
|
|
||||||
pattern is to store cheatsheets from multiple repositories on individual
|
|
||||||
cheatpaths:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# conf.yml:
|
|
||||||
# ...
|
|
||||||
cheatpaths:
|
|
||||||
- name: community # a name for the cheatpath
|
|
||||||
path: ~/documents/cheat/community # the path's location on the filesystem
|
|
||||||
tags: [ community ] # these tags will be applied to all sheets on the path
|
|
||||||
readonly: true # if true, `cheat` will not create new cheatsheets here
|
|
||||||
|
|
||||||
- name: personal
|
|
||||||
path: ~/documents/cheat/personal # this is a separate directory and repository than above
|
|
||||||
tags: [ personal ]
|
|
||||||
readonly: false # new sheets may be written here
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
The `readonly` option instructs `cheat` not to edit (or create) any cheatsheets
|
|
||||||
on the path. This is useful to prevent merge-conflicts from arising on upstream
|
|
||||||
cheatsheet repositories.
|
|
||||||
|
|
||||||
If a user attempts to edit a cheatsheet on a read-only cheatpath, `cheat` will
|
|
||||||
transparently copy that sheet to a writeable directory before opening it for
|
|
||||||
editing.
|
|
||||||
|
|
||||||
### Directory-scoped Cheatpaths ###
|
|
||||||
At times, it can be useful to closely associate cheatsheets with a directory on
|
|
||||||
your filesystem. `cheat` facilitates this by searching for a `.cheat` folder in
|
|
||||||
the current working directory. If found, the `.cheat` directory will
|
|
||||||
(temporarily) be added to the cheatpaths.
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
To view a cheatsheet:
|
To view a cheatsheet:
|
||||||
@ -210,7 +102,77 @@ cheat -p personal -t networking --regex -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Advanced Usage
|
|
||||||
|
Installing
|
||||||
|
----------
|
||||||
|
For installation and configuration instructions, see [INSTALLING.md][].
|
||||||
|
|
||||||
|
Cheatsheets
|
||||||
|
-----------
|
||||||
|
Cheatsheets are plain-text files with no file extension, and are named
|
||||||
|
according to the command used to view them:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cheat tar # file is named "tar"
|
||||||
|
cheat foo/bar # file is named "bar", in a "foo" subdirectory
|
||||||
|
```
|
||||||
|
|
||||||
|
Cheatsheet text may optionally be preceeded by a YAML frontmatter header that
|
||||||
|
assigns tags and specifies syntax:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
syntax: javascript
|
||||||
|
tags: [ array, map ]
|
||||||
|
---
|
||||||
|
// To map over an array:
|
||||||
|
const squares = [1, 2, 3, 4].map(x => x * x);
|
||||||
|
```
|
||||||
|
|
||||||
|
The `cheat` executable includes no cheatsheets, but [community-sourced
|
||||||
|
cheatsheets are available][cheatsheets]. You will be asked if you would like to
|
||||||
|
install the community-sourced cheatsheets the first time you run `cheat`.
|
||||||
|
|
||||||
|
Cheatpaths
|
||||||
|
----------
|
||||||
|
Cheatsheets are stored on "cheatpaths", which are directories that contain
|
||||||
|
cheatsheets. Cheatpaths are specified in the `conf.yml` file.
|
||||||
|
|
||||||
|
It can be useful to configure `cheat` against multiple cheatpaths. A common
|
||||||
|
pattern is to store cheatsheets from multiple repositories on individual
|
||||||
|
cheatpaths:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# conf.yml:
|
||||||
|
# ...
|
||||||
|
cheatpaths:
|
||||||
|
- name: community # a name for the cheatpath
|
||||||
|
path: ~/documents/cheat/community # the path's location on the filesystem
|
||||||
|
tags: [ community ] # these tags will be applied to all sheets on the path
|
||||||
|
readonly: true # if true, `cheat` will not create new cheatsheets here
|
||||||
|
|
||||||
|
- name: personal
|
||||||
|
path: ~/documents/cheat/personal # this is a separate directory and repository than above
|
||||||
|
tags: [ personal ]
|
||||||
|
readonly: false # new sheets may be written here
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
The `readonly` option instructs `cheat` not to edit (or create) any cheatsheets
|
||||||
|
on the path. This is useful to prevent merge-conflicts from arising on upstream
|
||||||
|
cheatsheet repositories.
|
||||||
|
|
||||||
|
If a user attempts to edit a cheatsheet on a read-only cheatpath, `cheat` will
|
||||||
|
transparently copy that sheet to a writeable directory before opening it for
|
||||||
|
editing.
|
||||||
|
|
||||||
|
### Directory-scoped Cheatpaths ###
|
||||||
|
At times, it can be useful to closely associate cheatsheets with a directory on
|
||||||
|
your filesystem. `cheat` facilitates this by searching for a `.cheat` folder in
|
||||||
|
the current working directory. If found, the `.cheat` directory will
|
||||||
|
(temporarily) be added to the cheatpaths.
|
||||||
|
|
||||||
|
Autocompletion
|
||||||
--------------
|
--------------
|
||||||
Shell autocompletion is currently available for `bash`, `fish`, and `zsh`. Copy
|
Shell autocompletion is currently available for `bash`, `fish`, and `zsh`. Copy
|
||||||
the relevant [completion script][completions] into the appropriate directory on
|
the relevant [completion script][completions] into the appropriate directory on
|
||||||
@ -223,8 +185,9 @@ Additionally, `cheat` supports enhanced autocompletion via integration with
|
|||||||
1. Ensure that `fzf` is available on your `$PATH`
|
1. Ensure that `fzf` is available on your `$PATH`
|
||||||
2. Set an envvar: `export CHEAT_USE_FZF=true`
|
2. Set an envvar: `export CHEAT_USE_FZF=true`
|
||||||
|
|
||||||
[Releases]: https://github.com/cheat/cheat/releases
|
[INSTALLING.md]: INSTALLING.md
|
||||||
[cheatsheets]: https://github.com/cheat/cheatsheets
|
[Releases]: https://github.com/cheat/cheat/releases
|
||||||
[completions]: https://github.com/cheat/cheat/tree/master/scripts
|
[cheatsheets]: https://github.com/cheat/cheatsheets
|
||||||
[fzf]: https://github.com/junegunn/fzf
|
[completions]: https://github.com/cheat/cheat/tree/master/scripts
|
||||||
[go]: https://golang.org
|
[fzf]: https://github.com/junegunn/fzf
|
||||||
|
[go]: https://golang.org
|
||||||
|
11
cmd/cheat/cmd_conf.go
Normal file
11
cmd/cheat/cmd_conf.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/cheat/cheat/internal/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func cmdConf(opts map[string]interface{}, conf config.Config) {
|
||||||
|
fmt.Println(conf.Path)
|
||||||
|
}
|
@ -18,11 +18,7 @@ func cmdDirectories(opts map[string]interface{}, conf config.Config) {
|
|||||||
|
|
||||||
// generate sorted, columnized output
|
// generate sorted, columnized output
|
||||||
for _, path := range conf.Cheatpaths {
|
for _, path := range conf.Cheatpaths {
|
||||||
fmt.Fprintln(w, fmt.Sprintf(
|
fmt.Fprintf(w, "%s:\t%s\n", path.Name, path.Path)
|
||||||
"%s:\t%s",
|
|
||||||
path.Name,
|
|
||||||
path.Path,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write columnized output to stdout
|
// write columnized output to stdout
|
||||||
|
@ -20,7 +20,7 @@ func cmdEdit(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ func cmdList(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +63,7 @@ func cmdList(opts map[string]interface{}, conf config.Config) {
|
|||||||
// compile the regex
|
// compile the regex
|
||||||
reg, err := regexp.Compile(pattern)
|
reg, err := regexp.Compile(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(
|
fmt.Fprintf(os.Stderr, "failed to compile regexp: %s, %v\n", pattern, err)
|
||||||
os.Stderr,
|
|
||||||
fmt.Sprintf("failed to compile regexp: %s, %v", pattern, err),
|
|
||||||
)
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,12 +92,7 @@ func cmdList(opts map[string]interface{}, conf config.Config) {
|
|||||||
|
|
||||||
// generate sorted, columnized output
|
// generate sorted, columnized output
|
||||||
for _, sheet := range flattened {
|
for _, sheet := range flattened {
|
||||||
fmt.Fprintln(w, fmt.Sprintf(
|
fmt.Fprintf(w, "%s\t%s\t%s\n", sheet.Title, sheet.Path, strings.Join(sheet.Tags, ","))
|
||||||
"%s\t%s\t%s",
|
|
||||||
sheet.Title,
|
|
||||||
sheet.Path,
|
|
||||||
strings.Join(sheet.Tags, ","),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write columnized output to stdout
|
// write columnized output to stdout
|
||||||
|
@ -17,7 +17,7 @@ func cmdRemove(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,19 +37,19 @@ func cmdRemove(opts map[string]interface{}, conf config.Config) {
|
|||||||
// fail early if the requested cheatsheet does not exist
|
// fail early if the requested cheatsheet does not exist
|
||||||
sheet, ok := consolidated[cheatsheet]
|
sheet, ok := consolidated[cheatsheet]
|
||||||
if !ok {
|
if !ok {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("No cheatsheet found for '%s'.\n", cheatsheet))
|
fmt.Fprintf(os.Stderr, "No cheatsheet found for '%s'.\n", cheatsheet)
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// fail early if the sheet is read-only
|
// fail early if the sheet is read-only
|
||||||
if sheet.ReadOnly {
|
if sheet.ReadOnly {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("cheatsheet '%s' is read-only.", cheatsheet))
|
fmt.Fprintf(os.Stderr, "cheatsheet '%s' is read-only.\n", cheatsheet)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, attempt to delete the sheet
|
// otherwise, attempt to delete the sheet
|
||||||
if err := os.Remove(sheet.Path); err != nil {
|
if err := os.Remove(sheet.Path); err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to delete sheet: %s, %v", sheet.Title, err))
|
fmt.Fprintf(os.Stderr, "failed to delete sheet: %s, %v\n", sheet.Title, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ func cmdSearch(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,13 +55,13 @@ func cmdSearch(opts map[string]interface{}, conf config.Config) {
|
|||||||
// compile the regex
|
// compile the regex
|
||||||
reg, err := regexp.Compile(pattern)
|
reg, err := regexp.Compile(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to compile regexp: %s, %v", pattern, err))
|
fmt.Fprintf(os.Stderr, "failed to compile regexp: %s, %v\n", pattern, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// `Search` will return text entries that match the search terms. We're
|
// `Search` will return text entries that match the search terms.
|
||||||
// using it here to overwrite the prior cheatsheet Text, filtering it to
|
// We're using it here to overwrite the prior cheatsheet Text,
|
||||||
// only what is relevant
|
// filtering it to only what is relevant.
|
||||||
sheet.Text = sheet.Search(reg)
|
sheet.Text = sheet.Search(reg)
|
||||||
|
|
||||||
// if the sheet did not match the search, ignore it and move on
|
// if the sheet did not match the search, ignore it and move on
|
||||||
@ -74,14 +74,16 @@ func cmdSearch(opts map[string]interface{}, conf config.Config) {
|
|||||||
sheet.Colorize(conf)
|
sheet.Colorize(conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// display the cheatsheet title and path
|
// display the cheatsheet body
|
||||||
out += fmt.Sprintf("%s %s\n",
|
out += fmt.Sprintf(
|
||||||
display.Underline(sheet.Title),
|
"%s %s\n%s\n",
|
||||||
|
// append the cheatsheet title
|
||||||
|
sheet.Title,
|
||||||
|
// append the cheatsheet path
|
||||||
display.Faint(fmt.Sprintf("(%s)", sheet.CheatPath), conf),
|
display.Faint(fmt.Sprintf("(%s)", sheet.CheatPath), conf),
|
||||||
|
// indent each line of content
|
||||||
|
display.Indent(sheet.Text),
|
||||||
)
|
)
|
||||||
|
|
||||||
// indent each line of content
|
|
||||||
out += display.Indent(sheet.Text) + "\n"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +91,7 @@ func cmdSearch(opts map[string]interface{}, conf config.Config) {
|
|||||||
out = strings.TrimSpace(out)
|
out = strings.TrimSpace(out)
|
||||||
|
|
||||||
// display the output
|
// display the output
|
||||||
// NB: resist the temptation to call `display.Display` multiple times in
|
// NB: resist the temptation to call `display.Write` multiple times in the
|
||||||
// the loop above. That will not play nicely with the paginator.
|
// loop above. That will not play nicely with the paginator.
|
||||||
display.Write(out, conf)
|
display.Write(out, conf)
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ func cmdTags(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ func cmdView(opts map[string]interface{}, conf config.Config) {
|
|||||||
// load the cheatsheets
|
// load the cheatsheets
|
||||||
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
cheatsheets, err := sheets.Load(conf.Cheatpaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to list cheatsheets: %v", err))
|
fmt.Fprintf(os.Stderr, "failed to list cheatsheets: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ func cmdView(opts map[string]interface{}, conf config.Config) {
|
|||||||
|
|
||||||
// identify the matching cheatsheet
|
// identify the matching cheatsheet
|
||||||
out += fmt.Sprintf("%s %s\n",
|
out += fmt.Sprintf("%s %s\n",
|
||||||
display.Underline(sheet.Title),
|
sheet.Title,
|
||||||
display.Faint(fmt.Sprintf("(%s)", sheet.CheatPath), conf),
|
display.Faint(fmt.Sprintf("(%s)", sheet.CheatPath), conf),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ Options:
|
|||||||
-T --tags List all tags in use
|
-T --tags List all tags in use
|
||||||
-v --version Print the version number
|
-v --version Print the version number
|
||||||
--rm=<cheatsheet> Remove (delete) <cheatsheet>
|
--rm=<cheatsheet> Remove (delete) <cheatsheet>
|
||||||
|
--conf Display the config file path
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
@ -53,3 +54,6 @@ Examples:
|
|||||||
|
|
||||||
To remove (delete) the foo/bar cheatsheet:
|
To remove (delete) the foo/bar cheatsheet:
|
||||||
cheat --rm foo/bar
|
cheat --rm foo/bar
|
||||||
|
|
||||||
|
To view the configuration file path:
|
||||||
|
cheat --conf
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/cheat/cheat/internal/installer"
|
"github.com/cheat/cheat/internal/installer"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "4.2.5"
|
const version = "4.3.1"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
@ -120,6 +120,9 @@ func main() {
|
|||||||
var cmd func(map[string]interface{}, config.Config)
|
var cmd func(map[string]interface{}, config.Config)
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
case opts["--conf"].(bool):
|
||||||
|
cmd = cmdConf
|
||||||
|
|
||||||
case opts["--directories"].(bool):
|
case opts["--directories"].(bool):
|
||||||
cmd = cmdDirectories
|
cmd = cmdDirectories
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
func configs() string {
|
func configs() string {
|
||||||
return strings.TrimSpace(`---
|
return strings.TrimSpace(`---
|
||||||
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
|
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
|
||||||
# editor: vim
|
editor: EDITOR_PATH
|
||||||
|
|
||||||
# Should 'cheat' always colorize output?
|
# Should 'cheat' always colorize output?
|
||||||
colorize: false
|
colorize: false
|
||||||
@ -17,15 +17,16 @@ colorize: false
|
|||||||
# Which 'chroma' colorscheme should be applied to the output?
|
# Which 'chroma' colorscheme should be applied to the output?
|
||||||
# Options are available here:
|
# Options are available here:
|
||||||
# https://github.com/alecthomas/chroma/tree/master/styles
|
# https://github.com/alecthomas/chroma/tree/master/styles
|
||||||
# style: monokai
|
style: monokai
|
||||||
|
|
||||||
# Which 'chroma' "formatter" should be applied?
|
# Which 'chroma' "formatter" should be applied?
|
||||||
# One of: "terminal", "terminal256", "terminal16m"
|
# One of: "terminal", "terminal256", "terminal16m"
|
||||||
formatter: terminal
|
formatter: terminal256
|
||||||
|
|
||||||
# Through which pager should output be piped? (Unset this key for no pager.)
|
# Through which pager should output be piped?
|
||||||
pager: more
|
# 'less -FRX' is recommended on Unix systems
|
||||||
# pager: less -FRX # <- recommended where available
|
# 'more' is recommended on Windows
|
||||||
|
pager: PAGER_PATH
|
||||||
|
|
||||||
# The paths at which cheatsheets are available. Tags associated with a cheatpath
|
# The paths at which cheatsheets are available. Tags associated with a cheatpath
|
||||||
# are automatically attached to all cheatsheets residing on that path.
|
# are automatically attached to all cheatsheets residing on that path.
|
||||||
@ -40,7 +41,6 @@ pager: more
|
|||||||
# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
|
# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
|
||||||
# 'community' rather than your own, you can use: cheat tar -t community
|
# 'community' rather than your own, you can use: cheat tar -t community
|
||||||
cheatpaths:
|
cheatpaths:
|
||||||
|
|
||||||
# Paths that come earlier are considered to be the most "global", and will
|
# Paths that come earlier are considered to be the most "global", and will
|
||||||
# thus be overridden by more local cheatsheets. That being the case, you
|
# thus be overridden by more local cheatsheets. That being the case, you
|
||||||
# should probably list community cheatsheets first.
|
# should probably list community cheatsheets first.
|
||||||
|
@ -24,6 +24,7 @@ Options:
|
|||||||
-T --tags List all tags in use
|
-T --tags List all tags in use
|
||||||
-v --version Print the version number
|
-v --version Print the version number
|
||||||
--rm=<cheatsheet> Remove (delete) <cheatsheet>
|
--rm=<cheatsheet> Remove (delete) <cheatsheet>
|
||||||
|
--conf Display the config file path
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
@ -62,5 +63,8 @@ Examples:
|
|||||||
|
|
||||||
To remove (delete) the foo/bar cheatsheet:
|
To remove (delete) the foo/bar cheatsheet:
|
||||||
cheat --rm foo/bar
|
cheat --rm foo/bar
|
||||||
|
|
||||||
|
To view the configuration file path:
|
||||||
|
cheat --conf
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
|
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
|
||||||
# editor: vim
|
editor: EDITOR_PATH
|
||||||
|
|
||||||
# Should 'cheat' always colorize output?
|
# Should 'cheat' always colorize output?
|
||||||
colorize: false
|
colorize: false
|
||||||
@ -8,15 +8,16 @@ colorize: false
|
|||||||
# Which 'chroma' colorscheme should be applied to the output?
|
# Which 'chroma' colorscheme should be applied to the output?
|
||||||
# Options are available here:
|
# Options are available here:
|
||||||
# https://github.com/alecthomas/chroma/tree/master/styles
|
# https://github.com/alecthomas/chroma/tree/master/styles
|
||||||
# style: monokai
|
style: monokai
|
||||||
|
|
||||||
# Which 'chroma' "formatter" should be applied?
|
# Which 'chroma' "formatter" should be applied?
|
||||||
# One of: "terminal", "terminal256", "terminal16m"
|
# One of: "terminal", "terminal256", "terminal16m"
|
||||||
formatter: terminal
|
formatter: terminal256
|
||||||
|
|
||||||
# Through which pager should output be piped? (Unset this key for no pager.)
|
# Through which pager should output be piped?
|
||||||
pager: more
|
# 'less -FRX' is recommended on Unix systems
|
||||||
# pager: less -FRX # <- recommended where available
|
# 'more' is recommended on Windows
|
||||||
|
pager: PAGER_PATH
|
||||||
|
|
||||||
# The paths at which cheatsheets are available. Tags associated with a cheatpath
|
# The paths at which cheatsheets are available. Tags associated with a cheatpath
|
||||||
# are automatically attached to all cheatsheets residing on that path.
|
# are automatically attached to all cheatsheets residing on that path.
|
||||||
@ -31,7 +32,6 @@ pager: more
|
|||||||
# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
|
# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
|
||||||
# 'community' rather than your own, you can use: cheat tar -t community
|
# 'community' rather than your own, you can use: cheat tar -t community
|
||||||
cheatpaths:
|
cheatpaths:
|
||||||
|
|
||||||
# Paths that come earlier are considered to be the most "global", and will
|
# Paths that come earlier are considered to be the most "global", and will
|
||||||
# thus be overridden by more local cheatsheets. That being the case, you
|
# thus be overridden by more local cheatsheets. That being the case, you
|
||||||
# should probably list community cheatsheets first.
|
# should probably list community cheatsheets first.
|
||||||
|
14
go.mod
14
go.mod
@ -1,17 +1,21 @@
|
|||||||
module github.com/cheat/cheat
|
module github.com/cheat/cheat
|
||||||
|
|
||||||
go 1.14
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/alecthomas/chroma v0.10.0
|
github.com/alecthomas/chroma v0.10.0
|
||||||
github.com/davecgh/go-spew v1.1.1
|
github.com/davecgh/go-spew v1.1.1
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
||||||
github.com/kr/text v0.2.0 // indirect
|
|
||||||
github.com/mattn/go-isatty v0.0.14
|
github.com/mattn/go-isatty v0.0.14
|
||||||
github.com/mitchellh/go-homedir v1.1.0
|
github.com/mitchellh/go-homedir v1.1.0
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
|
||||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
|
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
|
||||||
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
|
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/dlclark/regexp2 v1.7.0 // indirect
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
|
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
||||||
|
)
|
||||||
|
7
go.sum
7
go.sum
@ -4,8 +4,9 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
|
|||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
|
|
||||||
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
||||||
|
github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
|
||||||
|
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
@ -24,8 +25,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo=
|
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME=
|
||||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
@ -46,7 +46,7 @@ func TestFilterFailure(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filter the paths
|
// filter the paths
|
||||||
paths, err := Filter(paths, "qux")
|
_, err := Filter(paths, "qux")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("failed to return an error on non-existent cheatpath")
|
t.Errorf("failed to return an error on non-existent cheatpath")
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,10 @@ func Writeable(cheatpaths []Cheatpath) (Cheatpath, error) {
|
|||||||
// NB: we're going backwards because we assume that the most "local"
|
// NB: we're going backwards because we assume that the most "local"
|
||||||
// cheatpath will be specified last in the configs
|
// cheatpath will be specified last in the configs
|
||||||
for i := len(cheatpaths) - 1; i >= 0; i-- {
|
for i := len(cheatpaths) - 1; i >= 0; i-- {
|
||||||
|
|
||||||
// if the cheatpath is not read-only, it is writeable, and thus returned
|
// if the cheatpath is not read-only, it is writeable, and thus returned
|
||||||
if cheatpaths[i].ReadOnly == false {
|
if !cheatpaths[i].ReadOnly {
|
||||||
return cheatpaths[i], nil
|
return cheatpaths[i], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, return an error
|
// otherwise, return an error
|
||||||
|
@ -2,11 +2,8 @@ package config
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cp "github.com/cheat/cheat/internal/cheatpath"
|
cp "github.com/cheat/cheat/internal/cheatpath"
|
||||||
@ -23,13 +20,14 @@ type Config struct {
|
|||||||
Style string `yaml:"style"`
|
Style string `yaml:"style"`
|
||||||
Formatter string `yaml:"formatter"`
|
Formatter string `yaml:"formatter"`
|
||||||
Pager string `yaml:"pager"`
|
Pager string `yaml:"pager"`
|
||||||
|
Path string
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new Config struct
|
// New returns a new Config struct
|
||||||
func New(opts map[string]interface{}, confPath string, resolve bool) (Config, error) {
|
func New(opts map[string]interface{}, confPath string, resolve bool) (Config, error) {
|
||||||
|
|
||||||
// read the config file
|
// read the config file
|
||||||
buf, err := ioutil.ReadFile(confPath)
|
buf, err := os.ReadFile(confPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Config{}, fmt.Errorf("could not read config file: %v", err)
|
return Config{}, fmt.Errorf("could not read config file: %v", err)
|
||||||
}
|
}
|
||||||
@ -37,6 +35,9 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er
|
|||||||
// initialize a config object
|
// initialize a config object
|
||||||
conf := Config{}
|
conf := Config{}
|
||||||
|
|
||||||
|
// store the config path
|
||||||
|
conf.Path = confPath
|
||||||
|
|
||||||
// unmarshal the yaml
|
// unmarshal the yaml
|
||||||
err = yaml.UnmarshalStrict(buf, &conf)
|
err = yaml.UnmarshalStrict(buf, &conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -94,28 +95,11 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er
|
|||||||
conf.Cheatpaths[i].Path = expanded
|
conf.Cheatpaths[i].Path = expanded
|
||||||
}
|
}
|
||||||
|
|
||||||
// if an editor was not provided in the configs, look to envvars
|
// if an editor was not provided in the configs, attempt to choose one
|
||||||
|
// that's appropriate for the environment
|
||||||
if conf.Editor == "" {
|
if conf.Editor == "" {
|
||||||
if os.Getenv("VISUAL") != "" {
|
if conf.Editor, err = Editor(); err != nil {
|
||||||
conf.Editor = os.Getenv("VISUAL")
|
return Config{}, err
|
||||||
} else if os.Getenv("EDITOR") != "" {
|
|
||||||
conf.Editor = os.Getenv("EDITOR")
|
|
||||||
} else if runtime.GOOS == "windows" {
|
|
||||||
conf.Editor = "notepad"
|
|
||||||
} else {
|
|
||||||
// try to fall back to `nano`
|
|
||||||
path, err := exec.LookPath("nano")
|
|
||||||
if err != nil {
|
|
||||||
return Config{}, fmt.Errorf("failed to locate nano: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// use `nano` if we found it
|
|
||||||
if path != "" {
|
|
||||||
conf.Editor = "nano"
|
|
||||||
// otherwise, give up
|
|
||||||
} else {
|
|
||||||
return Config{}, fmt.Errorf("no editor set")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,11 +113,8 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er
|
|||||||
conf.Formatter = "terminal"
|
conf.Formatter = "terminal"
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt to fall back to `PAGER` if a pager is not specified in configs
|
// load the pager
|
||||||
conf.Pager = strings.TrimSpace(conf.Pager)
|
conf.Pager = strings.TrimSpace(conf.Pager)
|
||||||
if conf.Pager == "" && os.Getenv("PAGER") != "" {
|
|
||||||
conf.Pager = os.Getenv("PAGER")
|
|
||||||
}
|
|
||||||
|
|
||||||
return conf, nil
|
return conf, nil
|
||||||
}
|
}
|
||||||
|
41
internal/config/editor.go
Normal file
41
internal/config/editor.go
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Editor attempts to locate an editor that's appropriate for the environment.
|
||||||
|
func Editor() (string, error) {
|
||||||
|
|
||||||
|
// default to `notepad.exe` on Windows
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return "notepad", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for `nano` and `vim` on the `PATH`
|
||||||
|
def, _ := exec.LookPath("editor") // default `editor` wrapper
|
||||||
|
nano, _ := exec.LookPath("nano")
|
||||||
|
vim, _ := exec.LookPath("vim")
|
||||||
|
|
||||||
|
// set editor priority
|
||||||
|
editors := []string{
|
||||||
|
os.Getenv("VISUAL"),
|
||||||
|
os.Getenv("EDITOR"),
|
||||||
|
def,
|
||||||
|
nano,
|
||||||
|
vim,
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the first editor that was found per the priority above
|
||||||
|
for _, editor := range editors {
|
||||||
|
if editor != "" {
|
||||||
|
return editor, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an error if no path is found
|
||||||
|
return "", fmt.Errorf("no editor set")
|
||||||
|
}
|
@ -2,7 +2,6 @@ package config
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
@ -16,7 +15,7 @@ func Init(confpath string, configs string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write the config file
|
// write the config file
|
||||||
if err := ioutil.WriteFile(confpath, []byte(configs), 0644); err != nil {
|
if err := os.WriteFile(confpath, []byte(configs), 0644); err != nil {
|
||||||
return fmt.Errorf("failed to create file: %v", err)
|
return fmt.Errorf("failed to create file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@ -10,7 +9,7 @@ import (
|
|||||||
func TestInit(t *testing.T) {
|
func TestInit(t *testing.T) {
|
||||||
|
|
||||||
// initialize a temporary config file
|
// initialize a temporary config file
|
||||||
confFile, err := ioutil.TempFile("", "cheat-test")
|
confFile, err := os.CreateTemp("", "cheat-test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create temp file: %v", err)
|
t.Errorf("failed to create temp file: %v", err)
|
||||||
}
|
}
|
||||||
@ -25,7 +24,7 @@ func TestInit(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read back the config file contents
|
// read back the config file contents
|
||||||
bytes, err := ioutil.ReadFile(confFile.Name())
|
bytes, err := os.ReadFile(confFile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to read config file: %v", err)
|
t.Errorf("failed to read config file: %v", err)
|
||||||
}
|
}
|
||||||
|
32
internal/config/pager.go
Normal file
32
internal/config/pager.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Pager attempts to locate a pager that's appropriate for the environment.
|
||||||
|
func Pager() string {
|
||||||
|
|
||||||
|
// default to `more` on Windows
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return "more"
|
||||||
|
}
|
||||||
|
|
||||||
|
// if $PAGER is set, return the corresponding pager
|
||||||
|
if os.Getenv("PAGER") != "" {
|
||||||
|
return os.Getenv("PAGER")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, search for `pager`, `less`, and `more` on the `$PATH`. If
|
||||||
|
// none are found, return an empty pager.
|
||||||
|
for _, pager := range []string{"pager", "less", "more"} {
|
||||||
|
if path, err := exec.LookPath(pager); err != nil {
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// default to no pager
|
||||||
|
return ""
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@ -24,7 +23,7 @@ func TestPathConfigNotExists(t *testing.T) {
|
|||||||
func TestPathConfigExists(t *testing.T) {
|
func TestPathConfigExists(t *testing.T) {
|
||||||
|
|
||||||
// initialize a temporary config file
|
// initialize a temporary config file
|
||||||
confFile, err := ioutil.TempFile("", "cheat-test")
|
confFile, err := os.CreateTemp("", "cheat-test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to create temp file: %v", err)
|
t.Errorf("failed to create temp file: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
func Faint(str string, conf config.Config) string {
|
func Faint(str string, conf config.Config) string {
|
||||||
// make `str` faint only if colorization has been requested
|
// make `str` faint only if colorization has been requested
|
||||||
if conf.Colorize {
|
if conf.Colorize {
|
||||||
return fmt.Sprintf(fmt.Sprintf("\033[2m%s\033[0m", str))
|
return fmt.Sprintf("\033[2m%s\033[0m", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, return the string unmodified
|
// otherwise, return the string unmodified
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
package display
|
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
|
|
||||||
// Underline returns an underlined string
|
|
||||||
func Underline(str string) string {
|
|
||||||
return fmt.Sprintf(fmt.Sprintf("\033[4m%s\033[0m", str))
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package display
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
// TestUnderline asserts that Underline applies underline formatting
|
|
||||||
func TestUnderline(t *testing.T) {
|
|
||||||
want := "\033[4mfoo\033[0m"
|
|
||||||
got := Underline("foo")
|
|
||||||
if want != got {
|
|
||||||
t.Errorf("failed to underline: want: %s, got: %s", want, got)
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,15 +23,14 @@ func Write(out string, conf config.Config) {
|
|||||||
pager := parts[0]
|
pager := parts[0]
|
||||||
args := parts[1:]
|
args := parts[1:]
|
||||||
|
|
||||||
// run the pager
|
// configure the pager
|
||||||
cmd := exec.Command(pager, args...)
|
cmd := exec.Command(pager, args...)
|
||||||
cmd.Stdin = strings.NewReader(out)
|
cmd.Stdin = strings.NewReader(out)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|
||||||
// handle errors
|
// run the pager and handle errors
|
||||||
err := cmd.Run()
|
if err := cmd.Run(); err != nil {
|
||||||
if err != nil {
|
fmt.Fprintf(os.Stderr, "failed to write to pager: %v\n", err)
|
||||||
fmt.Fprintln(os.Stderr, fmt.Sprintf("failed to write to pager: %v", err))
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ func Prompt(prompt string, def bool) (bool, error) {
|
|||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
// display the prompt
|
// display the prompt
|
||||||
fmt.Print(fmt.Sprintf("%s: ", prompt))
|
fmt.Printf("%s: ", prompt)
|
||||||
|
|
||||||
// read the answer
|
// read the answer
|
||||||
ans, err := reader.ReadString('\n')
|
ans, err := reader.ReadString('\n')
|
||||||
|
@ -20,10 +20,18 @@ func Run(configs string, confpath string) error {
|
|||||||
community := filepath.Join(confdir, "cheatsheets", "community")
|
community := filepath.Join(confdir, "cheatsheets", "community")
|
||||||
personal := filepath.Join(confdir, "cheatsheets", "personal")
|
personal := filepath.Join(confdir, "cheatsheets", "personal")
|
||||||
|
|
||||||
// template the above paths into the default configs
|
// set default cheatpaths
|
||||||
configs = strings.Replace(configs, "COMMUNITY_PATH", community, -1)
|
configs = strings.Replace(configs, "COMMUNITY_PATH", community, -1)
|
||||||
configs = strings.Replace(configs, "PERSONAL_PATH", personal, -1)
|
configs = strings.Replace(configs, "PERSONAL_PATH", personal, -1)
|
||||||
|
|
||||||
|
// locate and set a default pager
|
||||||
|
configs = strings.Replace(configs, "PAGER_PATH", config.Pager(), -1)
|
||||||
|
|
||||||
|
// locate and set a default editor
|
||||||
|
if editor, err := config.Editor(); err == nil {
|
||||||
|
configs = strings.Replace(configs, "EDITOR_PATH", editor, -1)
|
||||||
|
}
|
||||||
|
|
||||||
// prompt the user to download the community cheatsheets
|
// prompt the user to download the community cheatsheets
|
||||||
yes, err := Prompt(
|
yes, err := Prompt(
|
||||||
"Would you like to download the community cheatsheets? [Y/n]",
|
"Would you like to download the community cheatsheets? [Y/n]",
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package sheet
|
package sheet
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
@ -13,7 +12,7 @@ func TestCopyFlat(t *testing.T) {
|
|||||||
|
|
||||||
// mock a cheatsheet file
|
// mock a cheatsheet file
|
||||||
text := "this is the cheatsheet text"
|
text := "this is the cheatsheet text"
|
||||||
src, err := ioutil.TempFile("", "foo-src")
|
src, err := os.CreateTemp("", "foo-src")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to mock cheatsheet: %v", err)
|
t.Errorf("failed to mock cheatsheet: %v", err)
|
||||||
}
|
}
|
||||||
@ -41,7 +40,7 @@ func TestCopyFlat(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// assert that the destination file contains the correct text
|
// assert that the destination file contains the correct text
|
||||||
got, err := ioutil.ReadFile(outpath)
|
got, err := os.ReadFile(outpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to read destination file: %v", err)
|
t.Errorf("failed to read destination file: %v", err)
|
||||||
}
|
}
|
||||||
@ -60,7 +59,7 @@ func TestCopyDeep(t *testing.T) {
|
|||||||
|
|
||||||
// mock a cheatsheet file
|
// mock a cheatsheet file
|
||||||
text := "this is the cheatsheet text"
|
text := "this is the cheatsheet text"
|
||||||
src, err := ioutil.TempFile("", "foo-src")
|
src, err := os.CreateTemp("", "foo-src")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to mock cheatsheet: %v", err)
|
t.Errorf("failed to mock cheatsheet: %v", err)
|
||||||
}
|
}
|
||||||
@ -94,7 +93,7 @@ func TestCopyDeep(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// assert that the destination file contains the correct text
|
// assert that the destination file contains the correct text
|
||||||
got, err := ioutil.ReadFile(outpath)
|
got, err := os.ReadFile(outpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to read destination file: %v", err)
|
t.Errorf("failed to read destination file: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package sheet
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/cheat/cheat/internal/frontmatter"
|
"github.com/cheat/cheat/internal/frontmatter"
|
||||||
@ -29,7 +29,7 @@ func New(
|
|||||||
) (Sheet, error) {
|
) (Sheet, error) {
|
||||||
|
|
||||||
// read the cheatsheet file
|
// read the cheatsheet file
|
||||||
markdown, err := ioutil.ReadFile(path)
|
markdown, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Sheet{}, fmt.Errorf("failed to read file: %s, %v", path, err)
|
return Sheet{}, fmt.Errorf("failed to read file: %s, %v", path, err)
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package sheets
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -48,14 +49,19 @@ func Load(cheatpaths []cp.Cheatpath) ([]map[string]sheet.Sheet, error) {
|
|||||||
string(os.PathSeparator),
|
string(os.PathSeparator),
|
||||||
)
|
)
|
||||||
|
|
||||||
// ignore hidden files and directories. Otherwise, we'll likely load
|
// Don't walk the `.git` directory. Doing so creates
|
||||||
// .git/* and .DS_Store.
|
// hundreds/thousands of needless syscalls and could
|
||||||
|
// potentially harm performance on machines with slow disks.
|
||||||
//
|
//
|
||||||
// NB: this is still somewhat brittle in that it will miss files
|
// NB: We _do_ want to walk hidden directories, however, so we
|
||||||
// contained within hidden directories in the middle of a path, though
|
// should not constrain this further (perhaps to include all
|
||||||
// that should not realistically occur.
|
// hidden directories). In the wild, many users appear to store
|
||||||
if strings.HasPrefix(title, ".") || strings.HasPrefix(info.Name(), ".") {
|
// cheatsheets in a `.config` directory (seemingly a default
|
||||||
return nil
|
// behavior of `brew`), and `cheat` explicitly supports a
|
||||||
|
// local `.cheat` directory. Constraining further here will
|
||||||
|
// break those use-cases - and has done so in the past!
|
||||||
|
if strings.Contains(path, ".git") {
|
||||||
|
return fs.SkipDir
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse the cheatsheet file into a `sheet` struct
|
// parse the cheatsheet file into a `sheet` struct
|
||||||
|
9
vendor/github.com/alecthomas/chroma/go.mod
generated
vendored
9
vendor/github.com/alecthomas/chroma/go.mod
generated
vendored
@ -1,9 +0,0 @@
|
|||||||
module github.com/alecthomas/chroma
|
|
||||||
|
|
||||||
go 1.13
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
||||||
github.com/dlclark/regexp2 v1.4.0
|
|
||||||
github.com/stretchr/testify v1.7.0
|
|
||||||
)
|
|
14
vendor/github.com/alecthomas/chroma/go.sum
generated
vendored
14
vendor/github.com/alecthomas/chroma/go.sum
generated
vendored
@ -1,14 +0,0 @@
|
|||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
|
|
||||||
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
6
vendor/github.com/dlclark/regexp2/.travis.yml
generated
vendored
6
vendor/github.com/dlclark/regexp2/.travis.yml
generated
vendored
@ -1,5 +1,7 @@
|
|||||||
language: go
|
language: go
|
||||||
|
arch:
|
||||||
|
- AMD64
|
||||||
|
- ppc64le
|
||||||
go:
|
go:
|
||||||
- 1.9
|
- 1.9
|
||||||
- tip
|
- tip
|
||||||
|
24
vendor/github.com/dlclark/regexp2/README.md
generated
vendored
24
vendor/github.com/dlclark/regexp2/README.md
generated
vendored
@ -39,6 +39,24 @@ Group 0 is embedded in the Match. Group 0 is an automatically-assigned group th
|
|||||||
|
|
||||||
The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`.
|
The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`.
|
||||||
|
|
||||||
|
If you want to find multiple matches from a single input string you should use the `FindNextMatch` method. For example, to implement a function similar to `regexp.FindAllString`:
|
||||||
|
|
||||||
|
```go
|
||||||
|
func regexp2FindAllString(re *regexp2.Regexp, s string) []string {
|
||||||
|
var matches []string
|
||||||
|
m, _ := re.FindStringMatch(s)
|
||||||
|
for m != nil {
|
||||||
|
matches = append(matches, m.String())
|
||||||
|
m, _ = re.FindNextMatch(m)
|
||||||
|
}
|
||||||
|
return matches
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`FindNextMatch` is optmized so that it re-uses the underlying string/rune slice.
|
||||||
|
|
||||||
|
The internals of `regexp2` always operate on `[]rune` so `Index` and `Length` data in a `Match` always reference a position in `rune`s rather than `byte`s (even if the input was given as a string). This is a dramatic difference between `regexp` and `regexp2`. It's advisable to use the provided `String()` methods to avoid having to work with indices.
|
||||||
|
|
||||||
## Compare `regexp` and `regexp2`
|
## Compare `regexp` and `regexp2`
|
||||||
| Category | regexp | regexp2 |
|
| Category | regexp | regexp2 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
@ -62,6 +80,8 @@ The default behavior of `regexp2` is to match the .NET regexp engine, however th
|
|||||||
* add support for named ascii character classes (e.g. `[[:foo:]]`)
|
* add support for named ascii character classes (e.g. `[[:foo:]]`)
|
||||||
* add support for python-style capture groups (e.g. `(P<name>re)`)
|
* add support for python-style capture groups (e.g. `(P<name>re)`)
|
||||||
* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24))
|
* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24))
|
||||||
|
* change the character classes `\d` `\s` and `\w` to match the same characters as RE2. NOTE: if you also use the `ECMAScript` option then this will change the `\s` character class to match ECMAScript instead of RE2. ECMAScript allows more whitespace characters in `\s` than RE2 (but still fewer than the the default behavior).
|
||||||
|
* allow character escape sequences to have defaults. For example, by default `\_` isn't a known character escape and will fail to compile, but in RE2 mode it will match the literal character `_`
|
||||||
|
|
||||||
```go
|
```go
|
||||||
re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2)
|
re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2)
|
||||||
@ -72,6 +92,10 @@ if isMatch, _ := re.MatchString(`Something to match`); isMatch {
|
|||||||
|
|
||||||
This feature is a work in progress and I'm open to ideas for more things to put here (maybe more relaxed character escaping rules?).
|
This feature is a work in progress and I'm open to ideas for more things to put here (maybe more relaxed character escaping rules?).
|
||||||
|
|
||||||
|
## ECMAScript compatibility mode
|
||||||
|
In this mode the engine provides compatibility with the [regex engine](https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects) described in the ECMAScript specification.
|
||||||
|
|
||||||
|
Additionally a Unicode mode is provided which allows parsing of `\u{CodePoint}` syntax that is only when both are provided.
|
||||||
|
|
||||||
## Library features that I'm still working on
|
## Library features that I'm still working on
|
||||||
- Regex split
|
- Regex split
|
||||||
|
1
vendor/github.com/dlclark/regexp2/regexp.go
generated
vendored
1
vendor/github.com/dlclark/regexp2/regexp.go
generated
vendored
@ -121,6 +121,7 @@ const (
|
|||||||
Debug = 0x0080 // "d"
|
Debug = 0x0080 // "d"
|
||||||
ECMAScript = 0x0100 // "e"
|
ECMAScript = 0x0100 // "e"
|
||||||
RE2 = 0x0200 // RE2 (regexp package) compatibility mode
|
RE2 = 0x0200 // RE2 (regexp package) compatibility mode
|
||||||
|
Unicode = 0x0400 // "u"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (re *Regexp) RightToLeft() bool {
|
func (re *Regexp) RightToLeft() bool {
|
||||||
|
15
vendor/github.com/dlclark/regexp2/syntax/charclass.go
generated
vendored
15
vendor/github.com/dlclark/regexp2/syntax/charclass.go
generated
vendored
@ -37,6 +37,8 @@ var (
|
|||||||
ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00}
|
ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00}
|
||||||
ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b}
|
ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b}
|
||||||
ecmaDigit = []rune{0x0030, 0x003a}
|
ecmaDigit = []rune{0x0030, 0x003a}
|
||||||
|
|
||||||
|
re2Space = []rune{0x0009, 0x000b, 0x000c, 0x000e, 0x0020, 0x0021}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -56,6 +58,9 @@ var (
|
|||||||
NotSpaceClass = getCharSetFromCategoryString(true, false, spaceCategoryText)
|
NotSpaceClass = getCharSetFromCategoryString(true, false, spaceCategoryText)
|
||||||
DigitClass = getCharSetFromCategoryString(false, false, "Nd")
|
DigitClass = getCharSetFromCategoryString(false, false, "Nd")
|
||||||
NotDigitClass = getCharSetFromCategoryString(false, true, "Nd")
|
NotDigitClass = getCharSetFromCategoryString(false, true, "Nd")
|
||||||
|
|
||||||
|
RE2SpaceClass = getCharSetFromOldString(re2Space, false)
|
||||||
|
NotRE2SpaceClass = getCharSetFromOldString(re2Space, true)
|
||||||
)
|
)
|
||||||
|
|
||||||
var unicodeCategories = func() map[string]*unicode.RangeTable {
|
var unicodeCategories = func() map[string]*unicode.RangeTable {
|
||||||
@ -401,13 +406,19 @@ func (c *CharSet) addChar(ch rune) {
|
|||||||
c.addRange(ch, ch)
|
c.addRange(ch, ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CharSet) addSpace(ecma, negate bool) {
|
func (c *CharSet) addSpace(ecma, re2, negate bool) {
|
||||||
if ecma {
|
if ecma {
|
||||||
if negate {
|
if negate {
|
||||||
c.addRanges(NotECMASpaceClass().ranges)
|
c.addRanges(NotECMASpaceClass().ranges)
|
||||||
} else {
|
} else {
|
||||||
c.addRanges(ECMASpaceClass().ranges)
|
c.addRanges(ECMASpaceClass().ranges)
|
||||||
}
|
}
|
||||||
|
} else if re2 {
|
||||||
|
if negate {
|
||||||
|
c.addRanges(NotRE2SpaceClass().ranges)
|
||||||
|
} else {
|
||||||
|
c.addRanges(RE2SpaceClass().ranges)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
c.addCategories(category{cat: spaceCategoryText, negate: negate})
|
c.addCategories(category{cat: spaceCategoryText, negate: negate})
|
||||||
}
|
}
|
||||||
@ -563,7 +574,7 @@ func (c *CharSet) addNamedASCII(name string, negate bool) bool {
|
|||||||
case "punct": //[!-/:-@[-`{-~]
|
case "punct": //[!-/:-@[-`{-~]
|
||||||
rs = []singleRange{singleRange{'!', '/'}, singleRange{':', '@'}, singleRange{'[', '`'}, singleRange{'{', '~'}}
|
rs = []singleRange{singleRange{'!', '/'}, singleRange{':', '@'}, singleRange{'[', '`'}, singleRange{'{', '~'}}
|
||||||
case "space":
|
case "space":
|
||||||
c.addSpace(true, negate)
|
c.addSpace(true, false, negate)
|
||||||
case "upper":
|
case "upper":
|
||||||
rs = []singleRange{singleRange{'A', 'Z'}}
|
rs = []singleRange{singleRange{'A', 'Z'}}
|
||||||
case "word":
|
case "word":
|
||||||
|
74
vendor/github.com/dlclark/regexp2/syntax/parser.go
generated
vendored
74
vendor/github.com/dlclark/regexp2/syntax/parser.go
generated
vendored
@ -22,6 +22,7 @@ const (
|
|||||||
Debug = 0x0080 // "d"
|
Debug = 0x0080 // "d"
|
||||||
ECMAScript = 0x0100 // "e"
|
ECMAScript = 0x0100 // "e"
|
||||||
RE2 = 0x0200 // RE2 compat mode
|
RE2 = 0x0200 // RE2 compat mode
|
||||||
|
Unicode = 0x0400 // "u"
|
||||||
)
|
)
|
||||||
|
|
||||||
func optionFromCode(ch rune) RegexOptions {
|
func optionFromCode(ch rune) RegexOptions {
|
||||||
@ -43,6 +44,8 @@ func optionFromCode(ch rune) RegexOptions {
|
|||||||
return Debug
|
return Debug
|
||||||
case 'e', 'E':
|
case 'e', 'E':
|
||||||
return ECMAScript
|
return ECMAScript
|
||||||
|
case 'u', 'U':
|
||||||
|
return Unicode
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -104,7 +107,7 @@ const (
|
|||||||
ErrBadClassInCharRange = "cannot include class \\%v in character range"
|
ErrBadClassInCharRange = "cannot include class \\%v in character range"
|
||||||
ErrUnterminatedBracket = "unterminated [] set"
|
ErrUnterminatedBracket = "unterminated [] set"
|
||||||
ErrSubtractionMustBeLast = "a subtraction must be the last element in a character class"
|
ErrSubtractionMustBeLast = "a subtraction must be the last element in a character class"
|
||||||
ErrReversedCharRange = "[x-y] range in reverse order"
|
ErrReversedCharRange = "[%c-%c] range in reverse order"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (e ErrorCode) String() string {
|
func (e ErrorCode) String() string {
|
||||||
@ -1121,14 +1124,14 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
|
|
||||||
case 'w':
|
case 'w':
|
||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() || p.useRE2() {
|
||||||
return newRegexNodeSet(ntSet, p.options, ECMAWordClass()), nil
|
return newRegexNodeSet(ntSet, p.options, ECMAWordClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, WordClass()), nil
|
return newRegexNodeSet(ntSet, p.options, WordClass()), nil
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() || p.useRE2() {
|
||||||
return newRegexNodeSet(ntSet, p.options, NotECMAWordClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotECMAWordClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, NotWordClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotWordClass()), nil
|
||||||
@ -1137,6 +1140,8 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() {
|
||||||
return newRegexNodeSet(ntSet, p.options, ECMASpaceClass()), nil
|
return newRegexNodeSet(ntSet, p.options, ECMASpaceClass()), nil
|
||||||
|
} else if p.useRE2() {
|
||||||
|
return newRegexNodeSet(ntSet, p.options, RE2SpaceClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, SpaceClass()), nil
|
return newRegexNodeSet(ntSet, p.options, SpaceClass()), nil
|
||||||
|
|
||||||
@ -1144,19 +1149,21 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() {
|
||||||
return newRegexNodeSet(ntSet, p.options, NotECMASpaceClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotECMASpaceClass()), nil
|
||||||
|
} else if p.useRE2() {
|
||||||
|
return newRegexNodeSet(ntSet, p.options, NotRE2SpaceClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, NotSpaceClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotSpaceClass()), nil
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() || p.useRE2() {
|
||||||
return newRegexNodeSet(ntSet, p.options, ECMADigitClass()), nil
|
return newRegexNodeSet(ntSet, p.options, ECMADigitClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, DigitClass()), nil
|
return newRegexNodeSet(ntSet, p.options, DigitClass()), nil
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
if p.useOptionE() {
|
if p.useOptionE() || p.useRE2() {
|
||||||
return newRegexNodeSet(ntSet, p.options, NotECMADigitClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotECMADigitClass()), nil
|
||||||
}
|
}
|
||||||
return newRegexNodeSet(ntSet, p.options, NotDigitClass()), nil
|
return newRegexNodeSet(ntSet, p.options, NotDigitClass()), nil
|
||||||
@ -1186,19 +1193,24 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
return nil, p.getErr(ErrIllegalEndEscape)
|
return nil, p.getErr(ErrIllegalEndEscape)
|
||||||
}
|
}
|
||||||
angled := false
|
angled := false
|
||||||
|
k := false
|
||||||
close := '\x00'
|
close := '\x00'
|
||||||
|
|
||||||
backpos := p.textpos()
|
backpos := p.textpos()
|
||||||
ch := p.rightChar(0)
|
ch := p.rightChar(0)
|
||||||
|
|
||||||
// allow \k<foo> instead of \<foo>, which is now deprecated
|
// Allow \k<foo> instead of \<foo>, which is now deprecated.
|
||||||
|
|
||||||
if ch == 'k' {
|
// According to ECMAScript specification, \k<name> is only parsed as a named group reference if
|
||||||
|
// there is at least one group name in the regexp.
|
||||||
|
// See https://www.ecma-international.org/ecma-262/#sec-isvalidregularexpressionliteral, step 7.
|
||||||
|
// Note, during the first (scanOnly) run we may not have all group names scanned, but that's ok.
|
||||||
|
if ch == 'k' && (!p.useOptionE() || len(p.capnames) > 0) {
|
||||||
if p.charsRight() >= 2 {
|
if p.charsRight() >= 2 {
|
||||||
p.moveRight(1)
|
p.moveRight(1)
|
||||||
ch = p.moveRightGetChar()
|
ch = p.moveRightGetChar()
|
||||||
|
|
||||||
if ch == '<' || ch == '\'' {
|
if ch == '<' || (!p.useOptionE() && ch == '\'') { // No support for \k'name' in ECMAScript
|
||||||
angled = true
|
angled = true
|
||||||
if ch == '\'' {
|
if ch == '\'' {
|
||||||
close = '\''
|
close = '\''
|
||||||
@ -1213,8 +1225,9 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ch = p.rightChar(0)
|
ch = p.rightChar(0)
|
||||||
|
k = true
|
||||||
|
|
||||||
} else if (ch == '<' || ch == '\'') && p.charsRight() > 1 { // Note angle without \g
|
} else if !p.useOptionE() && (ch == '<' || ch == '\'') && p.charsRight() > 1 { // Note angle without \g
|
||||||
angled = true
|
angled = true
|
||||||
if ch == '\'' {
|
if ch == '\'' {
|
||||||
close = '\''
|
close = '\''
|
||||||
@ -1257,14 +1270,23 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
return nil, p.getErr(ErrUndefinedBackRef, capnum)
|
return nil, p.getErr(ErrUndefinedBackRef, capnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if angled && IsWordChar(ch) {
|
} else if angled {
|
||||||
capname := p.scanCapname()
|
capname := p.scanCapname()
|
||||||
|
|
||||||
if p.charsRight() > 0 && p.moveRightGetChar() == close {
|
if capname != "" && p.charsRight() > 0 && p.moveRightGetChar() == close {
|
||||||
|
|
||||||
|
if scanOnly {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
if p.isCaptureName(capname) {
|
if p.isCaptureName(capname) {
|
||||||
return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil
|
return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil
|
||||||
}
|
}
|
||||||
return nil, p.getErr(ErrUndefinedNameRef, capname)
|
return nil, p.getErr(ErrUndefinedNameRef, capname)
|
||||||
|
} else {
|
||||||
|
if k {
|
||||||
|
return nil, p.getErr(ErrMalformedNameRef)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1276,6 +1298,10 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if scanOnly {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
if p.useOptionI() {
|
if p.useOptionI() {
|
||||||
ch = unicode.ToLower(ch)
|
ch = unicode.ToLower(ch)
|
||||||
}
|
}
|
||||||
@ -1443,7 +1469,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
|
|||||||
if inRange {
|
if inRange {
|
||||||
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
||||||
}
|
}
|
||||||
cc.addDigit(p.useOptionE(), ch == 'D', p.patternRaw)
|
cc.addDigit(p.useOptionE() || p.useRE2(), ch == 'D', p.patternRaw)
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1452,7 +1478,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
|
|||||||
if inRange {
|
if inRange {
|
||||||
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
||||||
}
|
}
|
||||||
cc.addSpace(p.useOptionE(), ch == 'S')
|
cc.addSpace(p.useOptionE(), p.useRE2(), ch == 'S')
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1462,7 +1488,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
|
|||||||
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
return nil, p.getErr(ErrBadClassInCharRange, ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
cc.addWord(p.useOptionE(), ch == 'W')
|
cc.addWord(p.useOptionE() || p.useRE2(), ch == 'W')
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1548,7 +1574,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
|
|||||||
} else {
|
} else {
|
||||||
// a regular range, like a-z
|
// a regular range, like a-z
|
||||||
if chPrev > ch {
|
if chPrev > ch {
|
||||||
return nil, p.getErr(ErrReversedCharRange)
|
return nil, p.getErr(ErrReversedCharRange, chPrev, ch)
|
||||||
}
|
}
|
||||||
cc.addRange(chPrev, ch)
|
cc.addRange(chPrev, ch)
|
||||||
}
|
}
|
||||||
@ -1672,7 +1698,13 @@ func (p *parser) scanCharEscape() (r rune, err error) {
|
|||||||
r, err = p.scanHex(2)
|
r, err = p.scanHex(2)
|
||||||
}
|
}
|
||||||
case 'u':
|
case 'u':
|
||||||
r, err = p.scanHex(4)
|
// ECMAscript suppot \u{HEX} only if `u` is also set
|
||||||
|
if p.useOptionE() && p.useOptionU() && p.charsRight() > 0 && p.rightChar(0) == '{' {
|
||||||
|
p.moveRight(1)
|
||||||
|
return p.scanHexUntilBrace()
|
||||||
|
} else {
|
||||||
|
r, err = p.scanHex(4)
|
||||||
|
}
|
||||||
case 'a':
|
case 'a':
|
||||||
return '\u0007', nil
|
return '\u0007', nil
|
||||||
case 'b':
|
case 'b':
|
||||||
@ -1692,7 +1724,7 @@ func (p *parser) scanCharEscape() (r rune, err error) {
|
|||||||
case 'c':
|
case 'c':
|
||||||
r, err = p.scanControl()
|
r, err = p.scanControl()
|
||||||
default:
|
default:
|
||||||
if !p.useOptionE() && IsWordChar(ch) {
|
if !p.useOptionE() && !p.useRE2() && IsWordChar(ch) {
|
||||||
return 0, p.getErr(ErrUnrecognizedEscape, string(ch))
|
return 0, p.getErr(ErrUnrecognizedEscape, string(ch))
|
||||||
}
|
}
|
||||||
return ch, nil
|
return ch, nil
|
||||||
@ -1949,6 +1981,11 @@ func (p *parser) useRE2() bool {
|
|||||||
return (p.options & RE2) != 0
|
return (p.options & RE2) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// True if U option enabling ECMAScript's Unicode behavior on.
|
||||||
|
func (p *parser) useOptionU() bool {
|
||||||
|
return (p.options & Unicode) != 0
|
||||||
|
}
|
||||||
|
|
||||||
// True if options stack is empty.
|
// True if options stack is empty.
|
||||||
func (p *parser) emptyOptionsStack() bool {
|
func (p *parser) emptyOptionsStack() bool {
|
||||||
return len(p.optionsStack) == 0
|
return len(p.optionsStack) == 0
|
||||||
@ -2044,7 +2081,8 @@ func (p *parser) addToConcatenate(pos, cch int, isReplacement bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cch > 1 {
|
if cch > 1 {
|
||||||
str := p.pattern[pos : pos+cch]
|
str := make([]rune, cch)
|
||||||
|
copy(str, p.pattern[pos:pos+cch])
|
||||||
|
|
||||||
if p.useOptionI() && !isReplacement {
|
if p.useOptionI() && !isReplacement {
|
||||||
// We do the ToLower character by character for consistency. With surrogate chars, doing
|
// We do the ToLower character by character for consistency. With surrogate chars, doing
|
||||||
|
2
vendor/github.com/dlclark/regexp2/syntax/prefix.go
generated
vendored
2
vendor/github.com/dlclark/regexp2/syntax/prefix.go
generated
vendored
@ -712,7 +712,7 @@ func (b *BmPrefix) Scan(text []rune, index, beglimit, endlimit int) int {
|
|||||||
|
|
||||||
if chTest != b.pattern[match] {
|
if chTest != b.pattern[match] {
|
||||||
advance = b.positive[match]
|
advance = b.positive[match]
|
||||||
if (chTest & 0xFF80) == 0 {
|
if chTest < 128 {
|
||||||
test2 = (match - startmatch) + b.negativeASCII[chTest]
|
test2 = (match - startmatch) + b.negativeASCII[chTest]
|
||||||
} else if chTest < 0xffff && len(b.negativeUnicode) > 0 {
|
} else if chTest < 0xffff && len(b.negativeUnicode) > 0 {
|
||||||
unicodeLookup = b.negativeUnicode[chTest>>8]
|
unicodeLookup = b.negativeUnicode[chTest>>8]
|
||||||
|
5
vendor/github.com/mattn/go-isatty/go.mod
generated
vendored
5
vendor/github.com/mattn/go-isatty/go.mod
generated
vendored
@ -1,5 +0,0 @@
|
|||||||
module github.com/mattn/go-isatty
|
|
||||||
|
|
||||||
go 1.12
|
|
||||||
|
|
||||||
require golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
|
|
2
vendor/github.com/mattn/go-isatty/go.sum
generated
vendored
2
vendor/github.com/mattn/go-isatty/go.sum
generated
vendored
@ -1,2 +0,0 @@
|
|||||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
|
|
||||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
1
vendor/github.com/mitchellh/go-homedir/go.mod
generated
vendored
1
vendor/github.com/mitchellh/go-homedir/go.mod
generated
vendored
@ -1 +0,0 @@
|
|||||||
module github.com/mitchellh/go-homedir
|
|
3
vendor/golang.org/x/sys/AUTHORS
generated
vendored
3
vendor/golang.org/x/sys/AUTHORS
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
# This source code refers to The Go Authors for copyright purposes.
|
|
||||||
# The master list of authors is in the main Go distribution,
|
|
||||||
# visible at http://tip.golang.org/AUTHORS.
|
|
3
vendor/golang.org/x/sys/CONTRIBUTORS
generated
vendored
3
vendor/golang.org/x/sys/CONTRIBUTORS
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
# This source code was written by the Go contributors.
|
|
||||||
# The master list of contributors is in the main Go distribution,
|
|
||||||
# visible at http://tip.golang.org/CONTRIBUTORS.
|
|
29
vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
generated
vendored
Normal file
29
vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright 2021 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 (darwin || freebsd || netbsd || openbsd) && gc
|
||||||
|
// +build darwin freebsd netbsd openbsd
|
||||||
|
// +build gc
|
||||||
|
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// System call support for RISCV64 BSD
|
||||||
|
|
||||||
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
|
// The runtime may know about them.
|
||||||
|
|
||||||
|
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
|
JMP syscall·Syscall(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||||
|
JMP syscall·Syscall9(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
|
JMP syscall·RawSyscall6(SB)
|
5
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
5
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
@ -110,6 +110,11 @@ freebsd_arm64)
|
|||||||
mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
|
mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
;;
|
;;
|
||||||
|
freebsd_riscv64)
|
||||||
|
mkerrors="$mkerrors -m64"
|
||||||
|
mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
|
||||||
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
|
;;
|
||||||
netbsd_386)
|
netbsd_386)
|
||||||
mkerrors="$mkerrors -m32"
|
mkerrors="$mkerrors -m32"
|
||||||
mksyscall="go run mksyscall.go -l32 -netbsd"
|
mksyscall="go run mksyscall.go -l32 -netbsd"
|
||||||
|
7
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
7
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
@ -203,6 +203,7 @@ struct ltchars {
|
|||||||
#include <sys/timerfd.h>
|
#include <sys/timerfd.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/xattr.h>
|
#include <sys/xattr.h>
|
||||||
|
#include <linux/audit.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
#include <linux/can/error.h>
|
#include <linux/can/error.h>
|
||||||
@ -296,6 +297,10 @@ struct ltchars {
|
|||||||
#define SOL_NETLINK 270
|
#define SOL_NETLINK 270
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SOL_SMC
|
||||||
|
#define SOL_SMC 286
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SOL_BLUETOOTH
|
#ifdef SOL_BLUETOOTH
|
||||||
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
||||||
// but it is already in bluetooth_linux.go
|
// but it is already in bluetooth_linux.go
|
||||||
@ -554,6 +559,7 @@ ccflags="$@"
|
|||||||
$2 ~ /^CLONE_[A-Z_]+/ ||
|
$2 ~ /^CLONE_[A-Z_]+/ ||
|
||||||
$2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
|
$2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
|
||||||
$2 ~ /^(BPF|DLT)_/ ||
|
$2 ~ /^(BPF|DLT)_/ ||
|
||||||
|
$2 ~ /^AUDIT_/ ||
|
||||||
$2 ~ /^(CLOCK|TIMER)_/ ||
|
$2 ~ /^(CLOCK|TIMER)_/ ||
|
||||||
$2 ~ /^CAN_/ ||
|
$2 ~ /^CAN_/ ||
|
||||||
$2 ~ /^CAP_/ ||
|
$2 ~ /^CAP_/ ||
|
||||||
@ -576,7 +582,6 @@ ccflags="$@"
|
|||||||
$2 ~ /^SEEK_/ ||
|
$2 ~ /^SEEK_/ ||
|
||||||
$2 ~ /^SPLICE_/ ||
|
$2 ~ /^SPLICE_/ ||
|
||||||
$2 ~ /^SYNC_FILE_RANGE_/ ||
|
$2 ~ /^SYNC_FILE_RANGE_/ ||
|
||||||
$2 !~ /^AUDIT_RECORD_MAGIC/ &&
|
|
||||||
$2 !~ /IOC_MAGIC/ &&
|
$2 !~ /IOC_MAGIC/ &&
|
||||||
$2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ ||
|
$2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ ||
|
||||||
$2 ~ /^(VM|VMADDR)_/ ||
|
$2 ~ /^(VM|VMADDR)_/ ||
|
||||||
|
57
vendor/golang.org/x/sys/unix/syscall_aix.go
generated
vendored
57
vendor/golang.org/x/sys/unix/syscall_aix.go
generated
vendored
@ -218,13 +218,62 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
|
func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
|
||||||
// Recvmsg not implemented on AIX
|
var msg Msghdr
|
||||||
return -1, -1, -1, ENOSYS
|
msg.Name = (*byte)(unsafe.Pointer(rsa))
|
||||||
|
msg.Namelen = uint32(SizeofSockaddrAny)
|
||||||
|
var dummy byte
|
||||||
|
if len(oob) > 0 {
|
||||||
|
// receive at least one normal byte
|
||||||
|
if emptyIovecs(iov) {
|
||||||
|
var iova [1]Iovec
|
||||||
|
iova[0].Base = &dummy
|
||||||
|
iova[0].SetLen(1)
|
||||||
|
iov = iova[:]
|
||||||
|
}
|
||||||
|
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
||||||
|
msg.SetControllen(len(oob))
|
||||||
|
}
|
||||||
|
if len(iov) > 0 {
|
||||||
|
msg.Iov = &iov[0]
|
||||||
|
msg.SetIovlen(len(iov))
|
||||||
|
}
|
||||||
|
if n, err = recvmsg(fd, &msg, flags); n == -1 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
oobn = int(msg.Controllen)
|
||||||
|
recvflags = int(msg.Flags)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
|
func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
|
||||||
// SendmsgN not implemented on AIX
|
var msg Msghdr
|
||||||
return -1, ENOSYS
|
msg.Name = (*byte)(unsafe.Pointer(ptr))
|
||||||
|
msg.Namelen = uint32(salen)
|
||||||
|
var dummy byte
|
||||||
|
var empty bool
|
||||||
|
if len(oob) > 0 {
|
||||||
|
// send at least one normal byte
|
||||||
|
empty = emptyIovecs(iov)
|
||||||
|
if empty {
|
||||||
|
var iova [1]Iovec
|
||||||
|
iova[0].Base = &dummy
|
||||||
|
iova[0].SetLen(1)
|
||||||
|
iov = iova[:]
|
||||||
|
}
|
||||||
|
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
||||||
|
msg.SetControllen(len(oob))
|
||||||
|
}
|
||||||
|
if len(iov) > 0 {
|
||||||
|
msg.Iov = &iov[0]
|
||||||
|
msg.SetIovlen(len(iov))
|
||||||
|
}
|
||||||
|
if n, err = sendmsg(fd, &msg, flags); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if len(oob) > 0 && empty {
|
||||||
|
n = 0
|
||||||
|
}
|
||||||
|
return n, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
||||||
|
2
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
@ -363,7 +363,7 @@ func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Sockle
|
|||||||
var empty bool
|
var empty bool
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
// send at least one normal byte
|
// send at least one normal byte
|
||||||
empty := emptyIovecs(iov)
|
empty = emptyIovecs(iov)
|
||||||
if empty {
|
if empty {
|
||||||
var iova [1]Iovec
|
var iova [1]Iovec
|
||||||
iova[0].Base = &dummy
|
iova[0].Base = &dummy
|
||||||
|
63
vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
generated
vendored
Normal file
63
vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// Copyright 2022 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 riscv64 && freebsd
|
||||||
|
// +build riscv64,freebsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
k.Ident = uint64(fd)
|
||||||
|
k.Filter = int16(mode)
|
||||||
|
k.Flags = uint16(flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
iov.Len = uint64(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetControllen(length int) {
|
||||||
|
msghdr.Controllen = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetIovlen(length int) {
|
||||||
|
msghdr.Iovlen = int32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
cmsg.Len = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
|
var writtenOut uint64 = 0
|
||||||
|
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
|
||||||
|
|
||||||
|
written = int(writtenOut)
|
||||||
|
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
|
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||||
|
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||||
|
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||||
|
return int(ioDesc.Len), err
|
||||||
|
}
|
2
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
@ -1541,7 +1541,7 @@ func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Sockle
|
|||||||
var dummy byte
|
var dummy byte
|
||||||
var empty bool
|
var empty bool
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
empty := emptyIovecs(iov)
|
empty = emptyIovecs(iov)
|
||||||
if empty {
|
if empty {
|
||||||
var sockType int
|
var sockType int
|
||||||
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||||
|
2148
vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go
generated
vendored
Normal file
2148
vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
350
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
350
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
@ -140,6 +140,306 @@ const (
|
|||||||
ARPHRD_VOID = 0xffff
|
ARPHRD_VOID = 0xffff
|
||||||
ARPHRD_VSOCKMON = 0x33a
|
ARPHRD_VSOCKMON = 0x33a
|
||||||
ARPHRD_X25 = 0x10f
|
ARPHRD_X25 = 0x10f
|
||||||
|
AUDIT_ADD = 0x3eb
|
||||||
|
AUDIT_ADD_RULE = 0x3f3
|
||||||
|
AUDIT_ALWAYS = 0x2
|
||||||
|
AUDIT_ANOM_ABEND = 0x6a5
|
||||||
|
AUDIT_ANOM_CREAT = 0x6a7
|
||||||
|
AUDIT_ANOM_LINK = 0x6a6
|
||||||
|
AUDIT_ANOM_PROMISCUOUS = 0x6a4
|
||||||
|
AUDIT_ARCH = 0xb
|
||||||
|
AUDIT_ARCH_AARCH64 = 0xc00000b7
|
||||||
|
AUDIT_ARCH_ALPHA = 0xc0009026
|
||||||
|
AUDIT_ARCH_ARCOMPACT = 0x4000005d
|
||||||
|
AUDIT_ARCH_ARCOMPACTBE = 0x5d
|
||||||
|
AUDIT_ARCH_ARCV2 = 0x400000c3
|
||||||
|
AUDIT_ARCH_ARCV2BE = 0xc3
|
||||||
|
AUDIT_ARCH_ARM = 0x40000028
|
||||||
|
AUDIT_ARCH_ARMEB = 0x28
|
||||||
|
AUDIT_ARCH_C6X = 0x4000008c
|
||||||
|
AUDIT_ARCH_C6XBE = 0x8c
|
||||||
|
AUDIT_ARCH_CRIS = 0x4000004c
|
||||||
|
AUDIT_ARCH_CSKY = 0x400000fc
|
||||||
|
AUDIT_ARCH_FRV = 0x5441
|
||||||
|
AUDIT_ARCH_H8300 = 0x2e
|
||||||
|
AUDIT_ARCH_HEXAGON = 0xa4
|
||||||
|
AUDIT_ARCH_I386 = 0x40000003
|
||||||
|
AUDIT_ARCH_IA64 = 0xc0000032
|
||||||
|
AUDIT_ARCH_LOONGARCH32 = 0x40000102
|
||||||
|
AUDIT_ARCH_LOONGARCH64 = 0xc0000102
|
||||||
|
AUDIT_ARCH_M32R = 0x58
|
||||||
|
AUDIT_ARCH_M68K = 0x4
|
||||||
|
AUDIT_ARCH_MICROBLAZE = 0xbd
|
||||||
|
AUDIT_ARCH_MIPS = 0x8
|
||||||
|
AUDIT_ARCH_MIPS64 = 0x80000008
|
||||||
|
AUDIT_ARCH_MIPS64N32 = 0xa0000008
|
||||||
|
AUDIT_ARCH_MIPSEL = 0x40000008
|
||||||
|
AUDIT_ARCH_MIPSEL64 = 0xc0000008
|
||||||
|
AUDIT_ARCH_MIPSEL64N32 = 0xe0000008
|
||||||
|
AUDIT_ARCH_NDS32 = 0x400000a7
|
||||||
|
AUDIT_ARCH_NDS32BE = 0xa7
|
||||||
|
AUDIT_ARCH_NIOS2 = 0x40000071
|
||||||
|
AUDIT_ARCH_OPENRISC = 0x5c
|
||||||
|
AUDIT_ARCH_PARISC = 0xf
|
||||||
|
AUDIT_ARCH_PARISC64 = 0x8000000f
|
||||||
|
AUDIT_ARCH_PPC = 0x14
|
||||||
|
AUDIT_ARCH_PPC64 = 0x80000015
|
||||||
|
AUDIT_ARCH_PPC64LE = 0xc0000015
|
||||||
|
AUDIT_ARCH_RISCV32 = 0x400000f3
|
||||||
|
AUDIT_ARCH_RISCV64 = 0xc00000f3
|
||||||
|
AUDIT_ARCH_S390 = 0x16
|
||||||
|
AUDIT_ARCH_S390X = 0x80000016
|
||||||
|
AUDIT_ARCH_SH = 0x2a
|
||||||
|
AUDIT_ARCH_SH64 = 0x8000002a
|
||||||
|
AUDIT_ARCH_SHEL = 0x4000002a
|
||||||
|
AUDIT_ARCH_SHEL64 = 0xc000002a
|
||||||
|
AUDIT_ARCH_SPARC = 0x2
|
||||||
|
AUDIT_ARCH_SPARC64 = 0x8000002b
|
||||||
|
AUDIT_ARCH_TILEGX = 0xc00000bf
|
||||||
|
AUDIT_ARCH_TILEGX32 = 0x400000bf
|
||||||
|
AUDIT_ARCH_TILEPRO = 0x400000bc
|
||||||
|
AUDIT_ARCH_UNICORE = 0x4000006e
|
||||||
|
AUDIT_ARCH_X86_64 = 0xc000003e
|
||||||
|
AUDIT_ARCH_XTENSA = 0x5e
|
||||||
|
AUDIT_ARG0 = 0xc8
|
||||||
|
AUDIT_ARG1 = 0xc9
|
||||||
|
AUDIT_ARG2 = 0xca
|
||||||
|
AUDIT_ARG3 = 0xcb
|
||||||
|
AUDIT_AVC = 0x578
|
||||||
|
AUDIT_AVC_PATH = 0x57a
|
||||||
|
AUDIT_BITMASK_SIZE = 0x40
|
||||||
|
AUDIT_BIT_MASK = 0x8000000
|
||||||
|
AUDIT_BIT_TEST = 0x48000000
|
||||||
|
AUDIT_BPF = 0x536
|
||||||
|
AUDIT_BPRM_FCAPS = 0x529
|
||||||
|
AUDIT_CAPSET = 0x52a
|
||||||
|
AUDIT_CLASS_CHATTR = 0x2
|
||||||
|
AUDIT_CLASS_CHATTR_32 = 0x3
|
||||||
|
AUDIT_CLASS_DIR_WRITE = 0x0
|
||||||
|
AUDIT_CLASS_DIR_WRITE_32 = 0x1
|
||||||
|
AUDIT_CLASS_READ = 0x4
|
||||||
|
AUDIT_CLASS_READ_32 = 0x5
|
||||||
|
AUDIT_CLASS_SIGNAL = 0x8
|
||||||
|
AUDIT_CLASS_SIGNAL_32 = 0x9
|
||||||
|
AUDIT_CLASS_WRITE = 0x6
|
||||||
|
AUDIT_CLASS_WRITE_32 = 0x7
|
||||||
|
AUDIT_COMPARE_AUID_TO_EUID = 0x10
|
||||||
|
AUDIT_COMPARE_AUID_TO_FSUID = 0xe
|
||||||
|
AUDIT_COMPARE_AUID_TO_OBJ_UID = 0x5
|
||||||
|
AUDIT_COMPARE_AUID_TO_SUID = 0xf
|
||||||
|
AUDIT_COMPARE_EGID_TO_FSGID = 0x17
|
||||||
|
AUDIT_COMPARE_EGID_TO_OBJ_GID = 0x4
|
||||||
|
AUDIT_COMPARE_EGID_TO_SGID = 0x18
|
||||||
|
AUDIT_COMPARE_EUID_TO_FSUID = 0x12
|
||||||
|
AUDIT_COMPARE_EUID_TO_OBJ_UID = 0x3
|
||||||
|
AUDIT_COMPARE_EUID_TO_SUID = 0x11
|
||||||
|
AUDIT_COMPARE_FSGID_TO_OBJ_GID = 0x9
|
||||||
|
AUDIT_COMPARE_FSUID_TO_OBJ_UID = 0x8
|
||||||
|
AUDIT_COMPARE_GID_TO_EGID = 0x14
|
||||||
|
AUDIT_COMPARE_GID_TO_FSGID = 0x15
|
||||||
|
AUDIT_COMPARE_GID_TO_OBJ_GID = 0x2
|
||||||
|
AUDIT_COMPARE_GID_TO_SGID = 0x16
|
||||||
|
AUDIT_COMPARE_SGID_TO_FSGID = 0x19
|
||||||
|
AUDIT_COMPARE_SGID_TO_OBJ_GID = 0x7
|
||||||
|
AUDIT_COMPARE_SUID_TO_FSUID = 0x13
|
||||||
|
AUDIT_COMPARE_SUID_TO_OBJ_UID = 0x6
|
||||||
|
AUDIT_COMPARE_UID_TO_AUID = 0xa
|
||||||
|
AUDIT_COMPARE_UID_TO_EUID = 0xb
|
||||||
|
AUDIT_COMPARE_UID_TO_FSUID = 0xc
|
||||||
|
AUDIT_COMPARE_UID_TO_OBJ_UID = 0x1
|
||||||
|
AUDIT_COMPARE_UID_TO_SUID = 0xd
|
||||||
|
AUDIT_CONFIG_CHANGE = 0x519
|
||||||
|
AUDIT_CWD = 0x51b
|
||||||
|
AUDIT_DAEMON_ABORT = 0x4b2
|
||||||
|
AUDIT_DAEMON_CONFIG = 0x4b3
|
||||||
|
AUDIT_DAEMON_END = 0x4b1
|
||||||
|
AUDIT_DAEMON_START = 0x4b0
|
||||||
|
AUDIT_DEL = 0x3ec
|
||||||
|
AUDIT_DEL_RULE = 0x3f4
|
||||||
|
AUDIT_DEVMAJOR = 0x64
|
||||||
|
AUDIT_DEVMINOR = 0x65
|
||||||
|
AUDIT_DIR = 0x6b
|
||||||
|
AUDIT_DM_CTRL = 0x53a
|
||||||
|
AUDIT_DM_EVENT = 0x53b
|
||||||
|
AUDIT_EGID = 0x6
|
||||||
|
AUDIT_EOE = 0x528
|
||||||
|
AUDIT_EQUAL = 0x40000000
|
||||||
|
AUDIT_EUID = 0x2
|
||||||
|
AUDIT_EVENT_LISTENER = 0x537
|
||||||
|
AUDIT_EXE = 0x70
|
||||||
|
AUDIT_EXECVE = 0x51d
|
||||||
|
AUDIT_EXIT = 0x67
|
||||||
|
AUDIT_FAIL_PANIC = 0x2
|
||||||
|
AUDIT_FAIL_PRINTK = 0x1
|
||||||
|
AUDIT_FAIL_SILENT = 0x0
|
||||||
|
AUDIT_FANOTIFY = 0x533
|
||||||
|
AUDIT_FD_PAIR = 0x525
|
||||||
|
AUDIT_FEATURE_BITMAP_ALL = 0x7f
|
||||||
|
AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT = 0x1
|
||||||
|
AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME = 0x2
|
||||||
|
AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND = 0x8
|
||||||
|
AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH = 0x4
|
||||||
|
AUDIT_FEATURE_BITMAP_FILTER_FS = 0x40
|
||||||
|
AUDIT_FEATURE_BITMAP_LOST_RESET = 0x20
|
||||||
|
AUDIT_FEATURE_BITMAP_SESSIONID_FILTER = 0x10
|
||||||
|
AUDIT_FEATURE_CHANGE = 0x530
|
||||||
|
AUDIT_FEATURE_LOGINUID_IMMUTABLE = 0x1
|
||||||
|
AUDIT_FEATURE_ONLY_UNSET_LOGINUID = 0x0
|
||||||
|
AUDIT_FEATURE_VERSION = 0x1
|
||||||
|
AUDIT_FIELD_COMPARE = 0x6f
|
||||||
|
AUDIT_FILETYPE = 0x6c
|
||||||
|
AUDIT_FILTERKEY = 0xd2
|
||||||
|
AUDIT_FILTER_ENTRY = 0x2
|
||||||
|
AUDIT_FILTER_EXCLUDE = 0x5
|
||||||
|
AUDIT_FILTER_EXIT = 0x4
|
||||||
|
AUDIT_FILTER_FS = 0x6
|
||||||
|
AUDIT_FILTER_PREPEND = 0x10
|
||||||
|
AUDIT_FILTER_TASK = 0x1
|
||||||
|
AUDIT_FILTER_TYPE = 0x5
|
||||||
|
AUDIT_FILTER_URING_EXIT = 0x7
|
||||||
|
AUDIT_FILTER_USER = 0x0
|
||||||
|
AUDIT_FILTER_WATCH = 0x3
|
||||||
|
AUDIT_FIRST_KERN_ANOM_MSG = 0x6a4
|
||||||
|
AUDIT_FIRST_USER_MSG = 0x44c
|
||||||
|
AUDIT_FIRST_USER_MSG2 = 0x834
|
||||||
|
AUDIT_FSGID = 0x8
|
||||||
|
AUDIT_FSTYPE = 0x1a
|
||||||
|
AUDIT_FSUID = 0x4
|
||||||
|
AUDIT_GET = 0x3e8
|
||||||
|
AUDIT_GET_FEATURE = 0x3fb
|
||||||
|
AUDIT_GID = 0x5
|
||||||
|
AUDIT_GREATER_THAN = 0x20000000
|
||||||
|
AUDIT_GREATER_THAN_OR_EQUAL = 0x60000000
|
||||||
|
AUDIT_INODE = 0x66
|
||||||
|
AUDIT_INTEGRITY_DATA = 0x708
|
||||||
|
AUDIT_INTEGRITY_EVM_XATTR = 0x70e
|
||||||
|
AUDIT_INTEGRITY_HASH = 0x70b
|
||||||
|
AUDIT_INTEGRITY_METADATA = 0x709
|
||||||
|
AUDIT_INTEGRITY_PCR = 0x70c
|
||||||
|
AUDIT_INTEGRITY_POLICY_RULE = 0x70f
|
||||||
|
AUDIT_INTEGRITY_RULE = 0x70d
|
||||||
|
AUDIT_INTEGRITY_STATUS = 0x70a
|
||||||
|
AUDIT_IPC = 0x517
|
||||||
|
AUDIT_IPC_SET_PERM = 0x51f
|
||||||
|
AUDIT_KERNEL = 0x7d0
|
||||||
|
AUDIT_KERNEL_OTHER = 0x524
|
||||||
|
AUDIT_KERN_MODULE = 0x532
|
||||||
|
AUDIT_LAST_FEATURE = 0x1
|
||||||
|
AUDIT_LAST_KERN_ANOM_MSG = 0x707
|
||||||
|
AUDIT_LAST_USER_MSG = 0x4af
|
||||||
|
AUDIT_LAST_USER_MSG2 = 0xbb7
|
||||||
|
AUDIT_LESS_THAN = 0x10000000
|
||||||
|
AUDIT_LESS_THAN_OR_EQUAL = 0x50000000
|
||||||
|
AUDIT_LIST = 0x3ea
|
||||||
|
AUDIT_LIST_RULES = 0x3f5
|
||||||
|
AUDIT_LOGIN = 0x3ee
|
||||||
|
AUDIT_LOGINUID = 0x9
|
||||||
|
AUDIT_LOGINUID_SET = 0x18
|
||||||
|
AUDIT_MAC_CALIPSO_ADD = 0x58a
|
||||||
|
AUDIT_MAC_CALIPSO_DEL = 0x58b
|
||||||
|
AUDIT_MAC_CIPSOV4_ADD = 0x57f
|
||||||
|
AUDIT_MAC_CIPSOV4_DEL = 0x580
|
||||||
|
AUDIT_MAC_CONFIG_CHANGE = 0x57d
|
||||||
|
AUDIT_MAC_IPSEC_ADDSA = 0x583
|
||||||
|
AUDIT_MAC_IPSEC_ADDSPD = 0x585
|
||||||
|
AUDIT_MAC_IPSEC_DELSA = 0x584
|
||||||
|
AUDIT_MAC_IPSEC_DELSPD = 0x586
|
||||||
|
AUDIT_MAC_IPSEC_EVENT = 0x587
|
||||||
|
AUDIT_MAC_MAP_ADD = 0x581
|
||||||
|
AUDIT_MAC_MAP_DEL = 0x582
|
||||||
|
AUDIT_MAC_POLICY_LOAD = 0x57b
|
||||||
|
AUDIT_MAC_STATUS = 0x57c
|
||||||
|
AUDIT_MAC_UNLBL_ALLOW = 0x57e
|
||||||
|
AUDIT_MAC_UNLBL_STCADD = 0x588
|
||||||
|
AUDIT_MAC_UNLBL_STCDEL = 0x589
|
||||||
|
AUDIT_MAKE_EQUIV = 0x3f7
|
||||||
|
AUDIT_MAX_FIELDS = 0x40
|
||||||
|
AUDIT_MAX_FIELD_COMPARE = 0x19
|
||||||
|
AUDIT_MAX_KEY_LEN = 0x100
|
||||||
|
AUDIT_MESSAGE_TEXT_MAX = 0x2170
|
||||||
|
AUDIT_MMAP = 0x52b
|
||||||
|
AUDIT_MQ_GETSETATTR = 0x523
|
||||||
|
AUDIT_MQ_NOTIFY = 0x522
|
||||||
|
AUDIT_MQ_OPEN = 0x520
|
||||||
|
AUDIT_MQ_SENDRECV = 0x521
|
||||||
|
AUDIT_MSGTYPE = 0xc
|
||||||
|
AUDIT_NEGATE = 0x80000000
|
||||||
|
AUDIT_NETFILTER_CFG = 0x52d
|
||||||
|
AUDIT_NETFILTER_PKT = 0x52c
|
||||||
|
AUDIT_NEVER = 0x0
|
||||||
|
AUDIT_NLGRP_MAX = 0x1
|
||||||
|
AUDIT_NOT_EQUAL = 0x30000000
|
||||||
|
AUDIT_NR_FILTERS = 0x8
|
||||||
|
AUDIT_OBJ_GID = 0x6e
|
||||||
|
AUDIT_OBJ_LEV_HIGH = 0x17
|
||||||
|
AUDIT_OBJ_LEV_LOW = 0x16
|
||||||
|
AUDIT_OBJ_PID = 0x526
|
||||||
|
AUDIT_OBJ_ROLE = 0x14
|
||||||
|
AUDIT_OBJ_TYPE = 0x15
|
||||||
|
AUDIT_OBJ_UID = 0x6d
|
||||||
|
AUDIT_OBJ_USER = 0x13
|
||||||
|
AUDIT_OPENAT2 = 0x539
|
||||||
|
AUDIT_OPERATORS = 0x78000000
|
||||||
|
AUDIT_PATH = 0x516
|
||||||
|
AUDIT_PERM = 0x6a
|
||||||
|
AUDIT_PERM_ATTR = 0x8
|
||||||
|
AUDIT_PERM_EXEC = 0x1
|
||||||
|
AUDIT_PERM_READ = 0x4
|
||||||
|
AUDIT_PERM_WRITE = 0x2
|
||||||
|
AUDIT_PERS = 0xa
|
||||||
|
AUDIT_PID = 0x0
|
||||||
|
AUDIT_POSSIBLE = 0x1
|
||||||
|
AUDIT_PPID = 0x12
|
||||||
|
AUDIT_PROCTITLE = 0x52f
|
||||||
|
AUDIT_REPLACE = 0x531
|
||||||
|
AUDIT_SADDR_FAM = 0x71
|
||||||
|
AUDIT_SECCOMP = 0x52e
|
||||||
|
AUDIT_SELINUX_ERR = 0x579
|
||||||
|
AUDIT_SESSIONID = 0x19
|
||||||
|
AUDIT_SET = 0x3e9
|
||||||
|
AUDIT_SET_FEATURE = 0x3fa
|
||||||
|
AUDIT_SGID = 0x7
|
||||||
|
AUDIT_SID_UNSET = 0xffffffff
|
||||||
|
AUDIT_SIGNAL_INFO = 0x3f2
|
||||||
|
AUDIT_SOCKADDR = 0x51a
|
||||||
|
AUDIT_SOCKETCALL = 0x518
|
||||||
|
AUDIT_STATUS_BACKLOG_LIMIT = 0x10
|
||||||
|
AUDIT_STATUS_BACKLOG_WAIT_TIME = 0x20
|
||||||
|
AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL = 0x80
|
||||||
|
AUDIT_STATUS_ENABLED = 0x1
|
||||||
|
AUDIT_STATUS_FAILURE = 0x2
|
||||||
|
AUDIT_STATUS_LOST = 0x40
|
||||||
|
AUDIT_STATUS_PID = 0x4
|
||||||
|
AUDIT_STATUS_RATE_LIMIT = 0x8
|
||||||
|
AUDIT_SUBJ_CLR = 0x11
|
||||||
|
AUDIT_SUBJ_ROLE = 0xe
|
||||||
|
AUDIT_SUBJ_SEN = 0x10
|
||||||
|
AUDIT_SUBJ_TYPE = 0xf
|
||||||
|
AUDIT_SUBJ_USER = 0xd
|
||||||
|
AUDIT_SUCCESS = 0x68
|
||||||
|
AUDIT_SUID = 0x3
|
||||||
|
AUDIT_SYSCALL = 0x514
|
||||||
|
AUDIT_SYSCALL_CLASSES = 0x10
|
||||||
|
AUDIT_TIME_ADJNTPVAL = 0x535
|
||||||
|
AUDIT_TIME_INJOFFSET = 0x534
|
||||||
|
AUDIT_TRIM = 0x3f6
|
||||||
|
AUDIT_TTY = 0x527
|
||||||
|
AUDIT_TTY_GET = 0x3f8
|
||||||
|
AUDIT_TTY_SET = 0x3f9
|
||||||
|
AUDIT_UID = 0x1
|
||||||
|
AUDIT_UID_UNSET = 0xffffffff
|
||||||
|
AUDIT_UNUSED_BITS = 0x7fffc00
|
||||||
|
AUDIT_URINGOP = 0x538
|
||||||
|
AUDIT_USER = 0x3ed
|
||||||
|
AUDIT_USER_AVC = 0x453
|
||||||
|
AUDIT_USER_TTY = 0x464
|
||||||
|
AUDIT_VERSION_BACKLOG_LIMIT = 0x1
|
||||||
|
AUDIT_VERSION_BACKLOG_WAIT_TIME = 0x2
|
||||||
|
AUDIT_VERSION_LATEST = 0x7f
|
||||||
|
AUDIT_WATCH = 0x69
|
||||||
|
AUDIT_WATCH_INS = 0x3ef
|
||||||
|
AUDIT_WATCH_LIST = 0x3f1
|
||||||
|
AUDIT_WATCH_REM = 0x3f0
|
||||||
AUTOFS_SUPER_MAGIC = 0x187
|
AUTOFS_SUPER_MAGIC = 0x187
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x3
|
B110 = 0x3
|
||||||
@ -538,6 +838,55 @@ const (
|
|||||||
EFD_SEMAPHORE = 0x1
|
EFD_SEMAPHORE = 0x1
|
||||||
EFIVARFS_MAGIC = 0xde5e81e4
|
EFIVARFS_MAGIC = 0xde5e81e4
|
||||||
EFS_SUPER_MAGIC = 0x414a53
|
EFS_SUPER_MAGIC = 0x414a53
|
||||||
|
EM_386 = 0x3
|
||||||
|
EM_486 = 0x6
|
||||||
|
EM_68K = 0x4
|
||||||
|
EM_860 = 0x7
|
||||||
|
EM_88K = 0x5
|
||||||
|
EM_AARCH64 = 0xb7
|
||||||
|
EM_ALPHA = 0x9026
|
||||||
|
EM_ALTERA_NIOS2 = 0x71
|
||||||
|
EM_ARCOMPACT = 0x5d
|
||||||
|
EM_ARCV2 = 0xc3
|
||||||
|
EM_ARM = 0x28
|
||||||
|
EM_BLACKFIN = 0x6a
|
||||||
|
EM_BPF = 0xf7
|
||||||
|
EM_CRIS = 0x4c
|
||||||
|
EM_CSKY = 0xfc
|
||||||
|
EM_CYGNUS_M32R = 0x9041
|
||||||
|
EM_CYGNUS_MN10300 = 0xbeef
|
||||||
|
EM_FRV = 0x5441
|
||||||
|
EM_H8_300 = 0x2e
|
||||||
|
EM_HEXAGON = 0xa4
|
||||||
|
EM_IA_64 = 0x32
|
||||||
|
EM_LOONGARCH = 0x102
|
||||||
|
EM_M32 = 0x1
|
||||||
|
EM_M32R = 0x58
|
||||||
|
EM_MICROBLAZE = 0xbd
|
||||||
|
EM_MIPS = 0x8
|
||||||
|
EM_MIPS_RS3_LE = 0xa
|
||||||
|
EM_MIPS_RS4_BE = 0xa
|
||||||
|
EM_MN10300 = 0x59
|
||||||
|
EM_NDS32 = 0xa7
|
||||||
|
EM_NONE = 0x0
|
||||||
|
EM_OPENRISC = 0x5c
|
||||||
|
EM_PARISC = 0xf
|
||||||
|
EM_PPC = 0x14
|
||||||
|
EM_PPC64 = 0x15
|
||||||
|
EM_RISCV = 0xf3
|
||||||
|
EM_S390 = 0x16
|
||||||
|
EM_S390_OLD = 0xa390
|
||||||
|
EM_SH = 0x2a
|
||||||
|
EM_SPARC = 0x2
|
||||||
|
EM_SPARC32PLUS = 0x12
|
||||||
|
EM_SPARCV9 = 0x2b
|
||||||
|
EM_SPU = 0x17
|
||||||
|
EM_TILEGX = 0xbf
|
||||||
|
EM_TILEPRO = 0xbc
|
||||||
|
EM_TI_C6000 = 0x8c
|
||||||
|
EM_UNICORE = 0x6e
|
||||||
|
EM_X86_64 = 0x3e
|
||||||
|
EM_XTENSA = 0x5e
|
||||||
ENCODING_DEFAULT = 0x0
|
ENCODING_DEFAULT = 0x0
|
||||||
ENCODING_FM_MARK = 0x3
|
ENCODING_FM_MARK = 0x3
|
||||||
ENCODING_FM_SPACE = 0x4
|
ENCODING_FM_SPACE = 0x4
|
||||||
@ -2591,6 +2940,7 @@ const (
|
|||||||
SOL_RAW = 0xff
|
SOL_RAW = 0xff
|
||||||
SOL_RDS = 0x114
|
SOL_RDS = 0x114
|
||||||
SOL_RXRPC = 0x110
|
SOL_RXRPC = 0x110
|
||||||
|
SOL_SMC = 0x11e
|
||||||
SOL_TCP = 0x6
|
SOL_TCP = 0x6
|
||||||
SOL_TIPC = 0x10f
|
SOL_TIPC = 0x10f
|
||||||
SOL_TLS = 0x11a
|
SOL_TLS = 0x11a
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m32
|
// mkerrors.sh -Wall -Werror -static -I/tmp/386/include -m32
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build 386 && linux
|
//go:build 386 && linux
|
||||||
// +build 386,linux
|
// +build 386,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/386/include -m32 _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m64
|
// mkerrors.sh -Wall -Werror -static -I/tmp/amd64/include -m64
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build amd64 && linux
|
//go:build amd64 && linux
|
||||||
// +build amd64,linux
|
// +build amd64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/amd64/include -m64 _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/arm/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm && linux
|
//go:build arm && linux
|
||||||
// +build arm,linux
|
// +build arm,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
|
// mkerrors.sh -Wall -Werror -static -I/tmp/arm64/include -fsigned-char
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm64 && linux
|
//go:build arm64 && linux
|
||||||
// +build arm64,linux
|
// +build arm64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/loong64/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build loong64 && linux
|
//go:build loong64 && linux
|
||||||
// +build loong64,linux
|
// +build loong64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/loong64/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/mips/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips && linux
|
//go:build mips && linux
|
||||||
// +build mips,linux
|
// +build mips,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/mips64/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips64 && linux
|
//go:build mips64 && linux
|
||||||
// +build mips64,linux
|
// +build mips64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/mips64le/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips64le && linux
|
//go:build mips64le && linux
|
||||||
// +build mips64le,linux
|
// +build mips64le,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64le/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/mipsle/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mipsle && linux
|
//go:build mipsle && linux
|
||||||
// +build mipsle,linux
|
// +build mipsle,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/mipsle/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc && linux
|
//go:build ppc && linux
|
||||||
// +build ppc,linux
|
// +build ppc,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc64/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc64 && linux
|
//go:build ppc64 && linux
|
||||||
// +build ppc64,linux
|
// +build ppc64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/ppc64le/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc64le && linux
|
//go:build ppc64le && linux
|
||||||
// +build ppc64le,linux
|
// +build ppc64le,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64le/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/riscv64/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build riscv64 && linux
|
//go:build riscv64 && linux
|
||||||
// +build riscv64,linux
|
// +build riscv64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/riscv64/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
|
// mkerrors.sh -Wall -Werror -static -I/tmp/s390x/include -fsigned-char
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build s390x && linux
|
//go:build s390x && linux
|
||||||
// +build s390x,linux
|
// +build s390x,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
4
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh -Wall -Werror -static -I/tmp/include
|
// mkerrors.sh -Wall -Werror -static -I/tmp/sparc64/include
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build sparc64 && linux
|
//go:build sparc64 && linux
|
||||||
// +build sparc64,linux
|
// +build sparc64,linux
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/sparc64/include _const.go
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
1889
vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go
generated
vendored
Normal file
1889
vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
394
vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go
generated
vendored
Normal file
394
vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go
generated
vendored
Normal file
@ -0,0 +1,394 @@
|
|||||||
|
// go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build riscv64 && freebsd
|
||||||
|
// +build riscv64,freebsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
// SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int
|
||||||
|
SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void
|
||||||
|
SYS_FORK = 2 // { int fork(void); }
|
||||||
|
SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); }
|
||||||
|
SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); }
|
||||||
|
SYS_OPEN = 5 // { int open(char *path, int flags, int mode); }
|
||||||
|
SYS_CLOSE = 6 // { int close(int fd); }
|
||||||
|
SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); }
|
||||||
|
SYS_LINK = 9 // { int link(char *path, char *link); }
|
||||||
|
SYS_UNLINK = 10 // { int unlink(char *path); }
|
||||||
|
SYS_CHDIR = 12 // { int chdir(char *path); }
|
||||||
|
SYS_FCHDIR = 13 // { int fchdir(int fd); }
|
||||||
|
SYS_CHMOD = 15 // { int chmod(char *path, int mode); }
|
||||||
|
SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); }
|
||||||
|
SYS_BREAK = 17 // { caddr_t break(char *nsize); }
|
||||||
|
SYS_GETPID = 20 // { pid_t getpid(void); }
|
||||||
|
SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); }
|
||||||
|
SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); }
|
||||||
|
SYS_SETUID = 23 // { int setuid(uid_t uid); }
|
||||||
|
SYS_GETUID = 24 // { uid_t getuid(void); }
|
||||||
|
SYS_GETEUID = 25 // { uid_t geteuid(void); }
|
||||||
|
SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); }
|
||||||
|
SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); }
|
||||||
|
SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); }
|
||||||
|
SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); }
|
||||||
|
SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); }
|
||||||
|
SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
|
||||||
|
SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
|
||||||
|
SYS_ACCESS = 33 // { int access(char *path, int amode); }
|
||||||
|
SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); }
|
||||||
|
SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); }
|
||||||
|
SYS_SYNC = 36 // { int sync(void); }
|
||||||
|
SYS_KILL = 37 // { int kill(int pid, int signum); }
|
||||||
|
SYS_GETPPID = 39 // { pid_t getppid(void); }
|
||||||
|
SYS_DUP = 41 // { int dup(u_int fd); }
|
||||||
|
SYS_GETEGID = 43 // { gid_t getegid(void); }
|
||||||
|
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); }
|
||||||
|
SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); }
|
||||||
|
SYS_GETGID = 47 // { gid_t getgid(void); }
|
||||||
|
SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); }
|
||||||
|
SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); }
|
||||||
|
SYS_ACCT = 51 // { int acct(char *path); }
|
||||||
|
SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); }
|
||||||
|
SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); }
|
||||||
|
SYS_REBOOT = 55 // { int reboot(int opt); }
|
||||||
|
SYS_REVOKE = 56 // { int revoke(char *path); }
|
||||||
|
SYS_SYMLINK = 57 // { int symlink(char *path, char *link); }
|
||||||
|
SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); }
|
||||||
|
SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); }
|
||||||
|
SYS_UMASK = 60 // { int umask(int newmask); }
|
||||||
|
SYS_CHROOT = 61 // { int chroot(char *path); }
|
||||||
|
SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); }
|
||||||
|
SYS_VFORK = 66 // { int vfork(void); }
|
||||||
|
SYS_SBRK = 69 // { int sbrk(int incr); }
|
||||||
|
SYS_SSTK = 70 // { int sstk(int incr); }
|
||||||
|
SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); }
|
||||||
|
SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); }
|
||||||
|
SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); }
|
||||||
|
SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); }
|
||||||
|
SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); }
|
||||||
|
SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); }
|
||||||
|
SYS_GETPGRP = 81 // { int getpgrp(void); }
|
||||||
|
SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); }
|
||||||
|
SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); }
|
||||||
|
SYS_SWAPON = 85 // { int swapon(char *name); }
|
||||||
|
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
|
||||||
|
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
|
||||||
|
SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); }
|
||||||
|
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
|
||||||
|
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }
|
||||||
|
SYS_FSYNC = 95 // { int fsync(int fd); }
|
||||||
|
SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); }
|
||||||
|
SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); }
|
||||||
|
SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); }
|
||||||
|
SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); }
|
||||||
|
SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); }
|
||||||
|
SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); }
|
||||||
|
SYS_LISTEN = 106 // { int listen(int s, int backlog); }
|
||||||
|
SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); }
|
||||||
|
SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); }
|
||||||
|
SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); }
|
||||||
|
SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }
|
||||||
|
SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); }
|
||||||
|
SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); }
|
||||||
|
SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); }
|
||||||
|
SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); }
|
||||||
|
SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); }
|
||||||
|
SYS_SETREGID = 127 // { int setregid(int rgid, int egid); }
|
||||||
|
SYS_RENAME = 128 // { int rename(char *from, char *to); }
|
||||||
|
SYS_FLOCK = 131 // { int flock(int fd, int how); }
|
||||||
|
SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); }
|
||||||
|
SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); }
|
||||||
|
SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); }
|
||||||
|
SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); }
|
||||||
|
SYS_MKDIR = 136 // { int mkdir(char *path, int mode); }
|
||||||
|
SYS_RMDIR = 137 // { int rmdir(char *path); }
|
||||||
|
SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); }
|
||||||
|
SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); }
|
||||||
|
SYS_SETSID = 147 // { int setsid(void); }
|
||||||
|
SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); }
|
||||||
|
SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); }
|
||||||
|
SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); }
|
||||||
|
SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); }
|
||||||
|
SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); }
|
||||||
|
SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); }
|
||||||
|
SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); }
|
||||||
|
SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); }
|
||||||
|
SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); }
|
||||||
|
SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); }
|
||||||
|
SYS_SETFIB = 175 // { int setfib(int fibnum); }
|
||||||
|
SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); }
|
||||||
|
SYS_SETGID = 181 // { int setgid(gid_t gid); }
|
||||||
|
SYS_SETEGID = 182 // { int setegid(gid_t egid); }
|
||||||
|
SYS_SETEUID = 183 // { int seteuid(uid_t euid); }
|
||||||
|
SYS_PATHCONF = 191 // { int pathconf(char *path, int name); }
|
||||||
|
SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); }
|
||||||
|
SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int
|
||||||
|
SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int
|
||||||
|
SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int
|
||||||
|
SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); }
|
||||||
|
SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); }
|
||||||
|
SYS_UNDELETE = 205 // { int undelete(char *path); }
|
||||||
|
SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); }
|
||||||
|
SYS_GETPGID = 207 // { int getpgid(pid_t pid); }
|
||||||
|
SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); }
|
||||||
|
SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); }
|
||||||
|
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); }
|
||||||
|
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
|
||||||
|
SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }
|
||||||
|
SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }
|
||||||
|
SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); }
|
||||||
|
SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); }
|
||||||
|
SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); }
|
||||||
|
SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); }
|
||||||
|
SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); }
|
||||||
|
SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); }
|
||||||
|
SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); }
|
||||||
|
SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); }
|
||||||
|
SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }
|
||||||
|
SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); }
|
||||||
|
SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); }
|
||||||
|
SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }
|
||||||
|
SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
|
||||||
|
SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); }
|
||||||
|
SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); }
|
||||||
|
SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); }
|
||||||
|
SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); }
|
||||||
|
SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }
|
||||||
|
SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); }
|
||||||
|
SYS_RFORK = 251 // { int rfork(int flags); }
|
||||||
|
SYS_ISSETUGID = 253 // { int issetugid(void); }
|
||||||
|
SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); }
|
||||||
|
SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); }
|
||||||
|
SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); }
|
||||||
|
SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); }
|
||||||
|
SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); }
|
||||||
|
SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); }
|
||||||
|
SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
|
||||||
|
SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
|
||||||
|
SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }
|
||||||
|
SYS_MODNEXT = 300 // { int modnext(int modid); }
|
||||||
|
SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); }
|
||||||
|
SYS_MODFNEXT = 302 // { int modfnext(int modid); }
|
||||||
|
SYS_MODFIND = 303 // { int modfind(const char *name); }
|
||||||
|
SYS_KLDLOAD = 304 // { int kldload(const char *file); }
|
||||||
|
SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); }
|
||||||
|
SYS_KLDFIND = 306 // { int kldfind(const char *file); }
|
||||||
|
SYS_KLDNEXT = 307 // { int kldnext(int fileid); }
|
||||||
|
SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); }
|
||||||
|
SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); }
|
||||||
|
SYS_GETSID = 310 // { int getsid(pid_t pid); }
|
||||||
|
SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
|
||||||
|
SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
|
||||||
|
SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); }
|
||||||
|
SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
|
||||||
|
SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }
|
||||||
|
SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); }
|
||||||
|
SYS_YIELD = 321 // { int yield(void); }
|
||||||
|
SYS_MLOCKALL = 324 // { int mlockall(int how); }
|
||||||
|
SYS_MUNLOCKALL = 325 // { int munlockall(void); }
|
||||||
|
SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); }
|
||||||
|
SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }
|
||||||
|
SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }
|
||||||
|
SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
|
||||||
|
SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); }
|
||||||
|
SYS_SCHED_YIELD = 331 // { int sched_yield (void); }
|
||||||
|
SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }
|
||||||
|
SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }
|
||||||
|
SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
|
||||||
|
SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); }
|
||||||
|
SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); }
|
||||||
|
SYS_JAIL = 338 // { int jail(struct jail *jail); }
|
||||||
|
SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); }
|
||||||
|
SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); }
|
||||||
|
SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); }
|
||||||
|
SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); }
|
||||||
|
SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); }
|
||||||
|
SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); }
|
||||||
|
SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }
|
||||||
|
SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }
|
||||||
|
SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }
|
||||||
|
SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }
|
||||||
|
SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
|
||||||
|
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
|
||||||
|
SYS_KQUEUE = 362 // { int kqueue(void); }
|
||||||
|
SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }
|
||||||
|
SYS___SETUGID = 374 // { int __setugid(int flag); }
|
||||||
|
SYS_EACCESS = 376 // { int eaccess(char *path, int amode); }
|
||||||
|
SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); }
|
||||||
|
SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); }
|
||||||
|
SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); }
|
||||||
|
SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); }
|
||||||
|
SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); }
|
||||||
|
SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); }
|
||||||
|
SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); }
|
||||||
|
SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); }
|
||||||
|
SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); }
|
||||||
|
SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); }
|
||||||
|
SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
|
||||||
|
SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); }
|
||||||
|
SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); }
|
||||||
|
SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); }
|
||||||
|
SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); }
|
||||||
|
SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); }
|
||||||
|
SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); }
|
||||||
|
SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); }
|
||||||
|
SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); }
|
||||||
|
SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); }
|
||||||
|
SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); }
|
||||||
|
SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); }
|
||||||
|
SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); }
|
||||||
|
SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); }
|
||||||
|
SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); }
|
||||||
|
SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); }
|
||||||
|
SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); }
|
||||||
|
SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); }
|
||||||
|
SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); }
|
||||||
|
SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); }
|
||||||
|
SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); }
|
||||||
|
SYS_SWAPOFF = 424 // { int swapoff(const char *name); }
|
||||||
|
SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); }
|
||||||
|
SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); }
|
||||||
|
SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); }
|
||||||
|
SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); }
|
||||||
|
SYS_THR_EXIT = 431 // { void thr_exit(long *state); }
|
||||||
|
SYS_THR_SELF = 432 // { int thr_self(long *id); }
|
||||||
|
SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); }
|
||||||
|
SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); }
|
||||||
|
SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); }
|
||||||
|
SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); }
|
||||||
|
SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); }
|
||||||
|
SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); }
|
||||||
|
SYS_THR_WAKE = 443 // { int thr_wake(long id); }
|
||||||
|
SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); }
|
||||||
|
SYS_AUDIT = 445 // { int audit(const void *record, u_int length); }
|
||||||
|
SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); }
|
||||||
|
SYS_GETAUID = 447 // { int getauid(uid_t *auid); }
|
||||||
|
SYS_SETAUID = 448 // { int setauid(uid_t *auid); }
|
||||||
|
SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); }
|
||||||
|
SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); }
|
||||||
|
SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); }
|
||||||
|
SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); }
|
||||||
|
SYS_AUDITCTL = 453 // { int auditctl(char *path); }
|
||||||
|
SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); }
|
||||||
|
SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); }
|
||||||
|
SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); }
|
||||||
|
SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); }
|
||||||
|
SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); }
|
||||||
|
SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); }
|
||||||
|
SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); }
|
||||||
|
SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); }
|
||||||
|
SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); }
|
||||||
|
SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); }
|
||||||
|
SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); }
|
||||||
|
SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); }
|
||||||
|
SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); }
|
||||||
|
SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); }
|
||||||
|
SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
|
||||||
|
SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
|
||||||
|
SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); }
|
||||||
|
SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); }
|
||||||
|
SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); }
|
||||||
|
SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
|
||||||
|
SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); }
|
||||||
|
SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); }
|
||||||
|
SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); }
|
||||||
|
SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); }
|
||||||
|
SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); }
|
||||||
|
SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); }
|
||||||
|
SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); }
|
||||||
|
SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); }
|
||||||
|
SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); }
|
||||||
|
SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); }
|
||||||
|
SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); }
|
||||||
|
SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); }
|
||||||
|
SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); }
|
||||||
|
SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); }
|
||||||
|
SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); }
|
||||||
|
SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); }
|
||||||
|
SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); }
|
||||||
|
SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); }
|
||||||
|
SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }
|
||||||
|
SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); }
|
||||||
|
SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); }
|
||||||
|
SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); }
|
||||||
|
SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); }
|
||||||
|
SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); }
|
||||||
|
SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); }
|
||||||
|
SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); }
|
||||||
|
SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); }
|
||||||
|
SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); }
|
||||||
|
SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); }
|
||||||
|
SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); }
|
||||||
|
SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); }
|
||||||
|
SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); }
|
||||||
|
SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); }
|
||||||
|
SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); }
|
||||||
|
SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); }
|
||||||
|
SYS_CAP_ENTER = 516 // { int cap_enter(void); }
|
||||||
|
SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }
|
||||||
|
SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); }
|
||||||
|
SYS_PDKILL = 519 // { int pdkill(int fd, int signum); }
|
||||||
|
SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); }
|
||||||
|
SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); }
|
||||||
|
SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); }
|
||||||
|
SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); }
|
||||||
|
SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
|
||||||
|
SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
|
||||||
|
SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
|
||||||
|
SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
|
||||||
|
SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
|
||||||
|
SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); }
|
||||||
|
SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); }
|
||||||
|
SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); }
|
||||||
|
SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); }
|
||||||
|
SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); }
|
||||||
|
SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); }
|
||||||
|
SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); }
|
||||||
|
SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); }
|
||||||
|
SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); }
|
||||||
|
SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); }
|
||||||
|
SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); }
|
||||||
|
SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); }
|
||||||
|
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
|
||||||
|
SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); }
|
||||||
|
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); }
|
||||||
|
SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); }
|
||||||
|
SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); }
|
||||||
|
SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); }
|
||||||
|
SYS_FDATASYNC = 550 // { int fdatasync(int fd); }
|
||||||
|
SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); }
|
||||||
|
SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); }
|
||||||
|
SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
|
||||||
|
SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); }
|
||||||
|
SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); }
|
||||||
|
SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); }
|
||||||
|
SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); }
|
||||||
|
SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
|
||||||
|
SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); }
|
||||||
|
SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); }
|
||||||
|
SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); }
|
||||||
|
SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); }
|
||||||
|
SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); }
|
||||||
|
SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); }
|
||||||
|
SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); }
|
||||||
|
SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); }
|
||||||
|
SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); }
|
||||||
|
SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); }
|
||||||
|
SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); }
|
||||||
|
)
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/386/include -m32 /tmp/386/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build 386 && linux
|
//go:build 386 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/amd64/include -m64 /tmp/amd64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build amd64 && linux
|
//go:build amd64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm/include /tmp/arm/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm && linux
|
//go:build arm && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm64/include -fsigned-char /tmp/arm64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm64 && linux
|
//go:build arm64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/loong64/include /tmp/loong64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build loong64 && linux
|
//go:build loong64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips/include /tmp/mips/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips && linux
|
//go:build mips && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64/include /tmp/mips64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips64 && linux
|
//go:build mips64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64le/include /tmp/mips64le/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mips64le && linux
|
//go:build mips64le && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mipsle/include /tmp/mipsle/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build mipsle && linux
|
//go:build mipsle && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc/include /tmp/ppc/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc && linux
|
//go:build ppc && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64/include /tmp/ppc64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc64 && linux
|
//go:build ppc64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64le/include /tmp/ppc64le/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build ppc64le && linux
|
//go:build ppc64le && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/riscv64/include /tmp/riscv64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build riscv64 && linux
|
//go:build riscv64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/s390x/include -fsigned-char /tmp/s390x/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build s390x && linux
|
//go:build s390x && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/sparc64/include /tmp/sparc64/include/asm/unistd.h
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build sparc64 && linux
|
//go:build sparc64 && linux
|
||||||
|
626
vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
generated
vendored
Normal file
626
vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
generated
vendored
Normal file
@ -0,0 +1,626 @@
|
|||||||
|
// cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build riscv64 && freebsd
|
||||||
|
// +build riscv64,freebsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
SizeofPtr = 0x8
|
||||||
|
SizeofShort = 0x2
|
||||||
|
SizeofInt = 0x4
|
||||||
|
SizeofLong = 0x8
|
||||||
|
SizeofLongLong = 0x8
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
_C_short int16
|
||||||
|
_C_int int32
|
||||||
|
_C_long int64
|
||||||
|
_C_long_long int64
|
||||||
|
)
|
||||||
|
|
||||||
|
type Timespec struct {
|
||||||
|
Sec int64
|
||||||
|
Nsec int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Timeval struct {
|
||||||
|
Sec int64
|
||||||
|
Usec int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Time_t int64
|
||||||
|
|
||||||
|
type Rusage struct {
|
||||||
|
Utime Timeval
|
||||||
|
Stime Timeval
|
||||||
|
Maxrss int64
|
||||||
|
Ixrss int64
|
||||||
|
Idrss int64
|
||||||
|
Isrss int64
|
||||||
|
Minflt int64
|
||||||
|
Majflt int64
|
||||||
|
Nswap int64
|
||||||
|
Inblock int64
|
||||||
|
Oublock int64
|
||||||
|
Msgsnd int64
|
||||||
|
Msgrcv int64
|
||||||
|
Nsignals int64
|
||||||
|
Nvcsw int64
|
||||||
|
Nivcsw int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Rlimit struct {
|
||||||
|
Cur int64
|
||||||
|
Max int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type _Gid_t uint32
|
||||||
|
|
||||||
|
const (
|
||||||
|
_statfsVersion = 0x20140518
|
||||||
|
_dirblksiz = 0x400
|
||||||
|
)
|
||||||
|
|
||||||
|
type Stat_t struct {
|
||||||
|
Dev uint64
|
||||||
|
Ino uint64
|
||||||
|
Nlink uint64
|
||||||
|
Mode uint16
|
||||||
|
_0 int16
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
|
_1 int32
|
||||||
|
Rdev uint64
|
||||||
|
Atim Timespec
|
||||||
|
Mtim Timespec
|
||||||
|
Ctim Timespec
|
||||||
|
Btim Timespec
|
||||||
|
Size int64
|
||||||
|
Blocks int64
|
||||||
|
Blksize int32
|
||||||
|
Flags uint32
|
||||||
|
Gen uint64
|
||||||
|
Spare [10]uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Statfs_t struct {
|
||||||
|
Version uint32
|
||||||
|
Type uint32
|
||||||
|
Flags uint64
|
||||||
|
Bsize uint64
|
||||||
|
Iosize uint64
|
||||||
|
Blocks uint64
|
||||||
|
Bfree uint64
|
||||||
|
Bavail int64
|
||||||
|
Files uint64
|
||||||
|
Ffree int64
|
||||||
|
Syncwrites uint64
|
||||||
|
Asyncwrites uint64
|
||||||
|
Syncreads uint64
|
||||||
|
Asyncreads uint64
|
||||||
|
Spare [10]uint64
|
||||||
|
Namemax uint32
|
||||||
|
Owner uint32
|
||||||
|
Fsid Fsid
|
||||||
|
Charspare [80]int8
|
||||||
|
Fstypename [16]byte
|
||||||
|
Mntfromname [1024]byte
|
||||||
|
Mntonname [1024]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type Flock_t struct {
|
||||||
|
Start int64
|
||||||
|
Len int64
|
||||||
|
Pid int32
|
||||||
|
Type int16
|
||||||
|
Whence int16
|
||||||
|
Sysid int32
|
||||||
|
_ [4]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type Dirent struct {
|
||||||
|
Fileno uint64
|
||||||
|
Off int64
|
||||||
|
Reclen uint16
|
||||||
|
Type uint8
|
||||||
|
Pad0 uint8
|
||||||
|
Namlen uint16
|
||||||
|
Pad1 uint16
|
||||||
|
Name [256]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type Fsid struct {
|
||||||
|
Val [2]int32
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = 0x400
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
FADV_NORMAL = 0x0
|
||||||
|
FADV_RANDOM = 0x1
|
||||||
|
FADV_SEQUENTIAL = 0x2
|
||||||
|
FADV_WILLNEED = 0x3
|
||||||
|
FADV_DONTNEED = 0x4
|
||||||
|
FADV_NOREUSE = 0x5
|
||||||
|
)
|
||||||
|
|
||||||
|
type RawSockaddrInet4 struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Port uint16
|
||||||
|
Addr [4]byte /* in_addr */
|
||||||
|
Zero [8]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrInet6 struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Port uint16
|
||||||
|
Flowinfo uint32
|
||||||
|
Addr [16]byte /* in6_addr */
|
||||||
|
Scope_id uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrUnix struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Path [104]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrDatalink struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Index uint16
|
||||||
|
Type uint8
|
||||||
|
Nlen uint8
|
||||||
|
Alen uint8
|
||||||
|
Slen uint8
|
||||||
|
Data [46]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddr struct {
|
||||||
|
Len uint8
|
||||||
|
Family uint8
|
||||||
|
Data [14]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type RawSockaddrAny struct {
|
||||||
|
Addr RawSockaddr
|
||||||
|
Pad [92]int8
|
||||||
|
}
|
||||||
|
|
||||||
|
type _Socklen uint32
|
||||||
|
|
||||||
|
type Xucred struct {
|
||||||
|
Version uint32
|
||||||
|
Uid uint32
|
||||||
|
Ngroups int16
|
||||||
|
Groups [16]uint32
|
||||||
|
_ *byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type Linger struct {
|
||||||
|
Onoff int32
|
||||||
|
Linger int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Iovec struct {
|
||||||
|
Base *byte
|
||||||
|
Len uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPMreq struct {
|
||||||
|
Multiaddr [4]byte /* in_addr */
|
||||||
|
Interface [4]byte /* in_addr */
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPMreqn struct {
|
||||||
|
Multiaddr [4]byte /* in_addr */
|
||||||
|
Address [4]byte /* in_addr */
|
||||||
|
Ifindex int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPv6Mreq struct {
|
||||||
|
Multiaddr [16]byte /* in6_addr */
|
||||||
|
Interface uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Msghdr struct {
|
||||||
|
Name *byte
|
||||||
|
Namelen uint32
|
||||||
|
Iov *Iovec
|
||||||
|
Iovlen int32
|
||||||
|
Control *byte
|
||||||
|
Controllen uint32
|
||||||
|
Flags int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Cmsghdr struct {
|
||||||
|
Len uint32
|
||||||
|
Level int32
|
||||||
|
Type int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Inet6Pktinfo struct {
|
||||||
|
Addr [16]byte /* in6_addr */
|
||||||
|
Ifindex uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type IPv6MTUInfo struct {
|
||||||
|
Addr RawSockaddrInet6
|
||||||
|
Mtu uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type ICMPv6Filter struct {
|
||||||
|
Filt [8]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
SizeofSockaddrInet4 = 0x10
|
||||||
|
SizeofSockaddrInet6 = 0x1c
|
||||||
|
SizeofSockaddrAny = 0x6c
|
||||||
|
SizeofSockaddrUnix = 0x6a
|
||||||
|
SizeofSockaddrDatalink = 0x36
|
||||||
|
SizeofXucred = 0x58
|
||||||
|
SizeofLinger = 0x8
|
||||||
|
SizeofIovec = 0x10
|
||||||
|
SizeofIPMreq = 0x8
|
||||||
|
SizeofIPMreqn = 0xc
|
||||||
|
SizeofIPv6Mreq = 0x14
|
||||||
|
SizeofMsghdr = 0x30
|
||||||
|
SizeofCmsghdr = 0xc
|
||||||
|
SizeofInet6Pktinfo = 0x14
|
||||||
|
SizeofIPv6MTUInfo = 0x20
|
||||||
|
SizeofICMPv6Filter = 0x20
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
PTRACE_TRACEME = 0x0
|
||||||
|
PTRACE_CONT = 0x7
|
||||||
|
PTRACE_KILL = 0x8
|
||||||
|
)
|
||||||
|
|
||||||
|
type PtraceLwpInfoStruct struct {
|
||||||
|
Lwpid int32
|
||||||
|
Event int32
|
||||||
|
Flags int32
|
||||||
|
Sigmask Sigset_t
|
||||||
|
Siglist Sigset_t
|
||||||
|
Siginfo __Siginfo
|
||||||
|
Tdname [20]int8
|
||||||
|
Child_pid int32
|
||||||
|
Syscall_code uint32
|
||||||
|
Syscall_narg uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type __Siginfo struct {
|
||||||
|
Signo int32
|
||||||
|
Errno int32
|
||||||
|
Code int32
|
||||||
|
Pid int32
|
||||||
|
Uid uint32
|
||||||
|
Status int32
|
||||||
|
Addr *byte
|
||||||
|
Value [8]byte
|
||||||
|
_ [40]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type Sigset_t struct {
|
||||||
|
Val [4]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Reg struct {
|
||||||
|
Ra uint64
|
||||||
|
Sp uint64
|
||||||
|
Gp uint64
|
||||||
|
Tp uint64
|
||||||
|
T [7]uint64
|
||||||
|
S [12]uint64
|
||||||
|
A [8]uint64
|
||||||
|
Sepc uint64
|
||||||
|
Sstatus uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type FpReg struct {
|
||||||
|
X [32][2]uint64
|
||||||
|
Fcsr uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type FpExtendedPrecision struct{}
|
||||||
|
|
||||||
|
type PtraceIoDesc struct {
|
||||||
|
Op int32
|
||||||
|
Offs *byte
|
||||||
|
Addr *byte
|
||||||
|
Len uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Kevent_t struct {
|
||||||
|
Ident uint64
|
||||||
|
Filter int16
|
||||||
|
Flags uint16
|
||||||
|
Fflags uint32
|
||||||
|
Data int64
|
||||||
|
Udata *byte
|
||||||
|
Ext [4]uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type FdSet struct {
|
||||||
|
Bits [16]uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
sizeofIfMsghdr = 0xa8
|
||||||
|
SizeofIfMsghdr = 0xa8
|
||||||
|
sizeofIfData = 0x98
|
||||||
|
SizeofIfData = 0x98
|
||||||
|
SizeofIfaMsghdr = 0x14
|
||||||
|
SizeofIfmaMsghdr = 0x10
|
||||||
|
SizeofIfAnnounceMsghdr = 0x18
|
||||||
|
SizeofRtMsghdr = 0x98
|
||||||
|
SizeofRtMetrics = 0x70
|
||||||
|
)
|
||||||
|
|
||||||
|
type ifMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Index uint16
|
||||||
|
_ uint16
|
||||||
|
Data ifData
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Index uint16
|
||||||
|
Data IfData
|
||||||
|
}
|
||||||
|
|
||||||
|
type ifData struct {
|
||||||
|
Type uint8
|
||||||
|
Physical uint8
|
||||||
|
Addrlen uint8
|
||||||
|
Hdrlen uint8
|
||||||
|
Link_state uint8
|
||||||
|
Vhid uint8
|
||||||
|
Datalen uint16
|
||||||
|
Mtu uint32
|
||||||
|
Metric uint32
|
||||||
|
Baudrate uint64
|
||||||
|
Ipackets uint64
|
||||||
|
Ierrors uint64
|
||||||
|
Opackets uint64
|
||||||
|
Oerrors uint64
|
||||||
|
Collisions uint64
|
||||||
|
Ibytes uint64
|
||||||
|
Obytes uint64
|
||||||
|
Imcasts uint64
|
||||||
|
Omcasts uint64
|
||||||
|
Iqdrops uint64
|
||||||
|
Oqdrops uint64
|
||||||
|
Noproto uint64
|
||||||
|
Hwassist uint64
|
||||||
|
_ [8]byte
|
||||||
|
_ [16]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfData struct {
|
||||||
|
Type uint8
|
||||||
|
Physical uint8
|
||||||
|
Addrlen uint8
|
||||||
|
Hdrlen uint8
|
||||||
|
Link_state uint8
|
||||||
|
Spare_char1 uint8
|
||||||
|
Spare_char2 uint8
|
||||||
|
Datalen uint8
|
||||||
|
Mtu uint64
|
||||||
|
Metric uint64
|
||||||
|
Baudrate uint64
|
||||||
|
Ipackets uint64
|
||||||
|
Ierrors uint64
|
||||||
|
Opackets uint64
|
||||||
|
Oerrors uint64
|
||||||
|
Collisions uint64
|
||||||
|
Ibytes uint64
|
||||||
|
Obytes uint64
|
||||||
|
Imcasts uint64
|
||||||
|
Omcasts uint64
|
||||||
|
Iqdrops uint64
|
||||||
|
Noproto uint64
|
||||||
|
Hwassist uint64
|
||||||
|
Epoch int64
|
||||||
|
Lastchange Timeval
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfaMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Index uint16
|
||||||
|
_ uint16
|
||||||
|
Metric int32
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfmaMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Addrs int32
|
||||||
|
Flags int32
|
||||||
|
Index uint16
|
||||||
|
_ uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type IfAnnounceMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Index uint16
|
||||||
|
Name [16]int8
|
||||||
|
What uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type RtMsghdr struct {
|
||||||
|
Msglen uint16
|
||||||
|
Version uint8
|
||||||
|
Type uint8
|
||||||
|
Index uint16
|
||||||
|
_ uint16
|
||||||
|
Flags int32
|
||||||
|
Addrs int32
|
||||||
|
Pid int32
|
||||||
|
Seq int32
|
||||||
|
Errno int32
|
||||||
|
Fmask int32
|
||||||
|
Inits uint64
|
||||||
|
Rmx RtMetrics
|
||||||
|
}
|
||||||
|
|
||||||
|
type RtMetrics struct {
|
||||||
|
Locks uint64
|
||||||
|
Mtu uint64
|
||||||
|
Hopcount uint64
|
||||||
|
Expire uint64
|
||||||
|
Recvpipe uint64
|
||||||
|
Sendpipe uint64
|
||||||
|
Ssthresh uint64
|
||||||
|
Rtt uint64
|
||||||
|
Rttvar uint64
|
||||||
|
Pksent uint64
|
||||||
|
Weight uint64
|
||||||
|
Nhidx uint64
|
||||||
|
Filler [2]uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
SizeofBpfVersion = 0x4
|
||||||
|
SizeofBpfStat = 0x8
|
||||||
|
SizeofBpfZbuf = 0x18
|
||||||
|
SizeofBpfProgram = 0x10
|
||||||
|
SizeofBpfInsn = 0x8
|
||||||
|
SizeofBpfHdr = 0x20
|
||||||
|
SizeofBpfZbufHeader = 0x20
|
||||||
|
)
|
||||||
|
|
||||||
|
type BpfVersion struct {
|
||||||
|
Major uint16
|
||||||
|
Minor uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfStat struct {
|
||||||
|
Recv uint32
|
||||||
|
Drop uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfZbuf struct {
|
||||||
|
Bufa *byte
|
||||||
|
Bufb *byte
|
||||||
|
Buflen uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfProgram struct {
|
||||||
|
Len uint32
|
||||||
|
Insns *BpfInsn
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfInsn struct {
|
||||||
|
Code uint16
|
||||||
|
Jt uint8
|
||||||
|
Jf uint8
|
||||||
|
K uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfHdr struct {
|
||||||
|
Tstamp Timeval
|
||||||
|
Caplen uint32
|
||||||
|
Datalen uint32
|
||||||
|
Hdrlen uint16
|
||||||
|
_ [6]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpfZbufHeader struct {
|
||||||
|
Kernel_gen uint32
|
||||||
|
Kernel_len uint32
|
||||||
|
User_gen uint32
|
||||||
|
_ [5]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Termios struct {
|
||||||
|
Iflag uint32
|
||||||
|
Oflag uint32
|
||||||
|
Cflag uint32
|
||||||
|
Lflag uint32
|
||||||
|
Cc [20]uint8
|
||||||
|
Ispeed uint32
|
||||||
|
Ospeed uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type Winsize struct {
|
||||||
|
Row uint16
|
||||||
|
Col uint16
|
||||||
|
Xpixel uint16
|
||||||
|
Ypixel uint16
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = -0x64
|
||||||
|
AT_EACCESS = 0x100
|
||||||
|
AT_SYMLINK_NOFOLLOW = 0x200
|
||||||
|
AT_SYMLINK_FOLLOW = 0x400
|
||||||
|
AT_REMOVEDIR = 0x800
|
||||||
|
)
|
||||||
|
|
||||||
|
type PollFd struct {
|
||||||
|
Fd int32
|
||||||
|
Events int16
|
||||||
|
Revents int16
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = 0x8
|
||||||
|
POLLHUP = 0x10
|
||||||
|
POLLIN = 0x1
|
||||||
|
POLLINIGNEOF = 0x2000
|
||||||
|
POLLNVAL = 0x20
|
||||||
|
POLLOUT = 0x4
|
||||||
|
POLLPRI = 0x2
|
||||||
|
POLLRDBAND = 0x80
|
||||||
|
POLLRDNORM = 0x40
|
||||||
|
POLLWRBAND = 0x100
|
||||||
|
POLLWRNORM = 0x4
|
||||||
|
)
|
||||||
|
|
||||||
|
type CapRights struct {
|
||||||
|
Rights [2]uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Utsname struct {
|
||||||
|
Sysname [256]byte
|
||||||
|
Nodename [256]byte
|
||||||
|
Release [256]byte
|
||||||
|
Version [256]byte
|
||||||
|
Machine [256]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
const SizeofClockinfo = 0x14
|
||||||
|
|
||||||
|
type Clockinfo struct {
|
||||||
|
Hz int32
|
||||||
|
Tick int32
|
||||||
|
Spare int32
|
||||||
|
Stathz int32
|
||||||
|
Profhz int32
|
||||||
|
}
|
13
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
13
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
@ -945,6 +945,9 @@ type PerfEventAttr struct {
|
|||||||
Aux_watermark uint32
|
Aux_watermark uint32
|
||||||
Sample_max_stack uint16
|
Sample_max_stack uint16
|
||||||
_ uint16
|
_ uint16
|
||||||
|
Aux_sample_size uint32
|
||||||
|
_ uint32
|
||||||
|
Sig_data uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
type PerfEventMmapPage struct {
|
type PerfEventMmapPage struct {
|
||||||
@ -1463,6 +1466,11 @@ const (
|
|||||||
IFLA_ALT_IFNAME = 0x35
|
IFLA_ALT_IFNAME = 0x35
|
||||||
IFLA_PERM_ADDRESS = 0x36
|
IFLA_PERM_ADDRESS = 0x36
|
||||||
IFLA_PROTO_DOWN_REASON = 0x37
|
IFLA_PROTO_DOWN_REASON = 0x37
|
||||||
|
IFLA_PARENT_DEV_NAME = 0x38
|
||||||
|
IFLA_PARENT_DEV_BUS_NAME = 0x39
|
||||||
|
IFLA_GRO_MAX_SIZE = 0x3a
|
||||||
|
IFLA_TSO_MAX_SIZE = 0x3b
|
||||||
|
IFLA_TSO_MAX_SEGS = 0x3c
|
||||||
IFLA_PROTO_DOWN_REASON_UNSPEC = 0x0
|
IFLA_PROTO_DOWN_REASON_UNSPEC = 0x0
|
||||||
IFLA_PROTO_DOWN_REASON_MASK = 0x1
|
IFLA_PROTO_DOWN_REASON_MASK = 0x1
|
||||||
IFLA_PROTO_DOWN_REASON_VALUE = 0x2
|
IFLA_PROTO_DOWN_REASON_VALUE = 0x2
|
||||||
@ -5594,3 +5602,8 @@ const (
|
|||||||
FR_ACT_UNREACHABLE = 0x7
|
FR_ACT_UNREACHABLE = 0x7
|
||||||
FR_ACT_PROHIBIT = 0x8
|
FR_ACT_PROHIBIT = 0x8
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AUDIT_NLGRP_NONE = 0x0
|
||||||
|
AUDIT_NLGRP_READLOG = 0x1
|
||||||
|
)
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
|
// cgo -godefs -objdir=/tmp/386/cgo -- -Wall -Werror -static -I/tmp/386/include -m32 linux/types.go | go run mkpost.go
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build 386 && linux
|
//go:build 386 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go
|
// cgo -godefs -objdir=/tmp/amd64/cgo -- -Wall -Werror -static -I/tmp/amd64/include -m64 linux/types.go | go run mkpost.go
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build amd64 && linux
|
//go:build amd64 && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
// cgo -godefs -objdir=/tmp/arm/cgo -- -Wall -Werror -static -I/tmp/arm/include linux/types.go | go run mkpost.go
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm && linux
|
//go:build arm && linux
|
||||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
|
// cgo -godefs -objdir=/tmp/arm64/cgo -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char linux/types.go | go run mkpost.go
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build arm64 && linux
|
//go:build arm64 && linux
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user