mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
release v1.20
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Eiblog Changelog
|
# Eiblog Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## v1.2.0 (2017-06-14)
|
||||||
|
* 更新评论功能,基础评论 0 回复也可评论了。
|
||||||
|
* disqus.js 文件由博主自行更新。
|
||||||
|
* 更正描述 README.md 描述错误 [#4f996](https://github.com/eiblog/eiblog/commit/4f9965b6bdefe087dd0805c1840afcb2752cd155)。
|
||||||
|
* docker 镜像版本化。
|
||||||
|
|
||||||
## v1.1.3 (2017-05-12)
|
## v1.1.3 (2017-05-12)
|
||||||
* 更新 disqus_78bca4.js 到 disqus_921d24.js,具体请参考 docs/install.md
|
* 更新 disqus_78bca4.js 到 disqus_921d24.js,具体请参考 docs/install.md
|
||||||
* 更新 vendor
|
* 更新 vendor
|
||||||
|
|||||||
+11
-8
@@ -12,7 +12,7 @@ $ go get https://github.com/eiblog/eiblog
|
|||||||
|
|
||||||
3、如果你对`docker`技术也有研究的话,你也可以通过`docker`来安装:
|
3、如果你对`docker`技术也有研究的话,你也可以通过`docker`来安装:
|
||||||
``` sh
|
``` sh
|
||||||
$ docker pull registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog
|
$ docker pull registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog:v1.2.0
|
||||||
|
|
||||||
```
|
```
|
||||||
镜像内部只提供了`eiblog`的二进制文件,因为其它内容定制化的需求过高。所以需要将`conf`、`static`、`views`目录映射出来,后面会具体说到。
|
镜像内部只提供了`eiblog`的二进制文件,因为其它内容定制化的需求过高。所以需要将`conf`、`static`、`views`目录映射出来,后面会具体说到。
|
||||||
@@ -22,13 +22,13 @@ $ docker pull registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog
|
|||||||
|
|
||||||
本地测试需要搭建两个服务`mongodb`和`elasticsearch2.4.1`(可选,搜索服务不可用)。
|
本地测试需要搭建两个服务`mongodb`和`elasticsearch2.4.1`(可选,搜索服务不可用)。
|
||||||
|
|
||||||
`Eiblog`默认会连接`hostname`为`eidb`和`eisearch`,因此你需要将信息填入`/etc/hosts`下。假如你搭建的`mongodb`地址为`127.0.0.1:27017`,`elasticsearch`地址为`192.168.99.100:9200`,如:
|
`Eiblog`默认会连接`hostname`为`mongodb`和`elasticsearch`,因此你需要将信息填入`/etc/hosts`下。假如你搭建的`mongodb`地址为`127.0.0.1:27017`,`elasticsearch`地址为`192.168.99.100:9200`,如:
|
||||||
``` sh
|
``` sh
|
||||||
$ sudo vi /etc/hosts
|
$ sudo vi /etc/hosts
|
||||||
|
|
||||||
# 在末尾加上两行
|
# 在末尾加上两行
|
||||||
127.0.0.1 eidb
|
172.42.0.1 mongodb
|
||||||
192.168.99.100 eisearch
|
192.168.99.100 elasticsearch
|
||||||
```
|
```
|
||||||
|
|
||||||
#### MongoDB 搭建
|
#### MongoDB 搭建
|
||||||
@@ -94,9 +94,9 @@ $ docker run -d --name eisearch \
|
|||||||
* `avatar.jpg`,左侧头像,`160*160~256*256`之间,CDN 文件名:`static/img/avatar.jpg`。另外你需要将该图片 `Base64` 编码后替换掉`eiblog/views/st_blog.css`中合适位置的图片。
|
* `avatar.jpg`,左侧头像,`160*160~256*256`之间,CDN 文件名:`static/img/avatar.jpg`。另外你需要将该图片 `Base64` 编码后替换掉`eiblog/views/st_blog.css`中合适位置的图片。
|
||||||
* `blank.gif`,CDN 文件名:`static/img/blank.gif`。该图片请从[这里](https://st.deepzz.com/static/img/blank.gif)下载并上传至你的 CDN。
|
* `blank.gif`,CDN 文件名:`static/img/blank.gif`。该图片请从[这里](https://st.deepzz.com/static/img/blank.gif)下载并上传至你的 CDN。
|
||||||
* `default_avatar.png`,Disqus 默认头像,CDN 文件名:`static/img/default_avatar.png`,请从[这里](https://st.deepzz.com/static/img/default_avatar.png)下载并上传至你的 CDN。
|
* `default_avatar.png`,Disqus 默认头像,CDN 文件名:`static/img/default_avatar.png`,请从[这里](https://st.deepzz.com/static/img/default_avatar.png)下载并上传至你的 CDN。
|
||||||
* `disqus.js`,该文件名是会变的,每次更新如果没有提及就没有改变,更新说明在[这里](https://github.com/eiblog/eiblog/blob/master/CHANGELOG.md)。CDN 文件名格式是:`static/js/disqus_xxx.js`。在我写这篇文章是使用的是:`static/js/disqus_a9d3fd.js`,请从[这里](https://st.deepzz.com/static/js/disqus_a9d3fd.js)下载并上传至你的 CDN。另外修改`eiblog/view/st_blog.js`中的`disqus_a9d3fd.js`。
|
* `disqus.js`,通过 https://short_name.disqus.com/embed.js 下载,替换掉 short_name。CDN 文件名格式是:`static/js/disqus_xxx.js`。在我写这篇文章是使用的是:`static/js/disqus_a9d3fd.js`。另外修改`eiblog/views/st_blog.js`中的`disqus_a9d3fd.js`为你新文件的名称。
|
||||||
|
|
||||||
> `注意`:本人 CDN 做了防盗链处理,故请将这些资源上传至您的 CDN ,以免静态资源不能访问,请悉知。
|
> 注意:每次修改 views 内的以 `st_` 开头的文件,请将 `app.yml` 中的 staticversion 提高一个版本。
|
||||||
|
|
||||||
#### 配置说明
|
#### 配置说明
|
||||||
走到这里,我相信只走到`60%`的路程。放弃还来得及。
|
走到这里,我相信只走到`60%`的路程。放弃还来得及。
|
||||||
@@ -128,8 +128,10 @@ $ docker run -d --name eisearch \
|
|||||||
│ ├── full_chained.pem
|
│ ├── full_chained.pem
|
||||||
│ └── session_ticket.key
|
│ └── session_ticket.key
|
||||||
└── tpl # 模版文件
|
└── tpl # 模版文件
|
||||||
|
├── crossdomainTpl.xml
|
||||||
├── feedTpl.xml
|
├── feedTpl.xml
|
||||||
├── opensearchTpl.xml
|
├── opensearchTpl.xml
|
||||||
|
├── robotsTpl.xml
|
||||||
└── sitemapTpl.xml
|
└── sitemapTpl.xml
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -192,7 +194,8 @@ $ docker pull registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog
|
|||||||
``` sh
|
``` sh
|
||||||
$ docker run -d --name eiblog --restart=always \
|
$ docker run -d --name eiblog --restart=always \
|
||||||
--add-host disqus.com:23.235.33.134 \
|
--add-host disqus.com:23.235.33.134 \
|
||||||
--link eidb --link eisearch \
|
--add-host mongodb:172.42.0.1 \
|
||||||
|
--add-host elasticsearch:192.168.99.100 \
|
||||||
-p 9000:9000 \
|
-p 9000:9000 \
|
||||||
-e GODEBUG=netdns=cgo \
|
-e GODEBUG=netdns=cgo \
|
||||||
-v /data/eiblog/logdata:/eiblog/logdata \
|
-v /data/eiblog/logdata:/eiblog/logdata \
|
||||||
@@ -210,7 +213,7 @@ $ docker run -d --name eiblog --restart=always \
|
|||||||
|
|
||||||
首先,请将本地测试好的`conf`,`static`,`views`,`docker-compose.yml`文件夹和文件上传至服务器。前三个文件夹建议存储到服务器`/data/eiblog`下,`docker-compose.yml`存放在你使用方便的地方。
|
首先,请将本地测试好的`conf`,`static`,`views`,`docker-compose.yml`文件夹和文件上传至服务器。前三个文件夹建议存储到服务器`/data/eiblog`下,`docker-compose.yml`存放在你使用方便的地方。
|
||||||
|
|
||||||
> 注意`conf/es/config/scripts`空文件夹是否存在
|
> 注意检查`conf/es/config/scripts`空文件夹是否存在
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
$ tree /data/eiblog -L 1
|
$ tree /data/eiblog -L 1
|
||||||
|
|||||||
@@ -59,3 +59,16 @@ x 为小写字母(x,y,z)中的 x。使页面未加载时也占了相应的
|
|||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 摘要截取
|
||||||
|
摘要截取主要是提供给首页显示,如:
|
||||||
|

|
||||||
|
|
||||||
|
红框中圈出来的就是截取出来的内容。在 `conf/app.yml` 的配置项有两个:
|
||||||
|
```
|
||||||
|
# 自动截取预览, 字符数
|
||||||
|
length: 400
|
||||||
|
# 截取预览标识
|
||||||
|
identifier: <!--more-->
|
||||||
|
|
||||||
|
```
|
||||||
|
当程序不能检查到 identifier 的标识符时,会采用长度的方式进行截取。
|
||||||
|
|||||||
Generated
+10
-10
@@ -1,8 +1,8 @@
|
|||||||
hash: bd360fa297ed66950543990f9433cdcdf13c29dd99d9a01b49027e236b2cb9da
|
hash: bd360fa297ed66950543990f9433cdcdf13c29dd99d9a01b49027e236b2cb9da
|
||||||
updated: 2017-03-11T00:26:32.776134316+08:00
|
updated: 2017-06-14T20:34:29.429161691+08:00
|
||||||
imports:
|
imports:
|
||||||
- name: github.com/boj/redistore
|
- name: github.com/boj/redistore
|
||||||
version: 3f631e1df8711f449f7b1796f5b8b7716e4319d0
|
version: 4562487a4bee9a7c272b72bfaeda4917d0a47ab9
|
||||||
- name: github.com/eiblog/blackfriday
|
- name: github.com/eiblog/blackfriday
|
||||||
version: c0ec111761ae784fe31cc076f2fa0e2d2216d623
|
version: c0ec111761ae784fe31cc076f2fa0e2d2216d623
|
||||||
- name: github.com/eiblog/utils
|
- name: github.com/eiblog/utils
|
||||||
@@ -13,12 +13,12 @@ imports:
|
|||||||
- tmpl
|
- tmpl
|
||||||
- uuid
|
- uuid
|
||||||
- name: github.com/garyburd/redigo
|
- name: github.com/garyburd/redigo
|
||||||
version: 0d253a66e6e1349f4581d6d2b300ee434ee2da9f
|
version: 95d11dba2d44531bdb8022752b98912baafae03a
|
||||||
subpackages:
|
subpackages:
|
||||||
- internal
|
- internal
|
||||||
- redis
|
- redis
|
||||||
- name: github.com/gin-gonic/contrib
|
- name: github.com/gin-gonic/contrib
|
||||||
version: ffa12cf90b52a4af3ae604f6452e61f8218a517c
|
version: d4fc5a96cc0d29cb0e862bb1312dd6f4fedfcaee
|
||||||
subpackages:
|
subpackages:
|
||||||
- sessions
|
- sessions
|
||||||
- name: github.com/gin-gonic/gin
|
- name: github.com/gin-gonic/gin
|
||||||
@@ -35,19 +35,19 @@ imports:
|
|||||||
- name: github.com/gorilla/securecookie
|
- name: github.com/gorilla/securecookie
|
||||||
version: e59506cc896acb7f7bf732d4fdf5e25f7ccd8983
|
version: e59506cc896acb7f7bf732d4fdf5e25f7ccd8983
|
||||||
- name: github.com/gorilla/sessions
|
- name: github.com/gorilla/sessions
|
||||||
version: ba78acc856fe7c79891d516131b3d903cc8d9367
|
version: 8b6b4cd75f07f7ee036eb37b8127bd40ab1efc49
|
||||||
- name: github.com/manucorporat/sse
|
- name: github.com/manucorporat/sse
|
||||||
version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d
|
version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d
|
||||||
- name: github.com/mattn/go-isatty
|
- name: github.com/mattn/go-isatty
|
||||||
version: 57fdcb988a5c543893cc61bce354a6e24ab70022
|
version: fc9e8d8ef48496124e79ae0df75490096eccf6fe
|
||||||
- name: github.com/shurcooL/sanitized_anchor_name
|
- name: github.com/shurcooL/sanitized_anchor_name
|
||||||
version: 1dba4b3954bc059efc3991ec364f9f9a35f597d2
|
version: 541ff5ee47f1dddf6a5281af78307d921524bcb5
|
||||||
- name: golang.org/x/net
|
- name: golang.org/x/net
|
||||||
version: f315505cf3349909cdf013ea56690da34e96a451
|
version: f315505cf3349909cdf013ea56690da34e96a451
|
||||||
subpackages:
|
subpackages:
|
||||||
- context
|
- context
|
||||||
- name: golang.org/x/sys
|
- name: golang.org/x/sys
|
||||||
version: 99f16d856c9836c42d24e7ab64ea72916925fa97
|
version: 0b25a408a50076fbbcae6b7ac0ea5fbb0b085e79
|
||||||
subpackages:
|
subpackages:
|
||||||
- unix
|
- unix
|
||||||
- name: gopkg.in/go-playground/validator.v8
|
- name: gopkg.in/go-playground/validator.v8
|
||||||
@@ -60,9 +60,9 @@ imports:
|
|||||||
- internal/sasl
|
- internal/sasl
|
||||||
- internal/scram
|
- internal/scram
|
||||||
- name: gopkg.in/yaml.v2
|
- name: gopkg.in/yaml.v2
|
||||||
version: a3f3340b5840cee44f372bddb5880fcbc419b46a
|
version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b
|
||||||
- name: qiniupkg.com/api.v7
|
- name: qiniupkg.com/api.v7
|
||||||
version: 427efe34a76257db04b3b785e3b4d2fdb44cf9b9
|
version: 89344a711feec1d800c77a80d0865de936dc394d
|
||||||
subpackages:
|
subpackages:
|
||||||
- api
|
- api
|
||||||
- auth/qbox
|
- auth/qbox
|
||||||
|
|||||||
+26
-26
@@ -19,34 +19,34 @@ Available on [godoc.org](http://www.godoc.org/gopkg.in/boj/redistore.v1).
|
|||||||
See http://www.gorillatoolkit.org/pkg/sessions for full documentation on underlying interface.
|
See http://www.gorillatoolkit.org/pkg/sessions for full documentation on underlying interface.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
``` go
|
||||||
|
// Fetch new store.
|
||||||
|
store, err := NewRediStore(10, "tcp", ":6379", "", []byte("secret-key"))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
defer store.Close()
|
||||||
|
|
||||||
// Fetch new store.
|
// Get a session.
|
||||||
store, err := NewRediStore(10, "tcp", ":6379", "", []byte("secret-key"))
|
session, err = store.Get(req, "session-key")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
log.Error(err.Error())
|
||||||
}
|
}
|
||||||
defer store.Close()
|
|
||||||
|
|
||||||
// Get a session.
|
// Add a value.
|
||||||
session, err = store.Get(req, "session-key")
|
session.Values["foo"] = "bar"
|
||||||
if err != nil {
|
|
||||||
log.Error(err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add a value.
|
// Save.
|
||||||
session.Values["foo"] = "bar"
|
if err = sessions.Save(req, rsp); err != nil {
|
||||||
|
t.Fatalf("Error saving session: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Save.
|
// Delete session.
|
||||||
if err = sessions.Save(req, rsp); err != nil {
|
session.Options.MaxAge = -1
|
||||||
t.Fatalf("Error saving session: %v", err)
|
if err = sessions.Save(req, rsp); err != nil {
|
||||||
}
|
t.Fatalf("Error saving session: %v", err)
|
||||||
|
}
|
||||||
// Delete session.
|
|
||||||
session.Options.MaxAge = -1
|
|
||||||
if err = sessions.Save(req, rsp); err != nil {
|
|
||||||
t.Fatalf("Error saving session: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change session storage configuration for MaxAge = 10 days.
|
|
||||||
store.SetMaxAge(10*24*3600)
|
|
||||||
|
|
||||||
|
// Change session storage configuration for MaxAge = 10 days.
|
||||||
|
store.SetMaxAge(10 * 24 * 3600)
|
||||||
|
```
|
||||||
|
|||||||
+9
-1
@@ -181,7 +181,7 @@ func (p *Pool) Get() Conn {
|
|||||||
return &pooledConnection{p: p, c: c}
|
return &pooledConnection{p: p, c: c}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ActiveCount returns the number of active connections in the pool.
|
// ActiveCount returns the number of connections in the pool. The count includes idle connections and connections in use.
|
||||||
func (p *Pool) ActiveCount() int {
|
func (p *Pool) ActiveCount() int {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
active := p.active
|
active := p.active
|
||||||
@@ -189,6 +189,14 @@ func (p *Pool) ActiveCount() int {
|
|||||||
return active
|
return active
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IdleCount returns the number of idle connections in the pool.
|
||||||
|
func (p *Pool) IdleCount() int {
|
||||||
|
p.mu.Lock()
|
||||||
|
idle := p.idle.Len()
|
||||||
|
p.mu.Unlock()
|
||||||
|
return idle
|
||||||
|
}
|
||||||
|
|
||||||
// Close releases the resources used by the pool.
|
// Close releases the resources used by the pool.
|
||||||
func (p *Pool) Close() error {
|
func (p *Pool) Close() error {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
|
|||||||
+28
-24
@@ -83,7 +83,7 @@ func (d *poolDialer) dial() (redis.Conn, error) {
|
|||||||
return &poolTestConn{d: d, Conn: c}, nil
|
return &poolTestConn{d: d, Conn: c}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *poolDialer) check(message string, p *redis.Pool, dialed, open int) {
|
func (d *poolDialer) check(message string, p *redis.Pool, dialed, open, inuse int) {
|
||||||
d.mu.Lock()
|
d.mu.Lock()
|
||||||
if d.dialed != dialed {
|
if d.dialed != dialed {
|
||||||
d.t.Errorf("%s: dialed=%d, want %d", message, d.dialed, dialed)
|
d.t.Errorf("%s: dialed=%d, want %d", message, d.dialed, dialed)
|
||||||
@@ -91,9 +91,13 @@ func (d *poolDialer) check(message string, p *redis.Pool, dialed, open int) {
|
|||||||
if d.open != open {
|
if d.open != open {
|
||||||
d.t.Errorf("%s: open=%d, want %d", message, d.open, open)
|
d.t.Errorf("%s: open=%d, want %d", message, d.open, open)
|
||||||
}
|
}
|
||||||
|
|
||||||
if active := p.ActiveCount(); active != open {
|
if active := p.ActiveCount(); active != open {
|
||||||
d.t.Errorf("%s: active=%d, want %d", message, active, open)
|
d.t.Errorf("%s: active=%d, want %d", message, active, open)
|
||||||
}
|
}
|
||||||
|
if idle := p.IdleCount(); idle != open-inuse {
|
||||||
|
d.t.Errorf("%s: idle=%d, want %d", message, idle, open-inuse)
|
||||||
|
}
|
||||||
d.mu.Unlock()
|
d.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,9 +117,9 @@ func TestPoolReuse(t *testing.T) {
|
|||||||
c2.Close()
|
c2.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
d.check("before close", p, 2, 2)
|
d.check("before close", p, 2, 2, 0)
|
||||||
p.Close()
|
p.Close()
|
||||||
d.check("after close", p, 2, 0)
|
d.check("after close", p, 2, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolMaxIdle(t *testing.T) {
|
func TestPoolMaxIdle(t *testing.T) {
|
||||||
@@ -137,9 +141,9 @@ func TestPoolMaxIdle(t *testing.T) {
|
|||||||
c2.Close()
|
c2.Close()
|
||||||
c3.Close()
|
c3.Close()
|
||||||
}
|
}
|
||||||
d.check("before close", p, 12, 2)
|
d.check("before close", p, 12, 2, 0)
|
||||||
p.Close()
|
p.Close()
|
||||||
d.check("after close", p, 12, 0)
|
d.check("after close", p, 12, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolError(t *testing.T) {
|
func TestPoolError(t *testing.T) {
|
||||||
@@ -161,7 +165,7 @@ func TestPoolError(t *testing.T) {
|
|||||||
c.Do("ERR", io.EOF)
|
c.Do("ERR", io.EOF)
|
||||||
c.Close()
|
c.Close()
|
||||||
|
|
||||||
d.check(".", p, 2, 0)
|
d.check(".", p, 2, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolClose(t *testing.T) {
|
func TestPoolClose(t *testing.T) {
|
||||||
@@ -189,7 +193,7 @@ func TestPoolClose(t *testing.T) {
|
|||||||
|
|
||||||
p.Close()
|
p.Close()
|
||||||
|
|
||||||
d.check("after pool close", p, 3, 1)
|
d.check("after pool close", p, 3, 1, 1)
|
||||||
|
|
||||||
if _, err := c1.Do("PING"); err == nil {
|
if _, err := c1.Do("PING"); err == nil {
|
||||||
t.Errorf("expected error after connection and pool closed")
|
t.Errorf("expected error after connection and pool closed")
|
||||||
@@ -197,7 +201,7 @@ func TestPoolClose(t *testing.T) {
|
|||||||
|
|
||||||
c3.Close()
|
c3.Close()
|
||||||
|
|
||||||
d.check("after conn close", p, 3, 0)
|
d.check("after conn close", p, 3, 0, 0)
|
||||||
|
|
||||||
c1 = p.Get()
|
c1 = p.Get()
|
||||||
if _, err := c1.Do("PING"); err == nil {
|
if _, err := c1.Do("PING"); err == nil {
|
||||||
@@ -222,7 +226,7 @@ func TestPoolTimeout(t *testing.T) {
|
|||||||
c.Do("PING")
|
c.Do("PING")
|
||||||
c.Close()
|
c.Close()
|
||||||
|
|
||||||
d.check("1", p, 1, 1)
|
d.check("1", p, 1, 1, 0)
|
||||||
|
|
||||||
now = now.Add(p.IdleTimeout)
|
now = now.Add(p.IdleTimeout)
|
||||||
|
|
||||||
@@ -230,7 +234,7 @@ func TestPoolTimeout(t *testing.T) {
|
|||||||
c.Do("PING")
|
c.Do("PING")
|
||||||
c.Close()
|
c.Close()
|
||||||
|
|
||||||
d.check("2", p, 2, 1)
|
d.check("2", p, 2, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolConcurrenSendReceive(t *testing.T) {
|
func TestPoolConcurrenSendReceive(t *testing.T) {
|
||||||
@@ -272,7 +276,7 @@ func TestPoolBorrowCheck(t *testing.T) {
|
|||||||
c.Do("PING")
|
c.Do("PING")
|
||||||
c.Close()
|
c.Close()
|
||||||
}
|
}
|
||||||
d.check("1", p, 10, 1)
|
d.check("1", p, 10, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolMaxActive(t *testing.T) {
|
func TestPoolMaxActive(t *testing.T) {
|
||||||
@@ -289,7 +293,7 @@ func TestPoolMaxActive(t *testing.T) {
|
|||||||
c2 := p.Get()
|
c2 := p.Get()
|
||||||
c2.Do("PING")
|
c2.Do("PING")
|
||||||
|
|
||||||
d.check("1", p, 2, 2)
|
d.check("1", p, 2, 2, 2)
|
||||||
|
|
||||||
c3 := p.Get()
|
c3 := p.Get()
|
||||||
if _, err := c3.Do("PING"); err != redis.ErrPoolExhausted {
|
if _, err := c3.Do("PING"); err != redis.ErrPoolExhausted {
|
||||||
@@ -297,9 +301,9 @@ func TestPoolMaxActive(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c3.Close()
|
c3.Close()
|
||||||
d.check("2", p, 2, 2)
|
d.check("2", p, 2, 2, 2)
|
||||||
c2.Close()
|
c2.Close()
|
||||||
d.check("3", p, 2, 2)
|
d.check("3", p, 2, 2, 1)
|
||||||
|
|
||||||
c3 = p.Get()
|
c3 = p.Get()
|
||||||
if _, err := c3.Do("PING"); err != nil {
|
if _, err := c3.Do("PING"); err != nil {
|
||||||
@@ -307,7 +311,7 @@ func TestPoolMaxActive(t *testing.T) {
|
|||||||
}
|
}
|
||||||
c3.Close()
|
c3.Close()
|
||||||
|
|
||||||
d.check("4", p, 2, 2)
|
d.check("4", p, 2, 2, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolMonitorCleanup(t *testing.T) {
|
func TestPoolMonitorCleanup(t *testing.T) {
|
||||||
@@ -323,7 +327,7 @@ func TestPoolMonitorCleanup(t *testing.T) {
|
|||||||
c.Send("MONITOR")
|
c.Send("MONITOR")
|
||||||
c.Close()
|
c.Close()
|
||||||
|
|
||||||
d.check("", p, 1, 0)
|
d.check("", p, 1, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolPubSubCleanup(t *testing.T) {
|
func TestPoolPubSubCleanup(t *testing.T) {
|
||||||
@@ -456,7 +460,7 @@ func TestWaitPool(t *testing.T) {
|
|||||||
|
|
||||||
c := p.Get()
|
c := p.Get()
|
||||||
errs := startGoroutines(p, "PING")
|
errs := startGoroutines(p, "PING")
|
||||||
d.check("before close", p, 1, 1)
|
d.check("before close", p, 1, 1, 1)
|
||||||
c.Close()
|
c.Close()
|
||||||
timeout := time.After(2 * time.Second)
|
timeout := time.After(2 * time.Second)
|
||||||
for i := 0; i < cap(errs); i++ {
|
for i := 0; i < cap(errs); i++ {
|
||||||
@@ -469,7 +473,7 @@ func TestWaitPool(t *testing.T) {
|
|||||||
t.Fatalf("timeout waiting for blocked goroutine %d", i)
|
t.Fatalf("timeout waiting for blocked goroutine %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.check("done", p, 1, 1)
|
d.check("done", p, 1, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWaitPoolClose(t *testing.T) {
|
func TestWaitPoolClose(t *testing.T) {
|
||||||
@@ -487,7 +491,7 @@ func TestWaitPoolClose(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
errs := startGoroutines(p, "PING")
|
errs := startGoroutines(p, "PING")
|
||||||
d.check("before close", p, 1, 1)
|
d.check("before close", p, 1, 1, 1)
|
||||||
p.Close()
|
p.Close()
|
||||||
timeout := time.After(2 * time.Second)
|
timeout := time.After(2 * time.Second)
|
||||||
for i := 0; i < cap(errs); i++ {
|
for i := 0; i < cap(errs); i++ {
|
||||||
@@ -504,7 +508,7 @@ func TestWaitPoolClose(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.Close()
|
c.Close()
|
||||||
d.check("done", p, 1, 0)
|
d.check("done", p, 1, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWaitPoolCommandError(t *testing.T) {
|
func TestWaitPoolCommandError(t *testing.T) {
|
||||||
@@ -520,7 +524,7 @@ func TestWaitPoolCommandError(t *testing.T) {
|
|||||||
|
|
||||||
c := p.Get()
|
c := p.Get()
|
||||||
errs := startGoroutines(p, "ERR", testErr)
|
errs := startGoroutines(p, "ERR", testErr)
|
||||||
d.check("before close", p, 1, 1)
|
d.check("before close", p, 1, 1, 1)
|
||||||
c.Close()
|
c.Close()
|
||||||
timeout := time.After(2 * time.Second)
|
timeout := time.After(2 * time.Second)
|
||||||
for i := 0; i < cap(errs); i++ {
|
for i := 0; i < cap(errs); i++ {
|
||||||
@@ -533,7 +537,7 @@ func TestWaitPoolCommandError(t *testing.T) {
|
|||||||
t.Fatalf("timeout waiting for blocked goroutine %d", i)
|
t.Fatalf("timeout waiting for blocked goroutine %d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.check("done", p, cap(errs), 0)
|
d.check("done", p, cap(errs), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWaitPoolDialError(t *testing.T) {
|
func TestWaitPoolDialError(t *testing.T) {
|
||||||
@@ -549,7 +553,7 @@ func TestWaitPoolDialError(t *testing.T) {
|
|||||||
|
|
||||||
c := p.Get()
|
c := p.Get()
|
||||||
errs := startGoroutines(p, "ERR", testErr)
|
errs := startGoroutines(p, "ERR", testErr)
|
||||||
d.check("before close", p, 1, 1)
|
d.check("before close", p, 1, 1, 1)
|
||||||
|
|
||||||
d.dialErr = errors.New("dial")
|
d.dialErr = errors.New("dial")
|
||||||
c.Close()
|
c.Close()
|
||||||
@@ -578,7 +582,7 @@ func TestWaitPoolDialError(t *testing.T) {
|
|||||||
if errCount != cap(errs)-1 {
|
if errCount != cap(errs)-1 {
|
||||||
t.Errorf("expected %d dial errors, got %d", cap(errs)-1, errCount)
|
t.Errorf("expected %d dial errors, got %d", cap(errs)-1, errCount)
|
||||||
}
|
}
|
||||||
d.check("done", p, cap(errs), 0)
|
d.check("done", p, cap(errs), 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Borrowing requires us to iterate over the idle connections, unlock the pool,
|
// Borrowing requires us to iterate over the idle connections, unlock the pool,
|
||||||
|
|||||||
+32
@@ -391,3 +391,35 @@ func Int64Map(result interface{}, err error) (map[string]int64, error) {
|
|||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Positions is a helper that converts an array of positions (lat, long)
|
||||||
|
// into a [][2]float64. The GEOPOS command returns replies in this format.
|
||||||
|
func Positions(result interface{}, err error) ([]*[2]float64, error) {
|
||||||
|
values, err := Values(result, err)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
positions := make([]*[2]float64, len(values))
|
||||||
|
for i := range values {
|
||||||
|
if values[i] == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
p, ok := values[i].([]interface{})
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("redigo: unexpected element type for interface slice, got type %T", values[i])
|
||||||
|
}
|
||||||
|
if len(p) != 2 {
|
||||||
|
return nil, fmt.Errorf("redigo: unexpected number of values for a member position, got %d", len(p))
|
||||||
|
}
|
||||||
|
lat, err := Float64(p[0], nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
long, err := Float64(p[1], nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
positions[i] = &[2]float64{lat, long}
|
||||||
|
}
|
||||||
|
return positions, nil
|
||||||
|
}
|
||||||
|
|||||||
+5
@@ -96,6 +96,11 @@ var replyTests = []struct {
|
|||||||
ve(redis.Uint64(int64(-1), nil)),
|
ve(redis.Uint64(int64(-1), nil)),
|
||||||
ve(uint64(0), redis.ErrNegativeInt),
|
ve(uint64(0), redis.ErrNegativeInt),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"positions([[1, 2], nil, [3, 4]])",
|
||||||
|
ve(redis.Positions([]interface{}{[]interface{}{[]byte("1"), []byte("2")}, nil, []interface{}{[]byte("3"), []byte("4")}}, nil)),
|
||||||
|
ve([]*[2]float64{{1.0, 2.0}, nil, {3.0, 4.0}}, nil),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestReply(t *testing.T) {
|
func TestReply(t *testing.T) {
|
||||||
|
|||||||
+5
-1
@@ -186,7 +186,11 @@ func convertAssign(d interface{}, s interface{}) (err error) {
|
|||||||
case string:
|
case string:
|
||||||
switch d := d.(type) {
|
switch d := d.(type) {
|
||||||
case *string:
|
case *string:
|
||||||
*d = string(s)
|
*d = s
|
||||||
|
case *interface{}:
|
||||||
|
*d = s
|
||||||
|
case nil:
|
||||||
|
// skip value
|
||||||
default:
|
default:
|
||||||
err = cannotConvert(reflect.ValueOf(d), s)
|
err = cannotConvert(reflect.ValueOf(d), s)
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -55,6 +55,11 @@ func (s *Script) args(spec string, keysAndArgs []interface{}) []interface{} {
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hash returns the script hash.
|
||||||
|
func (s *Script) Hash() string {
|
||||||
|
return s.hash
|
||||||
|
}
|
||||||
|
|
||||||
// Do evaluates the script. Under the covers, Do optimistically evaluates the
|
// Do evaluates the script. Under the covers, Do optimistically evaluates the
|
||||||
// script using the EVALSHA command. If the command fails because the script is
|
// script using the EVALSHA command. If the command fails because the script is
|
||||||
// not loaded, then Do evaluates the script using the EVAL command (thus
|
// not loaded, then Do evaluates the script using the EVAL command (thus
|
||||||
|
|||||||
+1
@@ -16,6 +16,7 @@ package redis_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/garyburd/redigo/redis"
|
"github.com/garyburd/redigo/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -1,9 +1,8 @@
|
|||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.4.3
|
- 1.6.x
|
||||||
- 1.5.4
|
- 1.7.x
|
||||||
- 1.6.4
|
- 1.8.x
|
||||||
- 1.7.4
|
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|||||||
+1
-2
@@ -29,8 +29,7 @@ Let's start with an example that shows the sessions API in a nutshell:
|
|||||||
var store = sessions.NewCookieStore([]byte("something-very-secret"))
|
var store = sessions.NewCookieStore([]byte("something-very-secret"))
|
||||||
|
|
||||||
func MyHandler(w http.ResponseWriter, r *http.Request) {
|
func MyHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
// Get a session. We're ignoring the error resulted from decoding an
|
// Get a session. Get() always returns a session, even if empty.
|
||||||
// existing session: Get() always returns a session, even if empty.
|
|
||||||
session, err := store.Get(r, "session-name")
|
session, err := store.Get(r, "session-name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
Generated
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package isatty_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func Example() {
|
||||||
if isatty.IsTerminal(os.Stdout.Fd()) {
|
if isatty.IsTerminal(os.Stdout.Fd()) {
|
||||||
fmt.Println("Is Terminal")
|
fmt.Println("Is Terminal")
|
||||||
} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
|
} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
|
||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.7
|
- 1.x
|
||||||
- tip
|
- master
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: tip
|
- go: master
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
install:
|
install:
|
||||||
- # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
|
- # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
|
||||||
|
|||||||
+6
-4
@@ -1,3 +1,5 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2015 Dmitri Shuralyov
|
Copyright (c) 2015 Dmitri Shuralyov
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in all
|
||||||
all copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
THE SOFTWARE.
|
SOFTWARE.
|
||||||
|
|||||||
+4
-2
@@ -5,9 +5,11 @@ sanitized_anchor_name
|
|||||||
|
|
||||||
Package sanitized_anchor_name provides a func to create sanitized anchor names.
|
Package sanitized_anchor_name provides a func to create sanitized anchor names.
|
||||||
|
|
||||||
Its logic can be reused by multiple packages to create interoperable anchor names and links to those anchors.
|
Its logic can be reused by multiple packages to create interoperable anchor names
|
||||||
|
and links to those anchors.
|
||||||
|
|
||||||
At this time, it does not try to ensure that generated anchor names are unique, that responsibility falls on the caller.
|
At this time, it does not try to ensure that generated anchor names
|
||||||
|
are unique, that responsibility falls on the caller.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|||||||
+173
@@ -0,0 +1,173 @@
|
|||||||
|
# Building `sys/unix`
|
||||||
|
|
||||||
|
The sys/unix package provides access to the raw system call interface of the
|
||||||
|
underlying operating system. See: https://godoc.org/golang.org/x/sys/unix
|
||||||
|
|
||||||
|
Porting Go to a new architecture/OS combination or adding syscalls, types, or
|
||||||
|
constants to an existing architecture/OS pair requires some manual effort;
|
||||||
|
however, there are tools that automate much of the process.
|
||||||
|
|
||||||
|
## Build Systems
|
||||||
|
|
||||||
|
There are currently two ways we generate the necessary files. We are currently
|
||||||
|
migrating the build system to use containers so the builds are reproducible.
|
||||||
|
This is being done on an OS-by-OS basis. Please update this documentation as
|
||||||
|
components of the build system change.
|
||||||
|
|
||||||
|
### Old Build System (currently for `GOOS != "Linux" || GOARCH == "sparc64"`)
|
||||||
|
|
||||||
|
The old build system generates the Go files based on the C header files
|
||||||
|
present on your system. This means that files
|
||||||
|
for a given GOOS/GOARCH pair must be generated on a system with that OS and
|
||||||
|
architecture. This also means that the generated code can differ from system
|
||||||
|
to system, based on differences in the header files.
|
||||||
|
|
||||||
|
To avoid this, if you are using the old build system, only generate the Go
|
||||||
|
files on an installation with unmodified header files. It is also important to
|
||||||
|
keep track of which version of the OS the files were generated from (ex.
|
||||||
|
Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes
|
||||||
|
and have each OS upgrade correspond to a single change.
|
||||||
|
|
||||||
|
To build the files for your current OS and architecture, make sure GOOS and
|
||||||
|
GOARCH are set correctly and run `mkall.sh`. This will generate the files for
|
||||||
|
your specific system. Running `mkall.sh -n` shows the commands that will be run.
|
||||||
|
|
||||||
|
Requirements: bash, perl, go
|
||||||
|
|
||||||
|
### New Build System (currently for `GOOS == "Linux" && GOARCH != "sparc64"`)
|
||||||
|
|
||||||
|
The new build system uses a Docker container to generate the go files directly
|
||||||
|
from source checkouts of the kernel and various system libraries. This means
|
||||||
|
that on any platform that supports Docker, all the files using the new build
|
||||||
|
system can be generated at once, and generated files will not change based on
|
||||||
|
what the person running the scripts has installed on their computer.
|
||||||
|
|
||||||
|
The OS specific files for the new build system are located in the `${GOOS}`
|
||||||
|
directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When
|
||||||
|
the kernel or system library updates, modify the Dockerfile at
|
||||||
|
`${GOOS}/Dockerfile` to checkout the new release of the source.
|
||||||
|
|
||||||
|
To build all the files under the new build system, you must be on an amd64/Linux
|
||||||
|
system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will
|
||||||
|
then generate all of the files for all of the GOOS/GOARCH pairs in the new build
|
||||||
|
system. Running `mkall.sh -n` shows the commands that will be run.
|
||||||
|
|
||||||
|
Requirements: bash, perl, go, docker
|
||||||
|
|
||||||
|
## Component files
|
||||||
|
|
||||||
|
This section describes the various files used in the code generation process.
|
||||||
|
It also contains instructions on how to modify these files to add a new
|
||||||
|
architecture/OS or to add additional syscalls, types, or constants. Note that
|
||||||
|
if you are using the new build system, the scripts cannot be called normally.
|
||||||
|
They must be called from within the docker container.
|
||||||
|
|
||||||
|
### asm files
|
||||||
|
|
||||||
|
The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system
|
||||||
|
call dispatch. There are three entry points:
|
||||||
|
```
|
||||||
|
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
|
||||||
|
func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
|
||||||
|
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
|
||||||
|
```
|
||||||
|
The first and second are the standard ones; they differ only in how many
|
||||||
|
arguments can be passed to the kernel. The third is for low-level use by the
|
||||||
|
ForkExec wrapper. Unlike the first two, it does not call into the scheduler to
|
||||||
|
let it know that a system call is running.
|
||||||
|
|
||||||
|
When porting Go to an new architecture/OS, this file must be implemented for
|
||||||
|
each GOOS/GOARCH pair.
|
||||||
|
|
||||||
|
### mksysnum
|
||||||
|
|
||||||
|
Mksysnum is a script located at `${GOOS}/mksysnum.pl` (or `mksysnum_${GOOS}.pl`
|
||||||
|
for the old system). This script takes in a list of header files containing the
|
||||||
|
syscall number declarations and parses them to produce the corresponding list of
|
||||||
|
Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated
|
||||||
|
constants.
|
||||||
|
|
||||||
|
Adding new syscall numbers is mostly done by running the build on a sufficiently
|
||||||
|
new installation of the target OS (or updating the source checkouts for the
|
||||||
|
new build system). However, depending on the OS, you make need to update the
|
||||||
|
parsing in mksysnum.
|
||||||
|
|
||||||
|
### mksyscall.pl
|
||||||
|
|
||||||
|
The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are
|
||||||
|
hand-written Go files which implement system calls (for unix, the specific OS,
|
||||||
|
or the specific OS/Architecture pair respectively) that need special handling
|
||||||
|
and list `//sys` comments giving prototypes for ones that can be generated.
|
||||||
|
|
||||||
|
The mksyscall.pl script takes the `//sys` and `//sysnb` comments and converts
|
||||||
|
them into syscalls. This requires the name of the prototype in the comment to
|
||||||
|
match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function
|
||||||
|
prototype can be exported (capitalized) or not.
|
||||||
|
|
||||||
|
Adding a new syscall often just requires adding a new `//sys` function prototype
|
||||||
|
with the desired arguments and a capitalized name so it is exported. However, if
|
||||||
|
you want the interface to the syscall to be different, often one will make an
|
||||||
|
unexported `//sys` prototype, an then write a custom wrapper in
|
||||||
|
`syscall_${GOOS}.go`.
|
||||||
|
|
||||||
|
### types files
|
||||||
|
|
||||||
|
For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or
|
||||||
|
`types_${GOOS}.go` on the old system). This file includes standard C headers and
|
||||||
|
creates Go type aliases to the corresponding C types. The file is then fed
|
||||||
|
through godef to get the Go compatible definitions. Finally, the generated code
|
||||||
|
is fed though mkpost.go to format the code correctly and remove any hidden or
|
||||||
|
private identifiers. This cleaned-up code is written to
|
||||||
|
`ztypes_${GOOS}_${GOARCH}.go`.
|
||||||
|
|
||||||
|
The hardest part about preparing this file is figuring out which headers to
|
||||||
|
include and which symbols need to be `#define`d to get the actual data
|
||||||
|
structures that pass through to the kernel system calls. Some C libraries
|
||||||
|
preset alternate versions for binary compatibility and translate them on the
|
||||||
|
way in and out of system calls, but there is almost always a `#define` that can
|
||||||
|
get the real ones.
|
||||||
|
See `types_darwin.go` and `linux/types.go` for examples.
|
||||||
|
|
||||||
|
To add a new type, add in the necessary include statement at the top of the
|
||||||
|
file (if it is not already there) and add in a type alias line. Note that if
|
||||||
|
your type is significantly different on different architectures, you may need
|
||||||
|
some `#if/#elif` macros in your include statements.
|
||||||
|
|
||||||
|
### mkerrors.sh
|
||||||
|
|
||||||
|
This script is used to generate the system's various constants. This doesn't
|
||||||
|
just include the error numbers and error strings, but also the signal numbers
|
||||||
|
an a wide variety of miscellaneous constants. The constants come from the list
|
||||||
|
of include files in the `includes_${uname}` variable. A regex then picks out
|
||||||
|
the desired `#define` statements, and generates the corresponding Go constants.
|
||||||
|
The error numbers and strings are generated from `#include <errno.h>`, and the
|
||||||
|
signal numbers and strings are generated from `#include <signal.h>`. All of
|
||||||
|
these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program,
|
||||||
|
`_errors.c`, which prints out all the constants.
|
||||||
|
|
||||||
|
To add a constant, add the header that includes it to the appropriate variable.
|
||||||
|
Then, edit the regex (if necessary) to match the desired constant. Avoid making
|
||||||
|
the regex too broad to avoid matching unintended constants.
|
||||||
|
|
||||||
|
|
||||||
|
## Generated files
|
||||||
|
|
||||||
|
### `zerror_${GOOS}_${GOARCH}.go`
|
||||||
|
|
||||||
|
A file containing all of the system's generated error numbers, error strings,
|
||||||
|
signal numbers, and constants. Generated by `mkerrors.sh` (see above).
|
||||||
|
|
||||||
|
### `zsyscall_${GOOS}_${GOARCH}.go`
|
||||||
|
|
||||||
|
A file containing all the generated syscalls for a specific GOOS and GOARCH.
|
||||||
|
Generated by `mksyscall.pl` (see above).
|
||||||
|
|
||||||
|
### `zsysnum_${GOOS}_${GOARCH}.go`
|
||||||
|
|
||||||
|
A list of numeric constants for all the syscall number of the specific GOOS
|
||||||
|
and GOARCH. Generated by mksysnum (see above).
|
||||||
|
|
||||||
|
### `ztypes_${GOOS}_${GOARCH}.go`
|
||||||
|
|
||||||
|
A file containing Go types for passing into (or returning from) syscalls.
|
||||||
|
Generated by godefs and the types file (see above).
|
||||||
+2
-2
@@ -10,8 +10,8 @@
|
|||||||
// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
|
// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
|
||||||
//
|
//
|
||||||
|
|
||||||
TEXT ·sysvicall6(SB),NOSPLIT,$0-64
|
TEXT ·sysvicall6(SB),NOSPLIT,$0-88
|
||||||
JMP syscall·sysvicall6(SB)
|
JMP syscall·sysvicall6(SB)
|
||||||
|
|
||||||
TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64
|
TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
|
||||||
JMP syscall·rawSysvicall6(SB)
|
JMP syscall·rawSysvicall6(SB)
|
||||||
|
|||||||
+102
@@ -0,0 +1,102 @@
|
|||||||
|
// Copyright 2009 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.
|
||||||
|
|
||||||
|
// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// readInt returns the size-bytes unsigned integer in native byte order at offset off.
|
||||||
|
func readInt(b []byte, off, size uintptr) (u uint64, ok bool) {
|
||||||
|
if len(b) < int(off+size) {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
if isBigEndian {
|
||||||
|
return readIntBE(b[off:], size), true
|
||||||
|
}
|
||||||
|
return readIntLE(b[off:], size), true
|
||||||
|
}
|
||||||
|
|
||||||
|
func readIntBE(b []byte, size uintptr) uint64 {
|
||||||
|
switch size {
|
||||||
|
case 1:
|
||||||
|
return uint64(b[0])
|
||||||
|
case 2:
|
||||||
|
_ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[1]) | uint64(b[0])<<8
|
||||||
|
case 4:
|
||||||
|
_ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[3]) | uint64(b[2])<<8 | uint64(b[1])<<16 | uint64(b[0])<<24
|
||||||
|
case 8:
|
||||||
|
_ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
|
||||||
|
uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
|
||||||
|
default:
|
||||||
|
panic("syscall: readInt with unsupported size")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func readIntLE(b []byte, size uintptr) uint64 {
|
||||||
|
switch size {
|
||||||
|
case 1:
|
||||||
|
return uint64(b[0])
|
||||||
|
case 2:
|
||||||
|
_ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[0]) | uint64(b[1])<<8
|
||||||
|
case 4:
|
||||||
|
_ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24
|
||||||
|
case 8:
|
||||||
|
_ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
|
||||||
|
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
|
||||||
|
uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
|
||||||
|
default:
|
||||||
|
panic("syscall: readInt with unsupported size")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseDirent parses up to max directory entries in buf,
|
||||||
|
// appending the names to names. It returns the number of
|
||||||
|
// bytes consumed from buf, the number of entries added
|
||||||
|
// to names, and the new names slice.
|
||||||
|
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
||||||
|
origlen := len(buf)
|
||||||
|
count = 0
|
||||||
|
for max != 0 && len(buf) > 0 {
|
||||||
|
reclen, ok := direntReclen(buf)
|
||||||
|
if !ok || reclen > uint64(len(buf)) {
|
||||||
|
return origlen, count, names
|
||||||
|
}
|
||||||
|
rec := buf[:reclen]
|
||||||
|
buf = buf[reclen:]
|
||||||
|
ino, ok := direntIno(rec)
|
||||||
|
if !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if ino == 0 { // File absent in directory.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const namoff = uint64(unsafe.Offsetof(Dirent{}.Name))
|
||||||
|
namlen, ok := direntNamlen(rec)
|
||||||
|
if !ok || namoff+namlen > uint64(len(rec)) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
name := rec[namoff : namoff+namlen]
|
||||||
|
for i, c := range name {
|
||||||
|
if c == 0 {
|
||||||
|
name = name[:i]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Check for useless names before allocating a string.
|
||||||
|
if string(name) == "." || string(name) == ".." {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
max--
|
||||||
|
count++
|
||||||
|
names = append(names, string(name))
|
||||||
|
}
|
||||||
|
return origlen - len(buf), count, names
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// Copyright 2016 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.
|
||||||
|
//
|
||||||
|
// +build ppc64 s390x mips mips64
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const isBigEndian = true
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// Copyright 2016 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.
|
||||||
|
//
|
||||||
|
// +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const isBigEndian = false
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
FROM ubuntu:16.04
|
||||||
|
|
||||||
|
# Dependencies to get the git sources and go binaries
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Get the git sources. If not cached, this takes O(5 minutes).
|
||||||
|
WORKDIR /git
|
||||||
|
RUN git config --global advice.detachedHead false
|
||||||
|
# Linux Kernel: Released 19 Feb 2017
|
||||||
|
RUN git clone --branch v4.10 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
|
||||||
|
# GNU C library: Released 05 Feb 2017 (we should try to get a secure way to clone this)
|
||||||
|
RUN git clone --branch glibc-2.25 --depth 1 git://sourceware.org/git/glibc.git
|
||||||
|
|
||||||
|
# Get Go 1.8 (https://github.com/docker-library/golang/blob/master/1.8/Dockerfile)
|
||||||
|
ENV GOLANG_VERSION 1.8
|
||||||
|
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
|
||||||
|
ENV GOLANG_DOWNLOAD_SHA256 53ab94104ee3923e228a2cb2116e5e462ad3ebaeea06ff04463479d7f12d27ca
|
||||||
|
|
||||||
|
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
|
||||||
|
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
|
||||||
|
&& tar -C /usr/local -xzf golang.tar.gz \
|
||||||
|
&& rm golang.tar.gz
|
||||||
|
|
||||||
|
ENV PATH /usr/local/go/bin:$PATH
|
||||||
|
|
||||||
|
# Linux and Glibc build dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
gawk make python \
|
||||||
|
gcc gcc-multilib \
|
||||||
|
gettext texinfo \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
# Emulator and cross compilers
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
qemu \
|
||||||
|
gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
|
||||||
|
gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
|
||||||
|
gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
|
||||||
|
gcc-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
|
||||||
|
gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Let the scripts know they are in the docker environment
|
||||||
|
ENV GOLANG_SYS_BUILD docker
|
||||||
|
WORKDIR /build
|
||||||
|
ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]
|
||||||
+379
@@ -0,0 +1,379 @@
|
|||||||
|
// Copyright 2017 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.
|
||||||
|
|
||||||
|
// linux/mkall.go - Generates all Linux zsysnum, zsyscall, zerror, and ztype
|
||||||
|
// files for all 11 linux architectures supported by the go compiler. See
|
||||||
|
// README.md for more information about the build system.
|
||||||
|
|
||||||
|
// To run it you must have a git checkout of the Linux kernel and glibc. Once
|
||||||
|
// the appropriate sources are ready, the program is run as:
|
||||||
|
// go run linux/mkall.go <linux_dir> <glibc_dir>
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// These will be paths to the appropriate source directories.
|
||||||
|
var LinuxDir string
|
||||||
|
var GlibcDir string
|
||||||
|
|
||||||
|
const TempDir = "/tmp"
|
||||||
|
const IncludeDir = TempDir + "/include" // To hold our C headers
|
||||||
|
const BuildDir = TempDir + "/build" // To hold intermediate build files
|
||||||
|
|
||||||
|
const GOOS = "linux" // Only for Linux targets
|
||||||
|
const BuildArch = "amd64" // Must be built on this architecture
|
||||||
|
const MinKernel = "2.6.23" // https://golang.org/doc/install#requirements
|
||||||
|
|
||||||
|
type target struct {
|
||||||
|
GoArch string // Architecture name according to Go
|
||||||
|
LinuxArch string // Architecture name according to the Linux Kernel
|
||||||
|
GNUArch string // Architecture name according to GNU tools (https://wiki.debian.org/Multiarch/Tuples)
|
||||||
|
BigEndian bool // Default Little Endian
|
||||||
|
SignedChar bool // Is -fsigned-char needed (default no)
|
||||||
|
Bits int
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of the 11 Linux targets supported by the go compiler. sparc64 is not
|
||||||
|
// currently supported, though a port is in progress.
|
||||||
|
var targets = []target{
|
||||||
|
{
|
||||||
|
GoArch: "386",
|
||||||
|
LinuxArch: "x86",
|
||||||
|
GNUArch: "i686-linux-gnu", // Note "i686" not "i386"
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "amd64",
|
||||||
|
LinuxArch: "x86",
|
||||||
|
GNUArch: "x86_64-linux-gnu",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "arm64",
|
||||||
|
LinuxArch: "arm64",
|
||||||
|
GNUArch: "aarch64-linux-gnu",
|
||||||
|
SignedChar: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "arm",
|
||||||
|
LinuxArch: "arm",
|
||||||
|
GNUArch: "arm-linux-gnueabi",
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mipsle",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mipsel-linux-gnu",
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips64",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips64-linux-gnuabi64",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips64le",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips64el-linux-gnuabi64",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "ppc64",
|
||||||
|
LinuxArch: "powerpc",
|
||||||
|
GNUArch: "powerpc64-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "ppc64le",
|
||||||
|
LinuxArch: "powerpc",
|
||||||
|
GNUArch: "powerpc64le-linux-gnu",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "s390x",
|
||||||
|
LinuxArch: "s390",
|
||||||
|
GNUArch: "s390x-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
SignedChar: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// GoArch: "sparc64",
|
||||||
|
// LinuxArch: "sparc",
|
||||||
|
// GNUArch: "sparc64-linux-gnu",
|
||||||
|
// BigEndian: true,
|
||||||
|
// Bits: 64,
|
||||||
|
// },
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if runtime.GOOS != GOOS || runtime.GOARCH != BuildArch {
|
||||||
|
fmt.Printf("Build system has GOOS_GOARCH = %s_%s, need %s_%s\n",
|
||||||
|
runtime.GOOS, runtime.GOARCH, GOOS, BuildArch)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that we are using the new build system if we should
|
||||||
|
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
|
||||||
|
fmt.Println("In the new build system, mkall.go should not be called directly.")
|
||||||
|
fmt.Println("See README.md")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the command line options
|
||||||
|
if len(os.Args) != 3 {
|
||||||
|
fmt.Println("USAGE: go run linux/mkall.go <linux_dir> <glibc_dir>")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
LinuxDir = os.Args[1]
|
||||||
|
GlibcDir = os.Args[2]
|
||||||
|
|
||||||
|
for _, t := range targets {
|
||||||
|
fmt.Printf("----- GENERATING: %s -----\n", t.GoArch)
|
||||||
|
if err := t.generateFiles(); err != nil {
|
||||||
|
fmt.Printf("%v\n***** FAILURE: %s *****\n\n", err, t.GoArch)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("----- SUCCESS: %s -----\n\n", t.GoArch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Makes an exec.Cmd with Stderr attached to os.Stderr
|
||||||
|
func makeCommand(name string, args ...string) *exec.Cmd {
|
||||||
|
cmd := exec.Command(name, args...)
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Runs the command, pipes output to a formatter, pipes that to an output file.
|
||||||
|
func (t *target) commandFormatOutput(formatter string, outputFile string,
|
||||||
|
name string, args ...string) (err error) {
|
||||||
|
mainCmd := makeCommand(name, args...)
|
||||||
|
|
||||||
|
fmtCmd := makeCommand(formatter)
|
||||||
|
if formatter == "mkpost" {
|
||||||
|
fmtCmd = makeCommand("go", "run", "mkpost.go")
|
||||||
|
// Set GOARCH_TARGET so mkpost knows what GOARCH is..
|
||||||
|
fmtCmd.Env = append(os.Environ(), "GOARCH_TARGET="+t.GoArch)
|
||||||
|
// Set GOARCH to host arch for mkpost, so it can run natively.
|
||||||
|
for i, s := range fmtCmd.Env {
|
||||||
|
if strings.HasPrefix(s, "GOARCH=") {
|
||||||
|
fmtCmd.Env[i] = "GOARCH=" + BuildArch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// mainCmd | fmtCmd > outputFile
|
||||||
|
if fmtCmd.Stdin, err = mainCmd.StdoutPipe(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if fmtCmd.Stdout, err = os.Create(outputFile); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure the formatter eventually closes
|
||||||
|
if err = fmtCmd.Start(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
fmtErr := fmtCmd.Wait()
|
||||||
|
if err == nil {
|
||||||
|
err = fmtErr
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
return mainCmd.Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates all the files for a Linux target
|
||||||
|
func (t *target) generateFiles() error {
|
||||||
|
// Setup environment variables
|
||||||
|
os.Setenv("GOOS", GOOS)
|
||||||
|
os.Setenv("GOARCH", t.GoArch)
|
||||||
|
|
||||||
|
// Get appropriate compiler and emulator (unless on x86)
|
||||||
|
if t.LinuxArch != "x86" {
|
||||||
|
// Check/Setup cross compiler
|
||||||
|
compiler := t.GNUArch + "-gcc"
|
||||||
|
if _, err := exec.LookPath(compiler); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
os.Setenv("CC", compiler)
|
||||||
|
|
||||||
|
// Check/Setup emulator (usually first component of GNUArch)
|
||||||
|
qemuArchName := t.GNUArch[:strings.Index(t.GNUArch, "-")]
|
||||||
|
if t.LinuxArch == "powerpc" {
|
||||||
|
qemuArchName = t.GoArch
|
||||||
|
}
|
||||||
|
os.Setenv("GORUN", "qemu-"+qemuArchName)
|
||||||
|
} else {
|
||||||
|
os.Setenv("CC", "gcc")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make the include directory and fill it with headers
|
||||||
|
if err := os.MkdirAll(IncludeDir, os.ModePerm); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(IncludeDir)
|
||||||
|
if err := t.makeHeaders(); err != nil {
|
||||||
|
return fmt.Errorf("could not make header files: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("header files generated")
|
||||||
|
|
||||||
|
// Make each of the four files
|
||||||
|
if err := t.makeZSysnumFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zsysnum file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zsysnum file generated")
|
||||||
|
|
||||||
|
if err := t.makeZSyscallFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zsyscall file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zsyscall file generated")
|
||||||
|
|
||||||
|
if err := t.makeZTypesFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make ztypes file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("ztypes file generated")
|
||||||
|
|
||||||
|
if err := t.makeZErrorsFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zerrors file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zerrors file generated")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the Linux and glibc headers in the include directory.
|
||||||
|
func (t *target) makeHeaders() error {
|
||||||
|
// Make the Linux headers we need for this architecture
|
||||||
|
linuxMake := makeCommand("make", "headers_install", "ARCH="+t.LinuxArch, "INSTALL_HDR_PATH="+TempDir)
|
||||||
|
linuxMake.Dir = LinuxDir
|
||||||
|
if err := linuxMake.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// A Temporary build directory for glibc
|
||||||
|
if err := os.MkdirAll(BuildDir, os.ModePerm); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(BuildDir)
|
||||||
|
|
||||||
|
// Make the glibc headers we need for this architecture
|
||||||
|
confScript := filepath.Join(GlibcDir, "configure")
|
||||||
|
glibcConf := makeCommand(confScript, "--prefix="+TempDir, "--host="+t.GNUArch, "--enable-kernel="+MinKernel)
|
||||||
|
glibcConf.Dir = BuildDir
|
||||||
|
if err := glibcConf.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
glibcMake := makeCommand("make", "install-headers")
|
||||||
|
glibcMake.Dir = BuildDir
|
||||||
|
if err := glibcMake.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// We only need an empty stubs file
|
||||||
|
stubsFile := filepath.Join(IncludeDir, "gnu/stubs.h")
|
||||||
|
if file, err := os.Create(stubsFile); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
file.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zsysnum_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZSysnumFile() error {
|
||||||
|
zsysnumFile := fmt.Sprintf("zsysnum_linux_%s.go", t.GoArch)
|
||||||
|
unistdFile := filepath.Join(IncludeDir, "asm/unistd.h")
|
||||||
|
|
||||||
|
args := append(t.cFlags(), unistdFile)
|
||||||
|
return t.commandFormatOutput("gofmt", zsysnumFile, "linux/mksysnum.pl", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zsyscall_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZSyscallFile() error {
|
||||||
|
zsyscallFile := fmt.Sprintf("zsyscall_linux_%s.go", t.GoArch)
|
||||||
|
// Find the correct architecture syscall file (might end with x.go)
|
||||||
|
archSyscallFile := fmt.Sprintf("syscall_linux_%s.go", t.GoArch)
|
||||||
|
if _, err := os.Stat(archSyscallFile); os.IsNotExist(err) {
|
||||||
|
shortArch := strings.TrimSuffix(t.GoArch, "le")
|
||||||
|
archSyscallFile = fmt.Sprintf("syscall_linux_%sx.go", shortArch)
|
||||||
|
}
|
||||||
|
|
||||||
|
args := append(t.mksyscallFlags(), "-tags", "linux,"+t.GoArch,
|
||||||
|
"syscall_linux.go", archSyscallFile)
|
||||||
|
return t.commandFormatOutput("gofmt", zsyscallFile, "./mksyscall.pl", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zerrors_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZErrorsFile() error {
|
||||||
|
zerrorsFile := fmt.Sprintf("zerrors_linux_%s.go", t.GoArch)
|
||||||
|
|
||||||
|
return t.commandFormatOutput("gofmt", zerrorsFile, "./mkerrors.sh", t.cFlags()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the ztypes_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZTypesFile() error {
|
||||||
|
ztypesFile := fmt.Sprintf("ztypes_linux_%s.go", t.GoArch)
|
||||||
|
|
||||||
|
args := []string{"tool", "cgo", "-godefs", "--"}
|
||||||
|
args = append(args, t.cFlags()...)
|
||||||
|
args = append(args, "linux/types.go")
|
||||||
|
return t.commandFormatOutput("mkpost", ztypesFile, "go", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flags that should be given to gcc and cgo for this target
|
||||||
|
func (t *target) cFlags() []string {
|
||||||
|
// Compile statically to avoid cross-architecture dynamic linking.
|
||||||
|
flags := []string{"-Wall", "-Werror", "-static", "-I" + IncludeDir}
|
||||||
|
|
||||||
|
// Architecture-specific flags
|
||||||
|
if t.SignedChar {
|
||||||
|
flags = append(flags, "-fsigned-char")
|
||||||
|
}
|
||||||
|
if t.LinuxArch == "x86" {
|
||||||
|
flags = append(flags, fmt.Sprintf("-m%d", t.Bits))
|
||||||
|
}
|
||||||
|
|
||||||
|
return flags
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flags that should be given to mksyscall for this target
|
||||||
|
func (t *target) mksyscallFlags() (flags []string) {
|
||||||
|
if t.Bits == 32 {
|
||||||
|
if t.BigEndian {
|
||||||
|
flags = append(flags, "-b32")
|
||||||
|
} else {
|
||||||
|
flags = append(flags, "-l32")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This flag menas a 64-bit value should use (even, odd)-pair.
|
||||||
|
if t.GoArch == "arm" || (t.LinuxArch == "mips" && t.Bits == 32) {
|
||||||
|
flags = append(flags, "-arm")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
Generated
Vendored
+11
-4
@@ -10,11 +10,18 @@ if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
|
|||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $command = "mksysnum_linux.pl ". join(' ', @ARGV);
|
# Check that we are using the new build system if we should
|
||||||
|
if($ENV{'GOLANG_SYS_BUILD'} ne "docker") {
|
||||||
|
print STDERR "In the new build system, mksysnum should not be called directly.\n";
|
||||||
|
print STDERR "See README.md\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $command = "$0 ". join(' ', @ARGV);
|
||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
@@ -38,8 +45,8 @@ sub fmt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $prev;
|
my $prev;
|
||||||
open(GCC, "gcc -E -dD @ARGV |") || die "can't run gcc";
|
open(CC, "$ENV{'CC'} -E -dD @ARGV |") || die "can't run $ENV{'CC'}";
|
||||||
while(<GCC>){
|
while(<CC>){
|
||||||
if(/^#define __NR_Linux\s+([0-9]+)/){
|
if(/^#define __NR_Linux\s+([0-9]+)/){
|
||||||
# mips/mips64: extract offset
|
# mips/mips64: extract offset
|
||||||
$offset = $1;
|
$offset = $1;
|
||||||
Generated
Vendored
+85
-12
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -20,7 +20,6 @@ package unix
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <netpacket/packet.h>
|
#include <netpacket/packet.h>
|
||||||
@@ -36,31 +35,88 @@ package unix
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statfs.h>
|
#include <sys/statfs.h>
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <sys/timex.h>
|
#include <sys/timex.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <linux/filter.h>
|
#include <linux/filter.h>
|
||||||
|
#include <linux/keyctl.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
#include <linux/icmpv6.h>
|
#include <linux/icmpv6.h>
|
||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
|
#include <asm/ptrace.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ustat.h>
|
#include <ustat.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <bluetooth/bluetooth.h>
|
|
||||||
#include <bluetooth/hci.h>
|
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
#include <linux/if_alg.h>
|
#include <linux/if_alg.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
#include <linux/vm_sockets.h>
|
#include <linux/vm_sockets.h>
|
||||||
|
#include <linux/random.h>
|
||||||
|
|
||||||
|
// On mips64, the glibc stat and kernel stat do not agree
|
||||||
|
#if (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64)
|
||||||
|
|
||||||
|
// Use the stat defined by the kernel with a few modifications. These are:
|
||||||
|
// * The time fields (like st_atime and st_atimensec) use the timespec
|
||||||
|
// struct (like st_atim) for consitancy with the glibc fields.
|
||||||
|
// * The padding fields get different names to not break compatibility.
|
||||||
|
// * st_blocks is signed, again for compatibility.
|
||||||
|
struct stat {
|
||||||
|
unsigned int st_dev;
|
||||||
|
unsigned int st_pad1[3]; // Reserved for st_dev expansion
|
||||||
|
|
||||||
|
unsigned long st_ino;
|
||||||
|
|
||||||
|
mode_t st_mode;
|
||||||
|
__u32 st_nlink;
|
||||||
|
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
|
||||||
|
unsigned int st_rdev;
|
||||||
|
unsigned int st_pad2[3]; // Reserved for st_rdev expansion
|
||||||
|
|
||||||
|
off_t st_size;
|
||||||
|
|
||||||
|
// These are declared as speperate fields in the kernel. Here we use
|
||||||
|
// the timespec struct for consistancy with the other stat structs.
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
|
||||||
|
unsigned int st_blksize;
|
||||||
|
unsigned int st_pad4;
|
||||||
|
|
||||||
|
long st_blocks;
|
||||||
|
};
|
||||||
|
|
||||||
|
// These are needed because we do not include fcntl.h or sys/types.h
|
||||||
|
#include <linux/fcntl.h>
|
||||||
|
#include <linux/fadvise.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Use the stat defined by glibc
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Certain constants and structs are missing from the fs/crypto UAPI
|
||||||
|
#define FS_MAX_KEY_SIZE 64
|
||||||
|
struct fscrypt_key {
|
||||||
|
__u32 mode;
|
||||||
|
__u8 raw[FS_MAX_KEY_SIZE];
|
||||||
|
__u32 size;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef TCSETS2
|
#ifdef TCSETS2
|
||||||
// On systems that have "struct termios2" use this as type Termios.
|
// On systems that have "struct termios2" use this as type Termios.
|
||||||
@@ -87,6 +143,13 @@ struct sockaddr_any {
|
|||||||
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// copied from /usr/include/bluetooth/hci.h
|
||||||
|
struct sockaddr_hci {
|
||||||
|
sa_family_t hci_family;
|
||||||
|
unsigned short hci_dev;
|
||||||
|
unsigned short hci_channel;
|
||||||
|
};;
|
||||||
|
|
||||||
// copied from /usr/include/linux/un.h
|
// copied from /usr/include/linux/un.h
|
||||||
struct my_sockaddr_un {
|
struct my_sockaddr_un {
|
||||||
sa_family_t sun_family;
|
sa_family_t sun_family;
|
||||||
@@ -102,10 +165,8 @@ struct my_sockaddr_un {
|
|||||||
typedef struct user_regs PtraceRegs;
|
typedef struct user_regs PtraceRegs;
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
typedef struct user_pt_regs PtraceRegs;
|
typedef struct user_pt_regs PtraceRegs;
|
||||||
#elif defined(__powerpc64__)
|
#elif defined(__mips__) || defined(__powerpc64__)
|
||||||
typedef struct pt_regs PtraceRegs;
|
typedef struct pt_regs PtraceRegs;
|
||||||
#elif defined(__mips__)
|
|
||||||
typedef struct user PtraceRegs;
|
|
||||||
#elif defined(__s390x__)
|
#elif defined(__s390x__)
|
||||||
typedef struct _user_regs_struct PtraceRegs;
|
typedef struct _user_regs_struct PtraceRegs;
|
||||||
#elif defined(__sparc__)
|
#elif defined(__sparc__)
|
||||||
@@ -196,6 +257,16 @@ type Fsid C.fsid_t
|
|||||||
|
|
||||||
type Flock_t C.struct_flock
|
type Flock_t C.struct_flock
|
||||||
|
|
||||||
|
// Filesystem Encryption
|
||||||
|
|
||||||
|
type FscryptPolicy C.struct_fscrypt_policy
|
||||||
|
|
||||||
|
type FscryptKey C.struct_fscrypt_key
|
||||||
|
|
||||||
|
// Structure for Keyctl
|
||||||
|
|
||||||
|
type KeyctlDHParams C.struct_keyctl_dh_params
|
||||||
|
|
||||||
// Advice to Fadvise
|
// Advice to Fadvise
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -421,11 +492,11 @@ const SizeofInotifyEvent = C.sizeof_struct_inotify_event
|
|||||||
type PtraceRegs C.PtraceRegs
|
type PtraceRegs C.PtraceRegs
|
||||||
|
|
||||||
// Structures contained in PtraceRegs on s390x (exported by mkpost.go)
|
// Structures contained in PtraceRegs on s390x (exported by mkpost.go)
|
||||||
type ptracePsw C.ptracePsw
|
type PtracePsw C.ptracePsw
|
||||||
|
|
||||||
type ptraceFpregs C.ptraceFpregs
|
type PtraceFpregs C.ptraceFpregs
|
||||||
|
|
||||||
type ptracePer C.ptracePer
|
type PtracePer C.ptracePer
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
|
|
||||||
@@ -460,6 +531,8 @@ const (
|
|||||||
|
|
||||||
type Sigset_t C.sigset_t
|
type Sigset_t C.sigset_t
|
||||||
|
|
||||||
|
const RNDGETENTCNT = C.RNDGETENTCNT
|
||||||
|
|
||||||
// sysconf information
|
// sysconf information
|
||||||
|
|
||||||
const _SC_PAGESIZE = C._SC_PAGESIZE
|
const _SC_PAGESIZE = C._SC_PAGESIZE
|
||||||
+14
-129
@@ -3,75 +3,9 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
# The unix package provides access to the raw system call
|
# This script runs or (given -n) prints suggested commands to generate files for
|
||||||
# interface of the underlying operating system. Porting Go to
|
# the Architecture/OS specified by the GOARCH and GOOS environment variables.
|
||||||
# a new architecture/operating system combination requires
|
# See README.md for more information about how the build system works.
|
||||||
# some manual effort, though there are tools that automate
|
|
||||||
# much of the process. The auto-generated files have names
|
|
||||||
# beginning with z.
|
|
||||||
#
|
|
||||||
# This script runs or (given -n) prints suggested commands to generate z files
|
|
||||||
# for the current system. Running those commands is not automatic.
|
|
||||||
# This script is documentation more than anything else.
|
|
||||||
#
|
|
||||||
# * asm_${GOOS}_${GOARCH}.s
|
|
||||||
#
|
|
||||||
# This hand-written assembly file implements system call dispatch.
|
|
||||||
# There are three entry points:
|
|
||||||
#
|
|
||||||
# func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
|
||||||
# func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
|
|
||||||
# func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr);
|
|
||||||
#
|
|
||||||
# The first and second are the standard ones; they differ only in
|
|
||||||
# how many arguments can be passed to the kernel.
|
|
||||||
# The third is for low-level use by the ForkExec wrapper;
|
|
||||||
# unlike the first two, it does not call into the scheduler to
|
|
||||||
# let it know that a system call is running.
|
|
||||||
#
|
|
||||||
# * syscall_${GOOS}.go
|
|
||||||
#
|
|
||||||
# This hand-written Go file implements system calls that need
|
|
||||||
# special handling and lists "//sys" comments giving prototypes
|
|
||||||
# for ones that can be auto-generated. Mksyscall reads those
|
|
||||||
# comments to generate the stubs.
|
|
||||||
#
|
|
||||||
# * syscall_${GOOS}_${GOARCH}.go
|
|
||||||
#
|
|
||||||
# Same as syscall_${GOOS}.go except that it contains code specific
|
|
||||||
# to ${GOOS} on one particular architecture.
|
|
||||||
#
|
|
||||||
# * types_${GOOS}.c
|
|
||||||
#
|
|
||||||
# This hand-written C file includes standard C headers and then
|
|
||||||
# creates typedef or enum names beginning with a dollar sign
|
|
||||||
# (use of $ in variable names is a gcc extension). The hardest
|
|
||||||
# part about preparing this file is figuring out which headers to
|
|
||||||
# include and which symbols need to be #defined to get the
|
|
||||||
# actual data structures that pass through to the kernel system calls.
|
|
||||||
# Some C libraries present alternate versions for binary compatibility
|
|
||||||
# and translate them on the way in and out of system calls, but
|
|
||||||
# there is almost always a #define that can get the real ones.
|
|
||||||
# See types_darwin.c and types_linux.c for examples.
|
|
||||||
#
|
|
||||||
# * zerror_${GOOS}_${GOARCH}.go
|
|
||||||
#
|
|
||||||
# This machine-generated file defines the system's error numbers,
|
|
||||||
# error strings, and signal numbers. The generator is "mkerrors.sh".
|
|
||||||
# Usually no arguments are needed, but mkerrors.sh will pass its
|
|
||||||
# arguments on to godefs.
|
|
||||||
#
|
|
||||||
# * zsyscall_${GOOS}_${GOARCH}.go
|
|
||||||
#
|
|
||||||
# Generated by mksyscall.pl; see syscall_${GOOS}.go above.
|
|
||||||
#
|
|
||||||
# * zsysnum_${GOOS}_${GOARCH}.go
|
|
||||||
#
|
|
||||||
# Generated by mksysnum_${GOOS}.
|
|
||||||
#
|
|
||||||
# * ztypes_${GOOS}_${GOARCH}.go
|
|
||||||
#
|
|
||||||
# Generated by godefs; see types_${GOOS}.c above.
|
|
||||||
|
|
||||||
GOOSARCH="${GOOS}_${GOARCH}"
|
GOOSARCH="${GOOS}_${GOARCH}"
|
||||||
|
|
||||||
@@ -84,6 +18,7 @@ zsysctl="zsysctl_$GOOSARCH.go"
|
|||||||
mksysnum=
|
mksysnum=
|
||||||
mktypes=
|
mktypes=
|
||||||
run="sh"
|
run="sh"
|
||||||
|
cmd=""
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-syscalls)
|
-syscalls)
|
||||||
@@ -98,6 +33,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
-n)
|
-n)
|
||||||
run="cat"
|
run="cat"
|
||||||
|
cmd="echo"
|
||||||
shift
|
shift
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -109,6 +45,14 @@ case "$#" in
|
|||||||
exit 2
|
exit 2
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then
|
||||||
|
# Use then new build system
|
||||||
|
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
|
||||||
|
$cmd docker build --tag generate:$GOOS $GOOS
|
||||||
|
$cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
GOOSARCH_in=syscall_$GOOSARCH.go
|
GOOSARCH_in=syscall_$GOOSARCH.go
|
||||||
case "$GOOSARCH" in
|
case "$GOOSARCH" in
|
||||||
_* | *_ | _)
|
_* | *_ | _)
|
||||||
@@ -167,64 +111,6 @@ freebsd_arm)
|
|||||||
# API consistent across over platforms.
|
# API consistent across over platforms.
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
;;
|
;;
|
||||||
linux_386)
|
|
||||||
mkerrors="$mkerrors -m32"
|
|
||||||
mksyscall="./mksyscall.pl -l32"
|
|
||||||
mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_32.h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
linux_amd64)
|
|
||||||
unistd_h=$(ls -1 /usr/include/asm/unistd_64.h /usr/include/x86_64-linux-gnu/asm/unistd_64.h 2>/dev/null | head -1)
|
|
||||||
if [ "$unistd_h" = "" ]; then
|
|
||||||
echo >&2 cannot find unistd_64.h
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mkerrors="$mkerrors -m64"
|
|
||||||
mksysnum="./mksysnum_linux.pl $unistd_h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
linux_arm)
|
|
||||||
mkerrors="$mkerrors"
|
|
||||||
mksyscall="./mksyscall.pl -l32 -arm"
|
|
||||||
mksysnum="curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl -"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
linux_arm64)
|
|
||||||
unistd_h=$(ls -1 /usr/include/asm/unistd.h /usr/include/asm-generic/unistd.h 2>/dev/null | head -1)
|
|
||||||
if [ "$unistd_h" = "" ]; then
|
|
||||||
echo >&2 cannot find unistd_64.h
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mksysnum="./mksysnum_linux.pl $unistd_h"
|
|
||||||
# Let the type of C char be signed for making the bare syscall
|
|
||||||
# API consistent across over platforms.
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
|
||||||
;;
|
|
||||||
linux_ppc64)
|
|
||||||
GOOSARCH_in=syscall_linux_ppc64x.go
|
|
||||||
unistd_h=/usr/include/asm/unistd.h
|
|
||||||
mkerrors="$mkerrors -m64"
|
|
||||||
mksysnum="./mksysnum_linux.pl $unistd_h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
linux_ppc64le)
|
|
||||||
GOOSARCH_in=syscall_linux_ppc64x.go
|
|
||||||
unistd_h=/usr/include/powerpc64le-linux-gnu/asm/unistd.h
|
|
||||||
mkerrors="$mkerrors -m64"
|
|
||||||
mksysnum="./mksysnum_linux.pl $unistd_h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
linux_s390x)
|
|
||||||
GOOSARCH_in=syscall_linux_s390x.go
|
|
||||||
unistd_h=/usr/include/asm/unistd.h
|
|
||||||
mkerrors="$mkerrors -m64"
|
|
||||||
mksysnum="./mksysnum_linux.pl $unistd_h"
|
|
||||||
# Let the type of C char be signed to make the bare sys
|
|
||||||
# API more consistent between platforms.
|
|
||||||
# This is a deliberate departure from the way the syscall
|
|
||||||
# package generates its version of the types file.
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
|
||||||
;;
|
|
||||||
linux_sparc64)
|
linux_sparc64)
|
||||||
GOOSARCH_in=syscall_linux_sparc64.go
|
GOOSARCH_in=syscall_linux_sparc64.go
|
||||||
unistd_h=/usr/include/sparc64-linux-gnu/asm/unistd.h
|
unistd_h=/usr/include/sparc64-linux-gnu/asm/unistd.h
|
||||||
@@ -288,7 +174,6 @@ esac
|
|||||||
if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
|
if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
|
||||||
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
|
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
|
||||||
if [ -n "$mktypes" ]; then
|
if [ -n "$mktypes" ]; then
|
||||||
echo "echo // +build $GOARCH,$GOOS > ztypes_$GOOSARCH.go";
|
echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go";
|
||||||
echo "$mktypes types_$GOOS.go | go run mkpost.go >>ztypes_$GOOSARCH.go";
|
|
||||||
fi
|
fi
|
||||||
) | $run
|
) | $run
|
||||||
|
|||||||
+55
-5
@@ -16,6 +16,15 @@ if test -z "$GOARCH" -o -z "$GOOS"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check that we are using the new build system if we should
|
||||||
|
if [[ "$GOOS" -eq "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then
|
||||||
|
if [[ "$GOLANG_SYS_BUILD" -ne "docker" ]]; then
|
||||||
|
echo 1>&2 "In the new build system, mkerrors should not be called directly."
|
||||||
|
echo 1>&2 "See README.md"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
CC=${CC:-cc}
|
CC=${CC:-cc}
|
||||||
|
|
||||||
if [[ "$GOOS" -eq "solaris" ]]; then
|
if [[ "$GOOS" -eq "solaris" ]]; then
|
||||||
@@ -102,8 +111,39 @@ includes_Linux='
|
|||||||
#endif
|
#endif
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
// <sys/ioctl.h> is broken on powerpc64, as it fails to include definitions of
|
||||||
|
// these structures. We just include them copied from <bits/termios.h>.
|
||||||
|
#if defined(__powerpc__)
|
||||||
|
struct sgttyb {
|
||||||
|
char sg_ispeed;
|
||||||
|
char sg_ospeed;
|
||||||
|
char sg_erase;
|
||||||
|
char sg_kill;
|
||||||
|
short sg_flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct tchars {
|
||||||
|
char t_intrc;
|
||||||
|
char t_quitc;
|
||||||
|
char t_startc;
|
||||||
|
char t_stopc;
|
||||||
|
char t_eofc;
|
||||||
|
char t_brkc;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ltchars {
|
||||||
|
char t_suspc;
|
||||||
|
char t_dsuspc;
|
||||||
|
char t_rprntc;
|
||||||
|
char t_flushc;
|
||||||
|
char t_werasc;
|
||||||
|
char t_lnextc;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <bits/sockaddr.h>
|
#include <bits/sockaddr.h>
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
|
#include <sys/eventfd.h>
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
@@ -122,6 +162,8 @@ includes_Linux='
|
|||||||
#include <linux/if_addr.h>
|
#include <linux/if_addr.h>
|
||||||
#include <linux/falloc.h>
|
#include <linux/falloc.h>
|
||||||
#include <linux/filter.h>
|
#include <linux/filter.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/keyctl.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
#include <linux/reboot.h>
|
#include <linux/reboot.h>
|
||||||
@@ -157,6 +199,11 @@ includes_Linux='
|
|||||||
// but it is already in bluetooth_linux.go
|
// but it is already in bluetooth_linux.go
|
||||||
#undef SOL_BLUETOOTH
|
#undef SOL_BLUETOOTH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Certain constants are missing from the fs/crypto UAPI
|
||||||
|
#define FS_KEY_DESC_PREFIX "fscrypt:"
|
||||||
|
#define FS_KEY_DESC_PREFIX_SIZE 8
|
||||||
|
#define FS_MAX_KEY_SIZE 64
|
||||||
'
|
'
|
||||||
|
|
||||||
includes_NetBSD='
|
includes_NetBSD='
|
||||||
@@ -329,7 +376,7 @@ ccflags="$@"
|
|||||||
$2 ~ /^SYSCTL_VERS/ ||
|
$2 ~ /^SYSCTL_VERS/ ||
|
||||||
$2 ~ /^(MS|MNT)_/ ||
|
$2 ~ /^(MS|MNT)_/ ||
|
||||||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
||||||
$2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ ||
|
$2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ ||
|
||||||
$2 ~ /^LINUX_REBOOT_CMD_/ ||
|
$2 ~ /^LINUX_REBOOT_CMD_/ ||
|
||||||
$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
|
$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
|
||||||
$2 !~ "NLA_TYPE_MASK" &&
|
$2 !~ "NLA_TYPE_MASK" &&
|
||||||
@@ -343,7 +390,7 @@ ccflags="$@"
|
|||||||
$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||
|
$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||
|
||||||
$2 ~ /^BIOC/ ||
|
$2 ~ /^BIOC/ ||
|
||||||
$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
|
$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
|
||||||
$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ ||
|
$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
|
||||||
$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
|
$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
|
||||||
$2 ~ /^CLONE_[A-Z_]+/ ||
|
$2 ~ /^CLONE_[A-Z_]+/ ||
|
||||||
$2 !~ /^(BPF_TIMEVAL)$/ &&
|
$2 !~ /^(BPF_TIMEVAL)$/ &&
|
||||||
@@ -351,12 +398,15 @@ ccflags="$@"
|
|||||||
$2 ~ /^CLOCK_/ ||
|
$2 ~ /^CLOCK_/ ||
|
||||||
$2 ~ /^CAN_/ ||
|
$2 ~ /^CAN_/ ||
|
||||||
$2 ~ /^ALG_/ ||
|
$2 ~ /^ALG_/ ||
|
||||||
|
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
|
||||||
$2 ~ /^GRND_/ ||
|
$2 ~ /^GRND_/ ||
|
||||||
|
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
||||||
|
$2 ~ /^KEYCTL_/ ||
|
||||||
$2 ~ /^SPLICE_/ ||
|
$2 ~ /^SPLICE_/ ||
|
||||||
$2 ~ /^(VM|VMADDR)_/ ||
|
$2 ~ /^(VM|VMADDR)_/ ||
|
||||||
$2 !~ "WMESGLEN" &&
|
$2 !~ "WMESGLEN" &&
|
||||||
$2 ~ /^W[A-Z0-9]+$/ ||
|
$2 ~ /^W[A-Z0-9]+$/ ||
|
||||||
$2 ~ /^BLK/ {printf("\t%s = C.%s\n", $2, $2)}
|
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
|
||||||
$2 ~ /^__WCOREFLAG$/ {next}
|
$2 ~ /^__WCOREFLAG$/ {next}
|
||||||
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
|
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
|
||||||
|
|
||||||
@@ -391,7 +441,7 @@ echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
|
|||||||
sort >_signal.grep
|
sort >_signal.grep
|
||||||
|
|
||||||
echo '// mkerrors.sh' "$@"
|
echo '// mkerrors.sh' "$@"
|
||||||
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
|
echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
|
||||||
echo
|
echo
|
||||||
echo "// +build ${GOARCH},${GOOS}"
|
echo "// +build ${GOARCH},${GOOS}"
|
||||||
echo
|
echo
|
||||||
@@ -453,7 +503,7 @@ intcmp(const void *a, const void *b)
|
|||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
int i, j, e;
|
int i, e;
|
||||||
char buf[1024], *p;
|
char buf[1024], *p;
|
||||||
|
|
||||||
printf("\n\n// Error table\n");
|
printf("\n\n// Error table\n");
|
||||||
|
|||||||
+51
-25
@@ -8,10 +8,11 @@
|
|||||||
// modify the generated types. It is used to clean up
|
// modify the generated types. It is used to clean up
|
||||||
// the sys API in an architecture specific manner.
|
// the sys API in an architecture specific manner.
|
||||||
//
|
//
|
||||||
// mkpost is run after cgo -godefs by mkall.sh.
|
// mkpost is run after cgo -godefs; see README.md.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/format"
|
"go/format"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -21,42 +22,67 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Get the OS and architecture (using GOARCH_TARGET if it exists)
|
||||||
|
goos := os.Getenv("GOOS")
|
||||||
|
goarch := os.Getenv("GOARCH_TARGET")
|
||||||
|
if goarch == "" {
|
||||||
|
goarch = os.Getenv("GOARCH")
|
||||||
|
}
|
||||||
|
// Check that we are using the new build system if we should be.
|
||||||
|
if goos == "linux" && goarch != "sparc64" {
|
||||||
|
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
|
||||||
|
os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n")
|
||||||
|
os.Stderr.WriteString("See README.md\n")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(os.Stdin)
|
b, err := ioutil.ReadAll(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
s := string(b)
|
|
||||||
|
|
||||||
goarch := os.Getenv("GOARCH")
|
// If we have empty Ptrace structs, we should delete them. Only s390x emits
|
||||||
goos := os.Getenv("GOOS")
|
// nonempty Ptrace structs.
|
||||||
|
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
|
||||||
|
b = ptraceRexexp.ReplaceAll(b, nil)
|
||||||
|
|
||||||
|
// Replace the control_regs union with a blank identifier for now.
|
||||||
|
controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
|
||||||
|
b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
|
||||||
|
|
||||||
|
// Remove fields that are added by glibc
|
||||||
|
// Note that this is unstable as the identifers are private.
|
||||||
|
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
|
||||||
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
|
// We refuse to export private fields on s390x
|
||||||
if goarch == "s390x" && goos == "linux" {
|
if goarch == "s390x" && goos == "linux" {
|
||||||
// Export the types of PtraceRegs fields.
|
// Remove cgo padding fields
|
||||||
re := regexp.MustCompile("ptrace(Psw|Fpregs|Per)")
|
removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
|
||||||
s = re.ReplaceAllString(s, "Ptrace$1")
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Replace padding fields inserted by cgo with blank identifiers.
|
// Remove padding, hidden, or unused fields
|
||||||
re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*")
|
removeFieldsRegex = regexp.MustCompile(`X_\S+`)
|
||||||
s = re.ReplaceAllString(s, "_")
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Replace other unwanted fields with blank identifiers.
|
|
||||||
re = regexp.MustCompile("X_[A-Za-z0-9_]*")
|
|
||||||
s = re.ReplaceAllString(s, "_")
|
|
||||||
|
|
||||||
// Replace the control_regs union with a blank identifier for now.
|
|
||||||
re = regexp.MustCompile("(Control_regs)\\s+\\[0\\]uint64")
|
|
||||||
s = re.ReplaceAllString(s, "_ [0]uint64")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the first line of warning from cgo
|
||||||
|
b = b[bytes.IndexByte(b, '\n')+1:]
|
||||||
|
// Modify the command in the header to include:
|
||||||
|
// mkpost, our own warning, and a build tag.
|
||||||
|
replacement := fmt.Sprintf(`$1 | go run mkpost.go
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build %s,%s`, goarch, goos)
|
||||||
|
cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
|
||||||
|
b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
|
||||||
|
|
||||||
// gofmt
|
// gofmt
|
||||||
b, err = format.Source([]byte(s))
|
b, err = format.Source(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append this command to the header to show where the new file
|
os.Stdout.Write(b)
|
||||||
// came from.
|
|
||||||
re := regexp.MustCompile("(cgo -godefs [a-zA-Z0-9_]+\\.go.*)")
|
|
||||||
b = re.ReplaceAll(b, []byte("$1 | go run mkpost.go"))
|
|
||||||
|
|
||||||
fmt.Printf("%s", b)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-1
@@ -69,6 +69,16 @@ if($ARGV[0] =~ /^-/) {
|
|||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check that we are using the new build system if we should
|
||||||
|
if($ENV{'GOOS'} eq "linux" && $ENV{'GOARCH'} ne "sparc64") {
|
||||||
|
if($ENV{'GOLANG_SYS_BUILD'} ne "docker") {
|
||||||
|
print STDERR "In the new build system, mksyscall should not be called directly.\n";
|
||||||
|
print STDERR "See README.md\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub parseparamlist($) {
|
sub parseparamlist($) {
|
||||||
my ($list) = @_;
|
my ($list) = @_;
|
||||||
$list =~ s/^\s*//;
|
$list =~ s/^\s*//;
|
||||||
@@ -300,7 +310,7 @@ if($errors) {
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $cmdline
|
// $cmdline
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $tags
|
// +build $tags
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -258,7 +258,7 @@ if($errors) {
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $cmdline
|
// $cmdline
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $tags
|
// +build $tags
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ my $command = "mksysnum_darwin.pl " . join(' ', @ARGV);
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ my $command = "mksysnum_dragonfly.pl " . join(' ', @ARGV);
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV);
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ my $command = "mksysnum_netbsd.pl " . join(' ', @ARGV);
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ my $command = "mksysnum_openbsd.pl " . join(' ', @ARGV);
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
// $command
|
// $command
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
|
||||||
|
|
||||||
|
|||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
// Copyright 2016 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.
|
||||||
|
|
||||||
|
// +build openbsd
|
||||||
|
// +build 386 amd64 arm
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
SYS_PLEDGE = 108
|
||||||
|
)
|
||||||
|
|
||||||
|
// Pledge implements the pledge syscall. For more information see pledge(2).
|
||||||
|
func Pledge(promises string, paths []string) error {
|
||||||
|
promisesPtr, err := syscall.BytePtrFromString(promises)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil)
|
||||||
|
if paths != nil {
|
||||||
|
var pathsPtr []*byte
|
||||||
|
if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
pathsUnsafe = unsafe.Pointer(&pathsPtr[0])
|
||||||
|
}
|
||||||
|
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0)
|
||||||
|
if e != 0 {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
+113
@@ -0,0 +1,113 @@
|
|||||||
|
// Copyright 2016 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.
|
||||||
|
|
||||||
|
// +build openbsd
|
||||||
|
|
||||||
|
// This, on the face of it, bizarre testing mechanism is necessary because
|
||||||
|
// the only reliable way to gauge whether or not a pledge(2) call has succeeded
|
||||||
|
// is that the program has been killed as a result of breaking its pledge.
|
||||||
|
|
||||||
|
package unix_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
)
|
||||||
|
|
||||||
|
type testProc struct {
|
||||||
|
fn func() // should always exit instead of returning
|
||||||
|
cleanup func() error // for instance, delete coredumps from testing pledge
|
||||||
|
success bool // whether zero-exit means success or failure
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
testProcs = map[string]testProc{}
|
||||||
|
procName = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
optName = "sys-unix-internal-procname"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
flag.StringVar(&procName, optName, "", "internal use only")
|
||||||
|
}
|
||||||
|
|
||||||
|
// testCmd generates a proper command that, when executed, runs the test
|
||||||
|
// corresponding to the given key.
|
||||||
|
func testCmd(procName string) (*exec.Cmd, error) {
|
||||||
|
exe, err := filepath.Abs(os.Args[0])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cmd := exec.Command(exe, "-"+optName+"="+procName)
|
||||||
|
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
|
||||||
|
return cmd, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExitsCorrectly is a comprehensive, one-line-of-use wrapper for testing
|
||||||
|
// a testProc with a key.
|
||||||
|
func ExitsCorrectly(procName string, t *testing.T) {
|
||||||
|
s := testProcs[procName]
|
||||||
|
c, err := testCmd(procName)
|
||||||
|
defer func() {
|
||||||
|
if s.cleanup() != nil {
|
||||||
|
t.Fatalf("Failed to run cleanup for %s", procName)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Failed to construct command for %s", procName)
|
||||||
|
}
|
||||||
|
if (c.Run() == nil) != s.success {
|
||||||
|
result := "succeed"
|
||||||
|
if !s.success {
|
||||||
|
result = "fail"
|
||||||
|
}
|
||||||
|
t.Fatalf("Process did not %s when it was supposed to", result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
flag.Parse()
|
||||||
|
if procName != "" {
|
||||||
|
testProcs[procName].fn()
|
||||||
|
}
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
|
// For example, add a test for pledge.
|
||||||
|
func init() {
|
||||||
|
testProcs["pledge"] = testProc{
|
||||||
|
func() {
|
||||||
|
fmt.Println(unix.Pledge("", nil))
|
||||||
|
os.Exit(0)
|
||||||
|
},
|
||||||
|
func() error {
|
||||||
|
files, err := ioutil.ReadDir(".")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, file := range files {
|
||||||
|
if filepath.Ext(file.Name()) == ".core" {
|
||||||
|
if err := os.Remove(file.Name()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPledge(t *testing.T) {
|
||||||
|
ExitsCorrectly("pledge", t)
|
||||||
|
}
|
||||||
+5
-4
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@@ -13,9 +13,10 @@ import "unsafe"
|
|||||||
// Round the length of a raw sockaddr up to align it properly.
|
// Round the length of a raw sockaddr up to align it properly.
|
||||||
func cmsgAlignOf(salen int) int {
|
func cmsgAlignOf(salen int) int {
|
||||||
salign := sizeofPtr
|
salign := sizeofPtr
|
||||||
// NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels
|
// NOTE: It seems like 64-bit Darwin, DragonFly BSD and
|
||||||
// still require 32-bit aligned access to network subsystem.
|
// Solaris kernels still require 32-bit aligned access to
|
||||||
if darwin64Bit || dragonfly64Bit {
|
// network subsystem.
|
||||||
|
if darwin64Bit || dragonfly64Bit || solaris64Bit {
|
||||||
salign = 4
|
salign = 4
|
||||||
}
|
}
|
||||||
return (salen + salign - 1) & ^(salign - 1)
|
return (salen + salign - 1) & ^(salign - 1)
|
||||||
|
|||||||
+10
-26
@@ -76,32 +76,16 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
for max != 0 && len(buf) > 0 {
|
}
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
|
||||||
if dirent.Reclen == 0 {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
buf = nil
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||||
break
|
|
||||||
}
|
|
||||||
buf = buf[dirent.Reclen:]
|
|
||||||
if dirent.Ino == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:dirent.Namlen])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
|
||||||
return origlen - len(buf), count, names
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||||
|
|||||||
+39
-25
@@ -1,8 +1,8 @@
|
|||||||
// Copyright 2009,2010 The Go Authors. All rights reserved.
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// FreeBSD system calls.
|
// DragonFly BSD system calls.
|
||||||
// This file is compiled as ordinary Go code,
|
// This file is compiled as ordinary Go code,
|
||||||
// but it is also input to mksyscall,
|
// but it is also input to mksyscall,
|
||||||
// which parses the //sys lines and generates system call stubs.
|
// which parses the //sys lines and generates system call stubs.
|
||||||
@@ -34,7 +34,7 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
|
|
||||||
// NOTE(rsc): It seems strange to set the buffer to have
|
// NOTE(rsc): It seems strange to set the buffer to have
|
||||||
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
||||||
// as the size. I don't know why the +2 is here, but the
|
// as the size. I don't know why the +2 is here, but the
|
||||||
// kernel uses +2 for its own implementation of this function.
|
// kernel uses +2 for its own implementation of this function.
|
||||||
// I am scared that if we don't include the +2 here, the kernel
|
// I am scared that if we don't include the +2 here, the kernel
|
||||||
// will silently write 2 words farther than we specify
|
// will silently write 2 words farther than we specify
|
||||||
@@ -56,29 +56,20 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
namlen, ok := direntNamlen(buf)
|
||||||
for max != 0 && len(buf) > 0 {
|
if !ok {
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
return 0, false
|
||||||
reclen := int(16+dirent.Namlen+1+7) & ^7
|
|
||||||
buf = buf[reclen:]
|
|
||||||
if dirent.Fileno == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:dirent.Namlen])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
}
|
||||||
return origlen - len(buf), count, names
|
return (16 + namlen + 1 + 7) &^ 7, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe() (r int, w int, err error)
|
//sysnb pipe() (r int, w int, err error)
|
||||||
@@ -101,6 +92,24 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|||||||
return extpwrite(fd, p, 0, offset)
|
return extpwrite(fd, p, 0, offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
|
||||||
|
var rsa RawSockaddrAny
|
||||||
|
var len _Socklen = SizeofSockaddrAny
|
||||||
|
nfd, err = accept4(fd, &rsa, &len, flags)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len > SizeofSockaddrAny {
|
||||||
|
panic("RawSockaddrAny too small")
|
||||||
|
}
|
||||||
|
sa, err = anyToSockaddr(&rsa)
|
||||||
|
if err != nil {
|
||||||
|
Close(nfd)
|
||||||
|
nfd = 0
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
var bufsize uintptr
|
var bufsize uintptr
|
||||||
@@ -208,6 +217,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
@@ -243,6 +253,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
// Mmap
|
||||||
|
// Mlock
|
||||||
|
// Munlock
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
@@ -335,6 +347,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
|
// Mlockall
|
||||||
|
// Munlockall
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
|
|||||||
+10
-26
@@ -54,32 +54,16 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
for max != 0 && len(buf) > 0 {
|
}
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
|
||||||
if dirent.Reclen == 0 {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
buf = nil
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||||
break
|
|
||||||
}
|
|
||||||
buf = buf[dirent.Reclen:]
|
|
||||||
if dirent.Fileno == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:dirent.Namlen])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
|
||||||
return origlen - len(buf), count, names
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe() (r int, w int, err error)
|
//sysnb pipe() (r int, w int, err error)
|
||||||
|
|||||||
+158
-36
@@ -36,6 +36,25 @@ func Creat(path string, mode uint32) (fd int, err error) {
|
|||||||
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
|
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) (err error) {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
|
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
|
||||||
|
|
||||||
func Link(oldpath string, newpath string) (err error) {
|
func Link(oldpath string, newpath string) (err error) {
|
||||||
@@ -744,10 +763,124 @@ func GetsockoptUcred(fd, level, opt int) (*Ucred, error) {
|
|||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
|
||||||
|
var value TCPInfo
|
||||||
|
vallen := _Socklen(SizeofTCPInfo)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
||||||
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)
|
||||||
|
|
||||||
|
// KeyctlInt calls keyctl commands in which each argument is an int.
|
||||||
|
// These commands are KEYCTL_REVOKE, KEYCTL_CHOWN, KEYCTL_CLEAR, KEYCTL_LINK,
|
||||||
|
// KEYCTL_UNLINK, KEYCTL_NEGATE, KEYCTL_SET_REQKEY_KEYRING, KEYCTL_SET_TIMEOUT,
|
||||||
|
// KEYCTL_ASSUME_AUTHORITY, KEYCTL_SESSION_TO_PARENT, KEYCTL_REJECT,
|
||||||
|
// KEYCTL_INVALIDATE, and KEYCTL_GET_PERSISTENT.
|
||||||
|
//sys KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlBuffer calls keyctl commands in which the third and fourth
|
||||||
|
// arguments are a buffer and its length, respectively.
|
||||||
|
// These commands are KEYCTL_UPDATE, KEYCTL_READ, and KEYCTL_INSTANTIATE.
|
||||||
|
//sys KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlString calls keyctl commands which return a string.
|
||||||
|
// These commands are KEYCTL_DESCRIBE and KEYCTL_GET_SECURITY.
|
||||||
|
func KeyctlString(cmd int, id int) (string, error) {
|
||||||
|
// We must loop as the string data may change in between the syscalls.
|
||||||
|
// We could allocate a large buffer here to reduce the chance that the
|
||||||
|
// syscall needs to be called twice; however, this is unnecessary as
|
||||||
|
// the performance loss is negligible.
|
||||||
|
var buffer []byte
|
||||||
|
for {
|
||||||
|
// Try to fill the buffer with data
|
||||||
|
length, err := KeyctlBuffer(cmd, id, buffer, 0)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the data was written
|
||||||
|
if length <= len(buffer) {
|
||||||
|
// Exclude the null terminator
|
||||||
|
return string(buffer[:length-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a bigger buffer if needed
|
||||||
|
buffer = make([]byte, length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keyctl commands with special signatures.
|
||||||
|
|
||||||
|
// KeyctlGetKeyringID implements the KEYCTL_GET_KEYRING_ID command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_get_keyring_ID.3.html
|
||||||
|
func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) {
|
||||||
|
createInt := 0
|
||||||
|
if create {
|
||||||
|
createInt = 1
|
||||||
|
}
|
||||||
|
return KeyctlInt(KEYCTL_GET_KEYRING_ID, id, createInt, 0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeyctlSetperm implements the KEYCTL_SETPERM command. The perm value is the
|
||||||
|
// key handle permission mask as described in the "keyctl setperm" section of
|
||||||
|
// http://man7.org/linux/man-pages/man1/keyctl.1.html.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_setperm.3.html
|
||||||
|
func KeyctlSetperm(id int, perm uint32) error {
|
||||||
|
_, err := KeyctlInt(KEYCTL_SETPERM, id, int(perm), 0, 0)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlJoin(cmd int, arg2 string) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlJoinSessionKeyring implements the KEYCTL_JOIN_SESSION_KEYRING command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_join_session_keyring.3.html
|
||||||
|
func KeyctlJoinSessionKeyring(name string) (ringid int, err error) {
|
||||||
|
return keyctlJoin(KEYCTL_JOIN_SESSION_KEYRING, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlSearch implements the KEYCTL_SEARCH command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_search.3.html
|
||||||
|
func KeyctlSearch(ringid int, keyType, description string, destRingid int) (id int, err error) {
|
||||||
|
return keyctlSearch(KEYCTL_SEARCH, ringid, keyType, description, destRingid)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlInstantiateIOV implements the KEYCTL_INSTANTIATE_IOV command. This
|
||||||
|
// command is similar to KEYCTL_INSTANTIATE, except that the payload is a slice
|
||||||
|
// of Iovec (each of which represents a buffer) instead of a single buffer.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_instantiate_iov.3.html
|
||||||
|
func KeyctlInstantiateIOV(id int, payload []Iovec, ringid int) error {
|
||||||
|
return keyctlIOV(KEYCTL_INSTANTIATE_IOV, id, payload, ringid)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlDHCompute implements the KEYCTL_DH_COMPUTE command. This command
|
||||||
|
// computes a Diffie-Hellman shared secret based on the provide params. The
|
||||||
|
// secret is written to the provided buffer and the returned size is the number
|
||||||
|
// of bytes written (returning an error if there is insufficient space in the
|
||||||
|
// buffer). If a nil buffer is passed in, this function returns the minimum
|
||||||
|
// buffer length needed to store the appropriate data. Note that this differs
|
||||||
|
// from KEYCTL_READ's behavior which always returns the requested payload size.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_dh_compute.3.html
|
||||||
|
func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error) {
|
||||||
|
return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer)
|
||||||
|
}
|
||||||
|
|
||||||
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
var rsa RawSockaddrAny
|
var rsa RawSockaddrAny
|
||||||
@@ -881,6 +1014,10 @@ func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {
|
|||||||
return ptracePeek(PTRACE_PEEKDATA, pid, addr, out)
|
return ptracePeek(PTRACE_PEEKDATA, pid, addr, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PtracePeekUser(pid int, addr uintptr, out []byte) (count int, err error) {
|
||||||
|
return ptracePeek(PTRACE_PEEKUSR, pid, addr, out)
|
||||||
|
}
|
||||||
|
|
||||||
func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {
|
func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) {
|
||||||
// As for ptracePeek, we need to align our accesses to deal
|
// As for ptracePeek, we need to align our accesses to deal
|
||||||
// with the possibility of straddling an invalid page.
|
// with the possibility of straddling an invalid page.
|
||||||
@@ -979,38 +1116,24 @@ func Reboot(cmd int) (err error) {
|
|||||||
return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "")
|
return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func clen(n []byte) int {
|
|
||||||
for i := 0; i < len(n); i++ {
|
|
||||||
if n[i] == 0 {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ReadDirent(fd int, buf []byte) (n int, err error) {
|
func ReadDirent(fd int, buf []byte) (n int, err error) {
|
||||||
return Getdents(fd, buf)
|
return Getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
||||||
count = 0
|
}
|
||||||
for max != 0 && len(buf) > 0 {
|
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
buf = buf[dirent.Reclen:]
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
if dirent.Ino == 0 { // File absent in directory.
|
}
|
||||||
continue
|
|
||||||
}
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
reclen, ok := direntReclen(buf)
|
||||||
var name = string(bytes[0:clen(bytes[:])])
|
if !ok {
|
||||||
if name == "." || name == ".." { // Useless names
|
return 0, false
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
}
|
||||||
return origlen - len(buf), count, names
|
return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
|
//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
|
||||||
@@ -1036,16 +1159,19 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
|
|||||||
* Direct access
|
* Direct access
|
||||||
*/
|
*/
|
||||||
//sys Acct(path string) (err error)
|
//sys Acct(path string) (err error)
|
||||||
|
//sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error)
|
||||||
//sys Adjtimex(buf *Timex) (state int, err error)
|
//sys Adjtimex(buf *Timex) (state int, err error)
|
||||||
//sys Chdir(path string) (err error)
|
//sys Chdir(path string) (err error)
|
||||||
//sys Chroot(path string) (err error)
|
//sys Chroot(path string) (err error)
|
||||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||||
//sys Close(fd int) (err error)
|
//sys Close(fd int) (err error)
|
||||||
|
//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
//sys Dup(oldfd int) (fd int, err error)
|
//sys Dup(oldfd int) (fd int, err error)
|
||||||
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
||||||
//sysnb EpollCreate(size int) (fd int, err error)
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
//sysnb EpollCreate1(flag int) (fd int, err error)
|
//sysnb EpollCreate1(flag int) (fd int, err error)
|
||||||
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
||||||
|
//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2
|
||||||
//sys Exit(code int) = SYS_EXIT_GROUP
|
//sys Exit(code int) = SYS_EXIT_GROUP
|
||||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
||||||
@@ -1078,7 +1204,11 @@ func Getpgrp() (pid int) {
|
|||||||
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
|
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
|
||||||
//sysnb Kill(pid int, sig syscall.Signal) (err error)
|
//sysnb Kill(pid int, sig syscall.Signal) (err error)
|
||||||
//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
|
//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
|
||||||
|
//sys Lgetxattr(path string, attr string, dest []byte) (sz int, err error)
|
||||||
//sys Listxattr(path string, dest []byte) (sz int, err error)
|
//sys Listxattr(path string, dest []byte) (sz int, err error)
|
||||||
|
//sys Llistxattr(path string, dest []byte) (sz int, err error)
|
||||||
|
//sys Lremovexattr(path string, attr string) (err error)
|
||||||
|
//sys Lsetxattr(path string, attr string, data []byte, flags int) (err error)
|
||||||
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
@@ -1088,6 +1218,7 @@ func Getpgrp() (pid int) {
|
|||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Removexattr(path string, attr string) (err error)
|
//sys Removexattr(path string, attr string) (err error)
|
||||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||||
|
//sys RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error)
|
||||||
//sys Setdomainname(p []byte) (err error)
|
//sys Setdomainname(p []byte) (err error)
|
||||||
//sys Sethostname(p []byte) (err error)
|
//sys Sethostname(p []byte) (err error)
|
||||||
//sysnb Setpgid(pid int, pgid int) (err error)
|
//sysnb Setpgid(pid int, pgid int) (err error)
|
||||||
@@ -1171,7 +1302,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
*/
|
*/
|
||||||
// AddKey
|
|
||||||
// AfsSyscall
|
// AfsSyscall
|
||||||
// Alarm
|
// Alarm
|
||||||
// ArchPrctl
|
// ArchPrctl
|
||||||
@@ -1187,7 +1317,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// EpollCtlOld
|
// EpollCtlOld
|
||||||
// EpollPwait
|
// EpollPwait
|
||||||
// EpollWaitOld
|
// EpollWaitOld
|
||||||
// Eventfd
|
|
||||||
// Execve
|
// Execve
|
||||||
// Fgetxattr
|
// Fgetxattr
|
||||||
// Flistxattr
|
// Flistxattr
|
||||||
@@ -1206,16 +1335,10 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// IoGetevents
|
// IoGetevents
|
||||||
// IoSetup
|
// IoSetup
|
||||||
// IoSubmit
|
// IoSubmit
|
||||||
// Ioctl
|
|
||||||
// IoprioGet
|
// IoprioGet
|
||||||
// IoprioSet
|
// IoprioSet
|
||||||
// KexecLoad
|
// KexecLoad
|
||||||
// Keyctl
|
|
||||||
// Lgetxattr
|
|
||||||
// Llistxattr
|
|
||||||
// LookupDcookie
|
// LookupDcookie
|
||||||
// Lremovexattr
|
|
||||||
// Lsetxattr
|
|
||||||
// Mbind
|
// Mbind
|
||||||
// MigratePages
|
// MigratePages
|
||||||
// Mincore
|
// Mincore
|
||||||
@@ -1246,7 +1369,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// Readahead
|
// Readahead
|
||||||
// Readv
|
// Readv
|
||||||
// RemapFilePages
|
// RemapFilePages
|
||||||
// RequestKey
|
|
||||||
// RestartSyscall
|
// RestartSyscall
|
||||||
// RtSigaction
|
// RtSigaction
|
||||||
// RtSigpending
|
// RtSigpending
|
||||||
|
|||||||
+3
-2
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
@@ -182,9 +183,9 @@ func fillStat_t(s *Stat_t, st *stat_t) {
|
|||||||
s.Blocks = st.Blocks
|
s.Blocks = st.Blocks
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Regs[64] }
|
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Regs[64] = pc }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
iov.Len = uint64(length)
|
iov.Len = uint64(length)
|
||||||
|
|||||||
+2
-2
@@ -211,9 +211,9 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return setrlimit(resource, &rl)
|
return setrlimit(resource, &rl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return uint64(r.Regs[64]) }
|
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Regs[64] = uint32(pc) }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
iov.Len = uint32(length)
|
iov.Len = uint32(length)
|
||||||
|
|||||||
+15
@@ -15,6 +15,21 @@ import (
|
|||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestIoctlGetInt(t *testing.T) {
|
||||||
|
f, err := os.Open("/dev/random")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to open device: %v", err)
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
v, err := unix.IoctlGetInt(int(f.Fd()), unix.RNDGETENTCNT)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to perform ioctl: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Logf("%d bits of entropy available", v)
|
||||||
|
}
|
||||||
|
|
||||||
func TestPoll(t *testing.T) {
|
func TestPoll(t *testing.T) {
|
||||||
f, cleanup := mktmpfifo(t)
|
f, cleanup := mktmpfifo(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|||||||
+10
-26
@@ -93,32 +93,16 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
return mib, nil
|
return mib, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
for max != 0 && len(buf) > 0 {
|
}
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
|
||||||
if dirent.Reclen == 0 {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
buf = nil
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||||
break
|
|
||||||
}
|
|
||||||
buf = buf[dirent.Reclen:]
|
|
||||||
if dirent.Fileno == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:dirent.Namlen])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
|
||||||
return origlen - len(buf), count, names
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe() (fd1 int, fd2 int, err error)
|
//sysnb pipe() (fd1 int, fd2 int, err error)
|
||||||
|
|||||||
+10
-26
@@ -53,32 +53,16 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
for max != 0 && len(buf) > 0 {
|
}
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
|
||||||
if dirent.Reclen == 0 {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
buf = nil
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||||
break
|
|
||||||
}
|
|
||||||
buf = buf[dirent.Reclen:]
|
|
||||||
if dirent.Fileno == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:dirent.Namlen])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
|
||||||
return origlen - len(buf), count, names
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
|
|||||||
+35
-45
@@ -44,32 +44,20 @@ func clen(n []byte) int {
|
|||||||
return len(n)
|
return len(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
// appending the names to names. It returns the number
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
||||||
// bytes consumed from buf, the number of entries added
|
}
|
||||||
// to names, and the new names slice.
|
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
origlen := len(buf)
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
||||||
for max != 0 && len(buf) > 0 {
|
}
|
||||||
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
|
|
||||||
if dirent.Reclen == 0 {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
buf = nil
|
reclen, ok := direntReclen(buf)
|
||||||
break
|
if !ok {
|
||||||
}
|
return 0, false
|
||||||
buf = buf[dirent.Reclen:]
|
|
||||||
if dirent.Ino == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
|
|
||||||
var name = string(bytes[0:clen(bytes[:])])
|
|
||||||
if name == "." || name == ".." { // Useless names
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
}
|
||||||
return origlen - len(buf), count, names
|
return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (n int, err error)
|
//sysnb pipe(p *[2]_C_int) (n int, err error)
|
||||||
@@ -434,7 +422,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.recvmsg
|
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg
|
||||||
|
|
||||||
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
@@ -453,7 +441,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))
|
msg.Accrightslen = int32(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
msg.Iovlen = 1
|
msg.Iovlen = 1
|
||||||
@@ -473,7 +461,7 @@ func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.sendmsg
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg
|
||||||
|
|
||||||
func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
||||||
var ptr unsafe.Pointer
|
var ptr unsafe.Pointer
|
||||||
@@ -499,7 +487,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))
|
msg.Accrightslen = int32(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
msg.Iovlen = 1
|
msg.Iovlen = 1
|
||||||
@@ -531,43 +519,43 @@ func Acct(path string) (err error) {
|
|||||||
* Expose the ioctl function
|
* Expose the ioctl function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//sys ioctl(fd int, req int, arg uintptr) (err error)
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
func IoctlSetInt(fd int, req int, value int) (err error) {
|
func IoctlSetInt(fd int, req uint, value int) (err error) {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetWinsize(fd int, req int, value *Winsize) (err error) {
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermios(fd int, req int, value *Termios) (err error) {
|
func IoctlSetTermios(fd int, req uint, value *Termios) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermio(fd int, req int, value *Termio) (err error) {
|
func IoctlSetTermio(fd int, req uint, value *Termio) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetInt(fd int, req int) (int, error) {
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
var value int
|
var value int
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return value, err
|
return value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
var value Winsize
|
var value Winsize
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
var value Termios
|
var value Termios
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
var value Termio
|
var value Termio
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
@@ -595,6 +583,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Fdatasync(fd int) (err error)
|
//sys Fdatasync(fd int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
|
||||||
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
||||||
//sysnb Getgid() (gid int)
|
//sysnb Getgid() (gid int)
|
||||||
//sysnb Getpid() (pid int)
|
//sysnb Getpid() (pid int)
|
||||||
@@ -611,7 +600,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Kill(pid int, signum syscall.Signal) (err error)
|
//sys Kill(pid int, signum syscall.Signal) (err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error) = libsocket.listen
|
//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
@@ -651,6 +640,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
|
//sys Statvfs(path string, vfsstat *Statvfs_t) (err error)
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sysnb Times(tms *Tms) (ticks uintptr, err error)
|
//sysnb Times(tms *Tms) (ticks uintptr, err error)
|
||||||
@@ -664,15 +654,15 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.bind
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_bind
|
||||||
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.connect
|
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.sendto
|
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto
|
||||||
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.socket
|
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket
|
||||||
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.socketpair
|
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.getsockopt
|
//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.__xnet_getsockopt
|
||||||
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername
|
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername
|
||||||
//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt
|
//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2017 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.
|
||||||
|
|
||||||
|
// +build solaris
|
||||||
|
|
||||||
|
package unix_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os/exec"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestStatvfs(t *testing.T) {
|
||||||
|
if err := unix.Statvfs("", nil); err == nil {
|
||||||
|
t.Fatal(`Statvfs("") expected failure`)
|
||||||
|
}
|
||||||
|
|
||||||
|
statvfs := unix.Statvfs_t{}
|
||||||
|
if err := unix.Statvfs("/", &statvfs); err != nil {
|
||||||
|
t.Errorf(`Statvfs("/") failed: %v`, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if t.Failed() {
|
||||||
|
mount, err := exec.Command("mount").CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
t.Logf("mount: %v\n%s", err, mount)
|
||||||
|
} else {
|
||||||
|
t.Logf("mount: %s", mount)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -23,6 +23,7 @@ const (
|
|||||||
darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
|
darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
|
||||||
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
|
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
|
||||||
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
|
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
|
||||||
|
solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8
|
||||||
)
|
)
|
||||||
|
|
||||||
// Do the interface allocations only once for common
|
// Do the interface allocations only once for common
|
||||||
|
|||||||
-8
@@ -86,14 +86,6 @@ func TestFcntlFlock(t *testing.T) {
|
|||||||
// "-test.run=^TestPassFD$" and an environment variable used to signal
|
// "-test.run=^TestPassFD$" and an environment variable used to signal
|
||||||
// that the test should become the child process instead.
|
// that the test should become the child process instead.
|
||||||
func TestPassFD(t *testing.T) {
|
func TestPassFD(t *testing.T) {
|
||||||
switch runtime.GOOS {
|
|
||||||
case "dragonfly":
|
|
||||||
// TODO(jsing): Figure out why sendmsg is returning EINVAL.
|
|
||||||
t.Skip("skipping test on dragonfly")
|
|
||||||
case "solaris":
|
|
||||||
// TODO(aram): Figure out why ReadMsgUnix is returning empty message.
|
|
||||||
t.Skip("skipping test on solaris, see issue 7402")
|
|
||||||
}
|
|
||||||
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
|
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
|
||||||
passFDChild()
|
passFDChild()
|
||||||
return
|
return
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
|
|||||||
+8
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -37,6 +37,7 @@ package unix
|
|||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -139,6 +140,12 @@ type Flock_t C.struct_flock
|
|||||||
|
|
||||||
type Dirent C.struct_dirent
|
type Dirent C.struct_dirent
|
||||||
|
|
||||||
|
// Filesystems
|
||||||
|
|
||||||
|
type _Fsblkcnt_t C.fsblkcnt_t
|
||||||
|
|
||||||
|
type Statvfs_t C.struct_statvfs
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
|
|||||||
+47
-9
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,dragonfly
|
// +build amd64,dragonfly
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ const (
|
|||||||
AF_MAX = 0x24
|
AF_MAX = 0x24
|
||||||
AF_MPLS = 0x22
|
AF_MPLS = 0x22
|
||||||
AF_NATM = 0x1d
|
AF_NATM = 0x1d
|
||||||
|
AF_NETBIOS = 0x6
|
||||||
AF_NETGRAPH = 0x20
|
AF_NETGRAPH = 0x20
|
||||||
AF_NS = 0x6
|
|
||||||
AF_OSI = 0x7
|
AF_OSI = 0x7
|
||||||
AF_PUP = 0x4
|
AF_PUP = 0x4
|
||||||
AF_ROUTE = 0x11
|
AF_ROUTE = 0x11
|
||||||
@@ -46,6 +46,7 @@ const (
|
|||||||
AF_SNA = 0xb
|
AF_SNA = 0xb
|
||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
|
ALTWERASE = 0x200
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -141,7 +142,22 @@ const (
|
|||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x4
|
||||||
|
CLOCK_MONOTONIC_FAST = 0xc
|
||||||
|
CLOCK_MONOTONIC_PRECISE = 0xb
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xf
|
||||||
|
CLOCK_PROF = 0x2
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_REALTIME_FAST = 0xa
|
||||||
|
CLOCK_REALTIME_PRECISE = 0x9
|
||||||
|
CLOCK_SECOND = 0xd
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0xe
|
||||||
|
CLOCK_UPTIME = 0x5
|
||||||
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
|
CLOCK_VIRTUAL = 0x1
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -286,24 +302,28 @@ const (
|
|||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
EVFILT_EXCEPT = -0x8
|
EVFILT_EXCEPT = -0x8
|
||||||
|
EVFILT_FS = -0xa
|
||||||
EVFILT_MARKER = 0xf
|
EVFILT_MARKER = 0xf
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0x8
|
EVFILT_SYSCOUNT = 0xa
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
|
EVFILT_USER = -0x9
|
||||||
EVFILT_VNODE = -0x4
|
EVFILT_VNODE = -0x4
|
||||||
EVFILT_WRITE = -0x2
|
EVFILT_WRITE = -0x2
|
||||||
EV_ADD = 0x1
|
EV_ADD = 0x1
|
||||||
EV_CLEAR = 0x20
|
EV_CLEAR = 0x20
|
||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
|
EV_DISPATCH = 0x80
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
EV_FLAG1 = 0x2000
|
EV_FLAG1 = 0x2000
|
||||||
EV_NODATA = 0x1000
|
EV_NODATA = 0x1000
|
||||||
EV_ONESHOT = 0x10
|
EV_ONESHOT = 0x10
|
||||||
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
@@ -679,7 +699,6 @@ const (
|
|||||||
IPPROTO_SATEXPAK = 0x40
|
IPPROTO_SATEXPAK = 0x40
|
||||||
IPPROTO_SATMON = 0x45
|
IPPROTO_SATMON = 0x45
|
||||||
IPPROTO_SCCSP = 0x60
|
IPPROTO_SCCSP = 0x60
|
||||||
IPPROTO_SCTP = 0x84
|
|
||||||
IPPROTO_SDRP = 0x2a
|
IPPROTO_SDRP = 0x2a
|
||||||
IPPROTO_SEP = 0x21
|
IPPROTO_SEP = 0x21
|
||||||
IPPROTO_SKIP = 0x39
|
IPPROTO_SKIP = 0x39
|
||||||
@@ -730,6 +749,7 @@ const (
|
|||||||
IPV6_LEAVE_GROUP = 0xd
|
IPV6_LEAVE_GROUP = 0xd
|
||||||
IPV6_MAXHLIM = 0xff
|
IPV6_MAXHLIM = 0xff
|
||||||
IPV6_MAXPACKET = 0xffff
|
IPV6_MAXPACKET = 0xffff
|
||||||
|
IPV6_MINHLIM = 0x28
|
||||||
IPV6_MMTU = 0x500
|
IPV6_MMTU = 0x500
|
||||||
IPV6_MSFILTER = 0x4a
|
IPV6_MSFILTER = 0x4a
|
||||||
IPV6_MULTICAST_HOPS = 0xa
|
IPV6_MULTICAST_HOPS = 0xa
|
||||||
@@ -778,6 +798,7 @@ const (
|
|||||||
IP_FW_FLUSH = 0x34
|
IP_FW_FLUSH = 0x34
|
||||||
IP_FW_GET = 0x36
|
IP_FW_GET = 0x36
|
||||||
IP_FW_RESETLOG = 0x37
|
IP_FW_RESETLOG = 0x37
|
||||||
|
IP_FW_X = 0x31
|
||||||
IP_FW_ZERO = 0x35
|
IP_FW_ZERO = 0x35
|
||||||
IP_HDRINCL = 0x2
|
IP_HDRINCL = 0x2
|
||||||
IP_IPSEC_POLICY = 0x15
|
IP_IPSEC_POLICY = 0x15
|
||||||
@@ -833,6 +854,7 @@ const (
|
|||||||
MADV_SETMAP = 0xb
|
MADV_SETMAP = 0xb
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -851,6 +873,7 @@ const (
|
|||||||
MAP_VPAGETABLE = 0x2000
|
MAP_VPAGETABLE = 0x2000
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MSG_CMSG_CLOEXEC = 0x1000
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -860,11 +883,11 @@ const (
|
|||||||
MSG_FMASK = 0xffff0000
|
MSG_FMASK = 0xffff0000
|
||||||
MSG_FNONBLOCKING = 0x20000
|
MSG_FNONBLOCKING = 0x20000
|
||||||
MSG_NOSIGNAL = 0x400
|
MSG_NOSIGNAL = 0x400
|
||||||
MSG_NOTIFICATION = 0x200
|
|
||||||
MSG_OOB = 0x1
|
MSG_OOB = 0x1
|
||||||
MSG_PEEK = 0x2
|
MSG_PEEK = 0x2
|
||||||
MSG_SYNC = 0x800
|
MSG_SYNC = 0x800
|
||||||
MSG_TRUNC = 0x10
|
MSG_TRUNC = 0x10
|
||||||
|
MSG_UNUSED09 = 0x200
|
||||||
MSG_WAITALL = 0x40
|
MSG_WAITALL = 0x40
|
||||||
MS_ASYNC = 0x1
|
MS_ASYNC = 0x1
|
||||||
MS_INVALIDATE = 0x2
|
MS_INVALIDATE = 0x2
|
||||||
@@ -875,12 +898,19 @@ const (
|
|||||||
NET_RT_IFLIST = 0x3
|
NET_RT_IFLIST = 0x3
|
||||||
NET_RT_MAXID = 0x4
|
NET_RT_MAXID = 0x4
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_CHILD = 0x4
|
NOTE_CHILD = 0x4
|
||||||
NOTE_DELETE = 0x1
|
NOTE_DELETE = 0x1
|
||||||
NOTE_EXEC = 0x20000000
|
NOTE_EXEC = 0x20000000
|
||||||
NOTE_EXIT = 0x80000000
|
NOTE_EXIT = 0x80000000
|
||||||
NOTE_EXTEND = 0x4
|
NOTE_EXTEND = 0x4
|
||||||
|
NOTE_FFAND = 0x40000000
|
||||||
|
NOTE_FFCOPY = 0xc0000000
|
||||||
|
NOTE_FFCTRLMASK = 0xc0000000
|
||||||
|
NOTE_FFLAGSMASK = 0xffffff
|
||||||
|
NOTE_FFNOP = 0x0
|
||||||
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
@@ -891,6 +921,7 @@ const (
|
|||||||
NOTE_REVOKE = 0x40
|
NOTE_REVOKE = 0x40
|
||||||
NOTE_TRACK = 0x1
|
NOTE_TRACK = 0x1
|
||||||
NOTE_TRACKERR = 0x2
|
NOTE_TRACKERR = 0x2
|
||||||
|
NOTE_TRIGGER = 0x1000000
|
||||||
NOTE_WRITE = 0x2
|
NOTE_WRITE = 0x2
|
||||||
OCRNL = 0x10
|
OCRNL = 0x10
|
||||||
ONLCR = 0x2
|
ONLCR = 0x2
|
||||||
@@ -898,6 +929,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
O_ASYNC = 0x40
|
O_ASYNC = 0x40
|
||||||
@@ -910,14 +942,11 @@ const (
|
|||||||
O_FAPPEND = 0x100000
|
O_FAPPEND = 0x100000
|
||||||
O_FASYNCWRITE = 0x800000
|
O_FASYNCWRITE = 0x800000
|
||||||
O_FBLOCKING = 0x40000
|
O_FBLOCKING = 0x40000
|
||||||
O_FBUFFERED = 0x2000000
|
O_FMASK = 0xfc0000
|
||||||
O_FMASK = 0x7fc0000
|
|
||||||
O_FNONBLOCKING = 0x80000
|
O_FNONBLOCKING = 0x80000
|
||||||
O_FOFFSET = 0x200000
|
O_FOFFSET = 0x200000
|
||||||
O_FSYNC = 0x80
|
O_FSYNC = 0x80
|
||||||
O_FSYNCWRITE = 0x400000
|
O_FSYNCWRITE = 0x400000
|
||||||
O_FUNBUFFERED = 0x1000000
|
|
||||||
O_MAPONREAD = 0x4000000
|
|
||||||
O_NDELAY = 0x4
|
O_NDELAY = 0x4
|
||||||
O_NOCTTY = 0x8000
|
O_NOCTTY = 0x8000
|
||||||
O_NOFOLLOW = 0x100
|
O_NOFOLLOW = 0x100
|
||||||
@@ -1096,8 +1125,10 @@ const (
|
|||||||
SIOCSLIFPHYADDR = 0x8118694a
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
SIOCSLOWAT = 0x80047302
|
SIOCSLOWAT = 0x80047302
|
||||||
SIOCSPGRP = 0x80047308
|
SIOCSPGRP = 0x80047308
|
||||||
|
SOCK_CLOEXEC = 0x10000000
|
||||||
SOCK_DGRAM = 0x2
|
SOCK_DGRAM = 0x2
|
||||||
SOCK_MAXADDRLEN = 0xff
|
SOCK_MAXADDRLEN = 0xff
|
||||||
|
SOCK_NONBLOCK = 0x20000000
|
||||||
SOCK_RAW = 0x3
|
SOCK_RAW = 0x3
|
||||||
SOCK_RDM = 0x4
|
SOCK_RDM = 0x4
|
||||||
SOCK_SEQPACKET = 0x5
|
SOCK_SEQPACKET = 0x5
|
||||||
@@ -1107,6 +1138,7 @@ const (
|
|||||||
SO_ACCEPTCONN = 0x2
|
SO_ACCEPTCONN = 0x2
|
||||||
SO_ACCEPTFILTER = 0x1000
|
SO_ACCEPTFILTER = 0x1000
|
||||||
SO_BROADCAST = 0x20
|
SO_BROADCAST = 0x20
|
||||||
|
SO_CPUHINT = 0x1030
|
||||||
SO_DEBUG = 0x1
|
SO_DEBUG = 0x1
|
||||||
SO_DONTROUTE = 0x10
|
SO_DONTROUTE = 0x10
|
||||||
SO_ERROR = 0x1007
|
SO_ERROR = 0x1007
|
||||||
@@ -1127,8 +1159,12 @@ const (
|
|||||||
SO_TYPE = 0x1008
|
SO_TYPE = 0x1008
|
||||||
SO_USELOOPBACK = 0x40
|
SO_USELOOPBACK = 0x40
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_FASTKEEP = 0x80
|
TCP_FASTKEEP = 0x80
|
||||||
TCP_KEEPCNT = 0x400
|
TCP_KEEPCNT = 0x400
|
||||||
TCP_KEEPIDLE = 0x100
|
TCP_KEEPIDLE = 0x100
|
||||||
@@ -1227,6 +1263,8 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_BCACHE_SIZE_MAX = 0x0
|
||||||
|
VM_SWZONE_SIZE_MAX = 0x4000000000
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
|||||||
+1784
-1531
File diff suppressed because it is too large
Load Diff
+1785
-1539
File diff suppressed because it is too large
Load Diff
+1789
-1459
File diff suppressed because it is too large
Load Diff
+1772
-1609
File diff suppressed because it is too large
Load Diff
+1789
-1509
File diff suppressed because it is too large
Load Diff
+1787
-1603
File diff suppressed because it is too large
Load Diff
+1787
-1603
File diff suppressed because it is too large
Load Diff
+1787
-1704
File diff suppressed because it is too large
Load Diff
+1844
-1681
File diff suppressed because it is too large
Load Diff
+1844
-1677
File diff suppressed because it is too large
Load Diff
+1844
-1735
File diff suppressed because it is too large
Load Diff
+48
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,solaris
|
// +build amd64,solaris
|
||||||
|
|
||||||
@@ -159,7 +159,12 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x2000
|
||||||
|
BSDLY = 0x2000
|
||||||
|
CBAUD = 0xf
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
|
CIBAUD = 0xf0000
|
||||||
CLOCAL = 0x800
|
CLOCAL = 0x800
|
||||||
CLOCK_HIGHRES = 0x4
|
CLOCK_HIGHRES = 0x4
|
||||||
CLOCK_LEVEL = 0xa
|
CLOCK_LEVEL = 0xa
|
||||||
@@ -169,7 +174,13 @@ const (
|
|||||||
CLOCK_REALTIME = 0x3
|
CLOCK_REALTIME = 0x3
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x2
|
CLOCK_THREAD_CPUTIME_ID = 0x2
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x200
|
||||||
|
CR2 = 0x400
|
||||||
|
CR3 = 0x600
|
||||||
|
CRDLY = 0x600
|
||||||
CREAD = 0x80
|
CREAD = 0x80
|
||||||
|
CRTSCTS = 0x80000000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x10
|
CS6 = 0x10
|
||||||
CS7 = 0x20
|
CS7 = 0x20
|
||||||
@@ -276,6 +287,9 @@ const (
|
|||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_NFDBITS = 0x40
|
FD_NFDBITS = 0x40
|
||||||
FD_SETSIZE = 0x10000
|
FD_SETSIZE = 0x10000
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x8000
|
||||||
|
FFDLY = 0x8000
|
||||||
FLUSHALL = 0x1
|
FLUSHALL = 0x1
|
||||||
FLUSHDATA = 0x0
|
FLUSHDATA = 0x0
|
||||||
FLUSHO = 0x2000
|
FLUSHO = 0x2000
|
||||||
@@ -290,6 +304,10 @@ const (
|
|||||||
F_DUP2FD_CLOEXEC = 0x24
|
F_DUP2FD_CLOEXEC = 0x24
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x25
|
F_DUPFD_CLOEXEC = 0x25
|
||||||
|
F_FLOCK = 0x35
|
||||||
|
F_FLOCK64 = 0x35
|
||||||
|
F_FLOCKW = 0x36
|
||||||
|
F_FLOCKW64 = 0x36
|
||||||
F_FREESP = 0xb
|
F_FREESP = 0xb
|
||||||
F_FREESP64 = 0xb
|
F_FREESP64 = 0xb
|
||||||
F_GETFD = 0x1
|
F_GETFD = 0x1
|
||||||
@@ -304,6 +322,12 @@ const (
|
|||||||
F_MDACC = 0x20
|
F_MDACC = 0x20
|
||||||
F_NODNY = 0x0
|
F_NODNY = 0x0
|
||||||
F_NPRIV = 0x10
|
F_NPRIV = 0x10
|
||||||
|
F_OFD_GETLK = 0x2f
|
||||||
|
F_OFD_GETLK64 = 0x2f
|
||||||
|
F_OFD_SETLK = 0x30
|
||||||
|
F_OFD_SETLK64 = 0x30
|
||||||
|
F_OFD_SETLKW = 0x31
|
||||||
|
F_OFD_SETLKW64 = 0x31
|
||||||
F_PRIV = 0xf
|
F_PRIV = 0xf
|
||||||
F_QUOTACTL = 0x11
|
F_QUOTACTL = 0x11
|
||||||
F_RDACC = 0x1
|
F_RDACC = 0x1
|
||||||
@@ -332,6 +356,7 @@ const (
|
|||||||
F_WRDNY = 0x2
|
F_WRDNY = 0x2
|
||||||
F_WRLCK = 0x2
|
F_WRLCK = 0x2
|
||||||
HUPCL = 0x400
|
HUPCL = 0x400
|
||||||
|
IBSHIFT = 0x10
|
||||||
ICANON = 0x2
|
ICANON = 0x2
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
IEXTEN = 0x8000
|
IEXTEN = 0x8000
|
||||||
@@ -589,15 +614,21 @@ const (
|
|||||||
IP_UNSPEC_SRC = 0x42
|
IP_UNSPEC_SRC = 0x42
|
||||||
ISIG = 0x1
|
ISIG = 0x1
|
||||||
ISTRIP = 0x20
|
ISTRIP = 0x20
|
||||||
|
IUCLC = 0x200
|
||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x1000
|
IXOFF = 0x1000
|
||||||
IXON = 0x400
|
IXON = 0x400
|
||||||
|
LOCK_EX = 0x2
|
||||||
|
LOCK_NB = 0x4
|
||||||
|
LOCK_SH = 0x1
|
||||||
|
LOCK_UN = 0x8
|
||||||
MADV_ACCESS_DEFAULT = 0x6
|
MADV_ACCESS_DEFAULT = 0x6
|
||||||
MADV_ACCESS_LWP = 0x7
|
MADV_ACCESS_LWP = 0x7
|
||||||
MADV_ACCESS_MANY = 0x8
|
MADV_ACCESS_MANY = 0x8
|
||||||
MADV_DONTNEED = 0x4
|
MADV_DONTNEED = 0x4
|
||||||
MADV_FREE = 0x5
|
MADV_FREE = 0x5
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PURGE = 0x9
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
@@ -605,6 +636,7 @@ const (
|
|||||||
MAP_ALIGN = 0x200
|
MAP_ALIGN = 0x200
|
||||||
MAP_ANON = 0x100
|
MAP_ANON = 0x100
|
||||||
MAP_ANONYMOUS = 0x100
|
MAP_ANONYMOUS = 0x100
|
||||||
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
MAP_INITDATA = 0x800
|
MAP_INITDATA = 0x800
|
||||||
MAP_NORESERVE = 0x40
|
MAP_NORESERVE = 0x40
|
||||||
@@ -632,10 +664,14 @@ const (
|
|||||||
MS_OLDSYNC = 0x0
|
MS_OLDSYNC = 0x0
|
||||||
MS_SYNC = 0x4
|
MS_SYNC = 0x4
|
||||||
M_FLUSH = 0x86
|
M_FLUSH = 0x86
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NLDLY = 0x100
|
||||||
NOFLSH = 0x80
|
NOFLSH = 0x80
|
||||||
OCRNL = 0x8
|
OCRNL = 0x8
|
||||||
OFDEL = 0x80
|
OFDEL = 0x80
|
||||||
OFILL = 0x40
|
OFILL = 0x40
|
||||||
|
OLCUC = 0x2
|
||||||
ONLCR = 0x4
|
ONLCR = 0x4
|
||||||
ONLRET = 0x20
|
ONLRET = 0x20
|
||||||
ONOCR = 0x10
|
ONOCR = 0x10
|
||||||
@@ -955,12 +991,21 @@ const (
|
|||||||
SO_USELOOPBACK = 0x40
|
SO_USELOOPBACK = 0x40
|
||||||
SO_VRRP = 0x1017
|
SO_VRRP = 0x1017
|
||||||
SO_WROFF = 0x2
|
SO_WROFF = 0x2
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x800
|
||||||
|
TAB2 = 0x1000
|
||||||
|
TAB3 = 0x1800
|
||||||
|
TABDLY = 0x1800
|
||||||
TCFLSH = 0x5407
|
TCFLSH = 0x5407
|
||||||
TCGETA = 0x5401
|
TCGETA = 0x5401
|
||||||
TCGETS = 0x540d
|
TCGETS = 0x540d
|
||||||
TCIFLUSH = 0x0
|
TCIFLUSH = 0x0
|
||||||
|
TCIOFF = 0x2
|
||||||
TCIOFLUSH = 0x2
|
TCIOFLUSH = 0x2
|
||||||
|
TCION = 0x3
|
||||||
TCOFLUSH = 0x1
|
TCOFLUSH = 0x1
|
||||||
|
TCOOFF = 0x0
|
||||||
|
TCOON = 0x1
|
||||||
TCP_ABORT_THRESHOLD = 0x11
|
TCP_ABORT_THRESHOLD = 0x11
|
||||||
TCP_ANONPRIVBIND = 0x20
|
TCP_ANONPRIVBIND = 0x20
|
||||||
TCP_CONN_ABORT_THRESHOLD = 0x13
|
TCP_CONN_ABORT_THRESHOLD = 0x13
|
||||||
@@ -1089,6 +1134,8 @@ const (
|
|||||||
WSTOPPED = 0x4
|
WSTOPPED = 0x4
|
||||||
WTRAPPED = 0x2
|
WTRAPPED = 0x2
|
||||||
WUNTRACED = 0x4
|
WUNTRACED = 0x4
|
||||||
|
XCASE = 0x4
|
||||||
|
XTABS = 0x1800
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go
|
// mksyscall.pl -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build dragonfly,amd64
|
// +build dragonfly,amd64
|
||||||
|
|
||||||
@@ -1380,3 +1380,14 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
|
||||||
|
nfd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go
|
// mksyscall.pl -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,386
|
// +build linux,386
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go
|
// mksyscall.pl -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,amd64
|
// +build linux,amd64
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go
|
// mksyscall.pl -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,arm
|
// +build linux,arm
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go
|
// mksyscall.pl -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,arm64
|
// +build linux,arm64
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go
|
// mksyscall.pl -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,mips
|
// +build linux,mips
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+289
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go
|
// mksyscall.pl -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,mips64
|
// +build linux,mips64
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@@ -1194,6 +1472,16 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
|
|||||||
+289
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go
|
// mksyscall.pl -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,mips64le
|
// +build linux,mips64le
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
@@ -1194,6 +1472,16 @@ func Munlockall() (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Dup2(oldfd int, newfd int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(events) > 0 {
|
if len(events) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go
|
// mksyscall.pl -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,mipsle
|
// +build linux,mipsle
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go
|
// mksyscall.pl -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,ppc64
|
// +build linux,ppc64
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go
|
// mksyscall.pl -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,ppc64le
|
// +build linux,ppc64le
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+279
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,s390x syscall_linux.go syscall_linux_s390x.go
|
// mksyscall.pl -tags linux,s390x syscall_linux.go syscall_linux_s390x.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,s390x
|
// +build linux,s390x
|
||||||
|
|
||||||
@@ -14,6 +14,16 @@ var _ syscall.Errno
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
@@ -186,6 +196,104 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg2)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(arg3)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(arg4)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
|
||||||
|
ret = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -251,6 +359,33 @@ func Acct(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(payload) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&payload[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Adjtimex(buf *Timex) (state int, err error) {
|
func Adjtimex(buf *Timex) (state int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
|
||||||
state = int(r0)
|
state = int(r0)
|
||||||
@@ -312,6 +447,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
@@ -365,6 +511,17 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Eventfd(initval uint, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Exit(code int) {
|
func Exit(code int) {
|
||||||
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
|
||||||
return
|
return
|
||||||
@@ -681,6 +838,33 @@ func Klogctl(typ int, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listxattr(path string, dest []byte) (sz int, err error) {
|
func Listxattr(path string, dest []byte) (sz int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -703,6 +887,74 @@ func Listxattr(path string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Llistxattr(path string, dest []byte) (sz int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(dest) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&dest[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
|
||||||
|
sz = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lremovexattr(path string, attr string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(attr)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 unsafe.Pointer
|
||||||
|
if len(data) > 0 {
|
||||||
|
_p2 = unsafe.Pointer(&data[0])
|
||||||
|
} else {
|
||||||
|
_p2 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -840,6 +1092,32 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(keyType)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(description)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p2 *byte
|
||||||
|
_p2, err = BytePtrFromString(callback)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
|
||||||
|
id = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Setdomainname(p []byte) (err error) {
|
func Setdomainname(p []byte) (err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
|
|||||||
+12
-1
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go
|
// mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build linux,sparc64
|
// +build linux,sparc64
|
||||||
|
|
||||||
@@ -312,6 +312,17 @@ func Close(fd int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(oldfd int) (fd int, err error) {
|
func Dup(oldfd int) (fd int, err error) {
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
|
|||||||
+65
-38
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go
|
// mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build solaris,amd64
|
// +build solaris,amd64
|
||||||
|
|
||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_fcntl fcntl "libc.so"
|
//go:cgo_import_dynamic libc_fcntl fcntl "libc.so"
|
||||||
//go:cgo_import_dynamic libc_futimesat futimesat "libc.so"
|
//go:cgo_import_dynamic libc_futimesat futimesat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_accept accept "libsocket.so"
|
//go:cgo_import_dynamic libc_accept accept "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_recvmsg recvmsg "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_sendmsg sendmsg "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_sendmsg __xnet_sendmsg "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_acct acct "libc.so"
|
//go:cgo_import_dynamic libc_acct acct "libc.so"
|
||||||
//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
|
//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
|
||||||
//go:cgo_import_dynamic libc_access access "libc.so"
|
//go:cgo_import_dynamic libc_access access "libc.so"
|
||||||
@@ -45,6 +45,7 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_fdatasync fdatasync "libc.so"
|
//go:cgo_import_dynamic libc_fdatasync fdatasync "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so"
|
//go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fstat fstat "libc.so"
|
//go:cgo_import_dynamic libc_fstat fstat "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_fstatvfs fstatvfs "libc.so"
|
||||||
//go:cgo_import_dynamic libc_getdents getdents "libc.so"
|
//go:cgo_import_dynamic libc_getdents getdents "libc.so"
|
||||||
//go:cgo_import_dynamic libc_getgid getgid "libc.so"
|
//go:cgo_import_dynamic libc_getgid getgid "libc.so"
|
||||||
//go:cgo_import_dynamic libc_getpid getpid "libc.so"
|
//go:cgo_import_dynamic libc_getpid getpid "libc.so"
|
||||||
@@ -61,7 +62,7 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_kill kill "libc.so"
|
//go:cgo_import_dynamic libc_kill kill "libc.so"
|
||||||
//go:cgo_import_dynamic libc_lchown lchown "libc.so"
|
//go:cgo_import_dynamic libc_lchown lchown "libc.so"
|
||||||
//go:cgo_import_dynamic libc_link link "libc.so"
|
//go:cgo_import_dynamic libc_link link "libc.so"
|
||||||
//go:cgo_import_dynamic libc_listen listen "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_lstat lstat "libc.so"
|
//go:cgo_import_dynamic libc_lstat lstat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_madvise madvise "libc.so"
|
//go:cgo_import_dynamic libc_madvise madvise "libc.so"
|
||||||
//go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
|
//go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
|
||||||
@@ -101,6 +102,7 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_setuid setuid "libc.so"
|
//go:cgo_import_dynamic libc_setuid setuid "libc.so"
|
||||||
//go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so"
|
//go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_stat stat "libc.so"
|
//go:cgo_import_dynamic libc_stat stat "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_statvfs statvfs "libc.so"
|
||||||
//go:cgo_import_dynamic libc_symlink symlink "libc.so"
|
//go:cgo_import_dynamic libc_symlink symlink "libc.so"
|
||||||
//go:cgo_import_dynamic libc_sync sync "libc.so"
|
//go:cgo_import_dynamic libc_sync sync "libc.so"
|
||||||
//go:cgo_import_dynamic libc_times times "libc.so"
|
//go:cgo_import_dynamic libc_times times "libc.so"
|
||||||
@@ -114,15 +116,15 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so"
|
//go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_ustat ustat "libc.so"
|
//go:cgo_import_dynamic libc_ustat ustat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_utime utime "libc.so"
|
//go:cgo_import_dynamic libc_utime utime "libc.so"
|
||||||
//go:cgo_import_dynamic libc_bind bind "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_bind __xnet_bind "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_connect connect "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_connect __xnet_connect "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_mmap mmap "libc.so"
|
//go:cgo_import_dynamic libc_mmap mmap "libc.so"
|
||||||
//go:cgo_import_dynamic libc_munmap munmap "libc.so"
|
//go:cgo_import_dynamic libc_munmap munmap "libc.so"
|
||||||
//go:cgo_import_dynamic libc_sendto sendto "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_sendto __xnet_sendto "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_socket socket "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_socket __xnet_socket "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_socketpair socketpair "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_socketpair __xnet_socketpair "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_write write "libc.so"
|
//go:cgo_import_dynamic libc_write write "libc.so"
|
||||||
//go:cgo_import_dynamic libc_getsockopt getsockopt "libsocket.so"
|
//go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so"
|
//go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
|
//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
|
||||||
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
|
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
|
||||||
@@ -140,8 +142,8 @@ import (
|
|||||||
//go:linkname procfcntl libc_fcntl
|
//go:linkname procfcntl libc_fcntl
|
||||||
//go:linkname procfutimesat libc_futimesat
|
//go:linkname procfutimesat libc_futimesat
|
||||||
//go:linkname procaccept libc_accept
|
//go:linkname procaccept libc_accept
|
||||||
//go:linkname procrecvmsg libc_recvmsg
|
//go:linkname proc__xnet_recvmsg libc___xnet_recvmsg
|
||||||
//go:linkname procsendmsg libc_sendmsg
|
//go:linkname proc__xnet_sendmsg libc___xnet_sendmsg
|
||||||
//go:linkname procacct libc_acct
|
//go:linkname procacct libc_acct
|
||||||
//go:linkname procioctl libc_ioctl
|
//go:linkname procioctl libc_ioctl
|
||||||
//go:linkname procAccess libc_access
|
//go:linkname procAccess libc_access
|
||||||
@@ -163,6 +165,7 @@ import (
|
|||||||
//go:linkname procFdatasync libc_fdatasync
|
//go:linkname procFdatasync libc_fdatasync
|
||||||
//go:linkname procFpathconf libc_fpathconf
|
//go:linkname procFpathconf libc_fpathconf
|
||||||
//go:linkname procFstat libc_fstat
|
//go:linkname procFstat libc_fstat
|
||||||
|
//go:linkname procFstatvfs libc_fstatvfs
|
||||||
//go:linkname procGetdents libc_getdents
|
//go:linkname procGetdents libc_getdents
|
||||||
//go:linkname procGetgid libc_getgid
|
//go:linkname procGetgid libc_getgid
|
||||||
//go:linkname procGetpid libc_getpid
|
//go:linkname procGetpid libc_getpid
|
||||||
@@ -179,7 +182,7 @@ import (
|
|||||||
//go:linkname procKill libc_kill
|
//go:linkname procKill libc_kill
|
||||||
//go:linkname procLchown libc_lchown
|
//go:linkname procLchown libc_lchown
|
||||||
//go:linkname procLink libc_link
|
//go:linkname procLink libc_link
|
||||||
//go:linkname proclisten libc_listen
|
//go:linkname proc__xnet_llisten libc___xnet_llisten
|
||||||
//go:linkname procLstat libc_lstat
|
//go:linkname procLstat libc_lstat
|
||||||
//go:linkname procMadvise libc_madvise
|
//go:linkname procMadvise libc_madvise
|
||||||
//go:linkname procMkdir libc_mkdir
|
//go:linkname procMkdir libc_mkdir
|
||||||
@@ -219,6 +222,7 @@ import (
|
|||||||
//go:linkname procSetuid libc_setuid
|
//go:linkname procSetuid libc_setuid
|
||||||
//go:linkname procshutdown libc_shutdown
|
//go:linkname procshutdown libc_shutdown
|
||||||
//go:linkname procStat libc_stat
|
//go:linkname procStat libc_stat
|
||||||
|
//go:linkname procStatvfs libc_statvfs
|
||||||
//go:linkname procSymlink libc_symlink
|
//go:linkname procSymlink libc_symlink
|
||||||
//go:linkname procSync libc_sync
|
//go:linkname procSync libc_sync
|
||||||
//go:linkname procTimes libc_times
|
//go:linkname procTimes libc_times
|
||||||
@@ -232,15 +236,15 @@ import (
|
|||||||
//go:linkname procUnlinkat libc_unlinkat
|
//go:linkname procUnlinkat libc_unlinkat
|
||||||
//go:linkname procUstat libc_ustat
|
//go:linkname procUstat libc_ustat
|
||||||
//go:linkname procUtime libc_utime
|
//go:linkname procUtime libc_utime
|
||||||
//go:linkname procbind libc_bind
|
//go:linkname proc__xnet_bind libc___xnet_bind
|
||||||
//go:linkname procconnect libc_connect
|
//go:linkname proc__xnet_connect libc___xnet_connect
|
||||||
//go:linkname procmmap libc_mmap
|
//go:linkname procmmap libc_mmap
|
||||||
//go:linkname procmunmap libc_munmap
|
//go:linkname procmunmap libc_munmap
|
||||||
//go:linkname procsendto libc_sendto
|
//go:linkname proc__xnet_sendto libc___xnet_sendto
|
||||||
//go:linkname procsocket libc_socket
|
//go:linkname proc__xnet_socket libc___xnet_socket
|
||||||
//go:linkname procsocketpair libc_socketpair
|
//go:linkname proc__xnet_socketpair libc___xnet_socketpair
|
||||||
//go:linkname procwrite libc_write
|
//go:linkname procwrite libc_write
|
||||||
//go:linkname procgetsockopt libc_getsockopt
|
//go:linkname proc__xnet_getsockopt libc___xnet_getsockopt
|
||||||
//go:linkname procgetpeername libc_getpeername
|
//go:linkname procgetpeername libc_getpeername
|
||||||
//go:linkname procsetsockopt libc_setsockopt
|
//go:linkname procsetsockopt libc_setsockopt
|
||||||
//go:linkname procrecvfrom libc_recvfrom
|
//go:linkname procrecvfrom libc_recvfrom
|
||||||
@@ -259,8 +263,8 @@ var (
|
|||||||
procfcntl,
|
procfcntl,
|
||||||
procfutimesat,
|
procfutimesat,
|
||||||
procaccept,
|
procaccept,
|
||||||
procrecvmsg,
|
proc__xnet_recvmsg,
|
||||||
procsendmsg,
|
proc__xnet_sendmsg,
|
||||||
procacct,
|
procacct,
|
||||||
procioctl,
|
procioctl,
|
||||||
procAccess,
|
procAccess,
|
||||||
@@ -282,6 +286,7 @@ var (
|
|||||||
procFdatasync,
|
procFdatasync,
|
||||||
procFpathconf,
|
procFpathconf,
|
||||||
procFstat,
|
procFstat,
|
||||||
|
procFstatvfs,
|
||||||
procGetdents,
|
procGetdents,
|
||||||
procGetgid,
|
procGetgid,
|
||||||
procGetpid,
|
procGetpid,
|
||||||
@@ -298,7 +303,7 @@ var (
|
|||||||
procKill,
|
procKill,
|
||||||
procLchown,
|
procLchown,
|
||||||
procLink,
|
procLink,
|
||||||
proclisten,
|
proc__xnet_llisten,
|
||||||
procLstat,
|
procLstat,
|
||||||
procMadvise,
|
procMadvise,
|
||||||
procMkdir,
|
procMkdir,
|
||||||
@@ -338,6 +343,7 @@ var (
|
|||||||
procSetuid,
|
procSetuid,
|
||||||
procshutdown,
|
procshutdown,
|
||||||
procStat,
|
procStat,
|
||||||
|
procStatvfs,
|
||||||
procSymlink,
|
procSymlink,
|
||||||
procSync,
|
procSync,
|
||||||
procTimes,
|
procTimes,
|
||||||
@@ -351,15 +357,15 @@ var (
|
|||||||
procUnlinkat,
|
procUnlinkat,
|
||||||
procUstat,
|
procUstat,
|
||||||
procUtime,
|
procUtime,
|
||||||
procbind,
|
proc__xnet_bind,
|
||||||
procconnect,
|
proc__xnet_connect,
|
||||||
procmmap,
|
procmmap,
|
||||||
procmunmap,
|
procmunmap,
|
||||||
procsendto,
|
proc__xnet_sendto,
|
||||||
procsocket,
|
proc__xnet_socket,
|
||||||
procsocketpair,
|
proc__xnet_socketpair,
|
||||||
procwrite,
|
procwrite,
|
||||||
procgetsockopt,
|
proc__xnet_getsockopt,
|
||||||
procgetpeername,
|
procgetpeername,
|
||||||
procsetsockopt,
|
procsetsockopt,
|
||||||
procrecvfrom,
|
procrecvfrom,
|
||||||
@@ -488,7 +494,7 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
||||||
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
|
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
|
||||||
n = int(r0)
|
n = int(r0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
@@ -497,7 +503,7 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
||||||
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
|
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
|
||||||
n = int(r0)
|
n = int(r0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
@@ -513,7 +519,7 @@ func acct(path *byte) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func ioctl(fd int, req int, arg uintptr) (err error) {
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
@@ -713,6 +719,14 @@ func Fstat(fd int, stat *Stat_t) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) {
|
||||||
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatvfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
@@ -853,7 +867,7 @@ func Link(path string, link string) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Listen(s int, backlog int) (err error) {
|
func Listen(s int, backlog int) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
@@ -1302,6 +1316,19 @@ func Stat(path string, stat *Stat_t) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Statvfs(path string, vfsstat *Statvfs_t) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStatvfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func Symlink(path string, link string) (err error) {
|
func Symlink(path string, link string) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -1441,7 +1468,7 @@ func Utime(path string, buf *Utimbuf) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procbind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
@@ -1449,7 +1476,7 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procconnect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
@@ -1478,7 +1505,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
|
|||||||
if len(buf) > 0 {
|
if len(buf) > 0 {
|
||||||
_p0 = &buf[0]
|
_p0 = &buf[0]
|
||||||
}
|
}
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
@@ -1486,7 +1513,7 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
func socket(domain int, typ int, proto int) (fd int, err error) {
|
func socket(domain int, typ int, proto int) (fd int, err error) {
|
||||||
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsocket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
|
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
|
||||||
fd = int(r0)
|
fd = int(r0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
@@ -1495,7 +1522,7 @@ func socket(domain int, typ int, proto int) (fd int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
||||||
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsocketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
@@ -1516,7 +1543,7 @@ func write(fd int, p []byte) (n int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
err = e1
|
err = e1
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-5
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_dragonfly.pl
|
// mksysnum_dragonfly.pl
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,dragonfly
|
// +build amd64,dragonfly
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ const (
|
|||||||
SYS_SYNC = 36 // { int sync(void); }
|
SYS_SYNC = 36 // { int sync(void); }
|
||||||
SYS_KILL = 37 // { int kill(int pid, int signum); }
|
SYS_KILL = 37 // { int kill(int pid, int signum); }
|
||||||
SYS_GETPPID = 39 // { pid_t getppid(void); }
|
SYS_GETPPID = 39 // { pid_t getppid(void); }
|
||||||
SYS_DUP = 41 // { int dup(u_int fd); }
|
SYS_DUP = 41 // { int dup(int fd); }
|
||||||
SYS_PIPE = 42 // { int pipe(void); }
|
SYS_PIPE = 42 // { int pipe(void); }
|
||||||
SYS_GETEGID = 43 // { gid_t getegid(void); }
|
SYS_GETEGID = 43 // { gid_t getegid(void); }
|
||||||
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \
|
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \
|
||||||
@@ -76,7 +76,7 @@ const (
|
|||||||
SYS_SWAPON = 85 // { int swapon(char *name); }
|
SYS_SWAPON = 85 // { int swapon(char *name); }
|
||||||
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
|
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
|
||||||
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
|
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
|
||||||
SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); }
|
SYS_DUP2 = 90 // { int dup2(int from, int to); }
|
||||||
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
|
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
|
||||||
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \
|
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \
|
||||||
SYS_FSYNC = 95 // { int fsync(int fd); }
|
SYS_FSYNC = 95 // { int fsync(int fd); }
|
||||||
@@ -144,7 +144,7 @@ const (
|
|||||||
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \
|
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \
|
||||||
SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, \
|
SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, \
|
||||||
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
|
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
|
||||||
SYS_MSGSND = 226 // { int msgsnd(int msqid, void *msgp, size_t msgsz, \
|
SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, \
|
||||||
SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \
|
SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \
|
||||||
SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \
|
SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \
|
||||||
SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, \
|
SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, \
|
||||||
@@ -224,7 +224,7 @@ const (
|
|||||||
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
|
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
|
||||||
SYS_KQUEUE = 362 // { int kqueue(void); }
|
SYS_KQUEUE = 362 // { int kqueue(void); }
|
||||||
SYS_KEVENT = 363 // { int kevent(int fd, \
|
SYS_KEVENT = 363 // { int kevent(int fd, \
|
||||||
SYS_SCTP_PEELOFF = 364 // { int sctp_peeloff(int sd, caddr_t name ); }
|
SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); }
|
||||||
SYS_LCHFLAGS = 391 // { int lchflags(char *path, int flags); }
|
SYS_LCHFLAGS = 391 // { int lchflags(char *path, int flags); }
|
||||||
SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); }
|
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, \
|
SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \
|
||||||
@@ -301,4 +301,15 @@ const (
|
|||||||
SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); }
|
SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); }
|
||||||
SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }
|
SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); }
|
||||||
SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }
|
SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); }
|
||||||
|
SYS_PROCCTL = 536 // { int procctl(idtype_t idtype, id_t id, int cmd, void *data); }
|
||||||
|
SYS_CHFLAGSAT = 537 // { int chflagsat(int fd, const char *path, int flags, int atflags);}
|
||||||
|
SYS_PIPE2 = 538 // { int pipe2(int *fildes, int flags); }
|
||||||
|
SYS_UTIMENSAT = 539 // { int utimensat(int fd, const char *path, const struct timespec *ts, int flags); }
|
||||||
|
SYS_FUTIMENS = 540 // { int futimens(int fd, const struct timespec *ts); }
|
||||||
|
SYS_ACCEPT4 = 541 // { int accept4(int s, caddr_t name, int *anamelen, int flags); }
|
||||||
|
SYS_LWP_SETNAME = 542 // { int lwp_setname(lwpid_t tid, const char *name); }
|
||||||
|
SYS_PPOLL = 543 // { int ppoll(struct pollfd *fds, u_int nfds, \
|
||||||
|
SYS_LWP_SETAFFINITY = 544 // { int lwp_setaffinity(pid_t pid, lwpid_t tid, const cpumask_t *mask); }
|
||||||
|
SYS_LWP_GETAFFINITY = 545 // { int lwp_getaffinity(pid_t pid, lwpid_t tid, cpumask_t *mask); }
|
||||||
|
SYS_LWP_CREATE2 = 546 // { int lwp_create2(struct lwp_params *params, const cpumask_t *mask); }
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m32 -D__i386__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,linux
|
// +build 386,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,linux
|
// +build amd64,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m32 -D__ARM_EABI__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build arm,linux
|
// +build arm,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build arm64,linux
|
// +build arm64,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m32 -D_MIPS_SIM=_MIPS_SIM_ABI32 -D__MIPSEB__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build mips,linux
|
// +build mips,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 -D_MIPS_SIM=_MIPS_SIM_ABI64 -D__MIPSEB__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build mips64,linux
|
// +build mips64,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 -D_MIPS_SIM=_MIPS_SIM_ABI64 -D__MIPSEL__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build mips64le,linux
|
// +build mips64le,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m32 -D_MIPS_SIM=_MIPS_SIM_ABI32 -D__MIPSEL__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build mipsle,linux
|
// +build mipsle,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 -D__powerpc64__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build ppc64,linux
|
// +build ppc64,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 -D__powerpc64__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build ppc64le,linux
|
// +build ppc64le,linux
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// mksysnum_linux.pl -Ilinux/usr/include -m64 -D__s390x__ linux/usr/include/asm/unistd.h
|
// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h
|
||||||
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build s390x,linux
|
// +build s390x,linux
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
// Created by cgo -godefs - DO NOT EDIT
|
// cgo -godefs types_dragonfly.go | go run mkpost.go
|
||||||
// cgo -godefs types_dragonfly.go
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,dragonfly
|
// +build amd64,dragonfly
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ type IfData struct {
|
|||||||
Iqdrops uint64
|
Iqdrops uint64
|
||||||
Noproto uint64
|
Noproto uint64
|
||||||
Hwassist uint64
|
Hwassist uint64
|
||||||
Unused uint64
|
Oqdrops uint64
|
||||||
Lastchange Timeval
|
Lastchange Timeval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-9
@@ -1,6 +1,7 @@
|
|||||||
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,linux
|
// +build 386,linux
|
||||||
// Created by cgo -godefs - DO NOT EDIT
|
|
||||||
// cgo -godefs types_linux.go
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
@@ -151,6 +152,26 @@ type Flock_t struct {
|
|||||||
Pid int32
|
Pid int32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type FscryptPolicy struct {
|
||||||
|
Version uint8
|
||||||
|
Contents_encryption_mode uint8
|
||||||
|
Filenames_encryption_mode uint8
|
||||||
|
Flags uint8
|
||||||
|
Master_key_descriptor [8]uint8
|
||||||
|
}
|
||||||
|
|
||||||
|
type FscryptKey struct {
|
||||||
|
Mode uint32
|
||||||
|
Raw [64]uint8
|
||||||
|
Size uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
type KeyctlDHParams struct {
|
||||||
|
Private int32
|
||||||
|
Prime int32
|
||||||
|
Base int32
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
FADV_NORMAL = 0x0
|
FADV_NORMAL = 0x0
|
||||||
FADV_RANDOM = 0x1
|
FADV_RANDOM = 0x1
|
||||||
@@ -275,10 +296,9 @@ type Msghdr struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Cmsghdr struct {
|
type Cmsghdr struct {
|
||||||
Len uint32
|
Len uint32
|
||||||
Level int32
|
Level int32
|
||||||
Type int32
|
Type int32
|
||||||
X__cmsg_data [0]uint8
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Inet4Pktinfo struct {
|
type Inet4Pktinfo struct {
|
||||||
@@ -396,7 +416,7 @@ const (
|
|||||||
IFLA_LINKINFO = 0x12
|
IFLA_LINKINFO = 0x12
|
||||||
IFLA_NET_NS_PID = 0x13
|
IFLA_NET_NS_PID = 0x13
|
||||||
IFLA_IFALIAS = 0x14
|
IFLA_IFALIAS = 0x14
|
||||||
IFLA_MAX = 0x1d
|
IFLA_MAX = 0x2b
|
||||||
RT_SCOPE_UNIVERSE = 0x0
|
RT_SCOPE_UNIVERSE = 0x0
|
||||||
RT_SCOPE_SITE = 0xc8
|
RT_SCOPE_SITE = 0xc8
|
||||||
RT_SCOPE_LINK = 0xfd
|
RT_SCOPE_LINK = 0xfd
|
||||||
@@ -546,7 +566,6 @@ type InotifyEvent struct {
|
|||||||
Mask uint32
|
Mask uint32
|
||||||
Cookie uint32
|
Cookie uint32
|
||||||
Len uint32
|
Len uint32
|
||||||
Name [0]int8
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const SizeofInotifyEvent = 0x10
|
const SizeofInotifyEvent = 0x10
|
||||||
@@ -638,9 +657,13 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Sigset_t struct {
|
type Sigset_t struct {
|
||||||
X__val [16]uint64
|
X__val [32]uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const RNDGETENTCNT = 0x80045200
|
||||||
|
|
||||||
|
const _SC_PAGESIZE = 0x1e
|
||||||
|
|
||||||
type Termios struct {
|
type Termios struct {
|
||||||
Iflag uint32
|
Iflag uint32
|
||||||
Oflag uint32
|
Oflag uint32
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user