@@ -6,7 +6,7 @@ require ( | |||
github.com/globocom/go-redis-prometheus v0.4.0 | |||
github.com/go-redis/redis/v8 v8.11.5 | |||
github.com/gorilla/mux v1.8.0 | |||
github.com/prometheus/client_golang v1.12.2 | |||
github.com/prometheus/client_golang v1.13.0 | |||
github.com/tevino/abool/v2 v2.1.0 | |||
) | |||
@@ -15,10 +15,10 @@ require ( | |||
github.com/cespare/xxhash/v2 v2.1.2 // indirect | |||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | |||
github.com/golang/protobuf v1.5.2 // indirect | |||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | |||
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect | |||
github.com/prometheus/client_model v0.2.0 // indirect | |||
github.com/prometheus/common v0.37.0 // indirect | |||
github.com/prometheus/procfs v0.8.0 // indirect | |||
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect | |||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect | |||
google.golang.org/protobuf v1.28.1 // indirect | |||
) |
@@ -245,6 +245,8 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx | |||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= | |||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= | |||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= | |||
github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM= | |||
github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= | |||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= | |||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= | |||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= | |||
@@ -314,6 +316,8 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr | |||
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= | |||
github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= | |||
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= | |||
github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= | |||
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= | |||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= | |||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= | |||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= | |||
@@ -540,6 +544,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc | |||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | |||
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= | |||
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | |||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 h1:k5II8e6QD8mITdi+okbbmR/cIyEbeXLBhy5Ha4nevyc= | |||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | |||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | |||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | |||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | |||
@@ -69,9 +69,9 @@ type Collector interface { | |||
// If a Collector collects the same metrics throughout its lifetime, its | |||
// Describe method can simply be implemented as: | |||
// | |||
// func (c customCollector) Describe(ch chan<- *Desc) { | |||
// DescribeByCollect(c, ch) | |||
// } | |||
// func (c customCollector) Describe(ch chan<- *Desc) { | |||
// DescribeByCollect(c, ch) | |||
// } | |||
// | |||
// However, this will not work if the metrics collected change dynamically over | |||
// the lifetime of the Collector in a way that their combined set of descriptors | |||
@@ -51,7 +51,7 @@ type Counter interface { | |||
// will lead to a valid (label-less) exemplar. But if Labels is nil, the current | |||
// exemplar is left in place. AddWithExemplar panics if the value is < 0, if any | |||
// of the provided labels are invalid, or if the provided labels contain more | |||
// than 64 runes in total. | |||
// than 128 runes in total. | |||
type ExemplarAdder interface { | |||
AddWithExemplar(value float64, exemplar Labels) | |||
} | |||
@@ -20,6 +20,9 @@ import ( | |||
"strings" | |||
"github.com/cespare/xxhash/v2" | |||
"github.com/prometheus/client_golang/prometheus/internal" | |||
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. | |||
"github.com/golang/protobuf/proto" | |||
"github.com/prometheus/common/model" | |||
@@ -154,7 +157,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * | |||
Value: proto.String(v), | |||
}) | |||
} | |||
sort.Sort(labelPairSorter(d.constLabelPairs)) | |||
sort.Sort(internal.LabelPairSorter(d.constLabelPairs)) | |||
return d | |||
} | |||
@@ -0,0 +1,26 @@ | |||
// Copyright 2015 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build !js || wasm | |||
// +build !js wasm | |||
package prometheus | |||
import "os" | |||
func getPIDFn() func() (int, error) { | |||
pid := os.Getpid() | |||
return func() (int, error) { | |||
return pid, nil | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
// Copyright 2015 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build js && !wasm | |||
// +build js,!wasm | |||
package prometheus | |||
func getPIDFn() func() (int, error) { | |||
return func() (int, error) { | |||
return 1, nil | |||
} | |||
} |
@@ -19,6 +19,10 @@ import ( | |||
"time" | |||
) | |||
// goRuntimeMemStats provides the metrics initially provided by runtime.ReadMemStats. | |||
// From Go 1.17 those similar (and better) statistics are provided by runtime/metrics, so | |||
// while eval closure works on runtime.MemStats, the struct from Go 1.17+ is | |||
// populated using runtime/metrics. | |||
func goRuntimeMemStats() memStatsMetrics { | |||
return memStatsMetrics{ | |||
{ | |||
@@ -224,7 +228,7 @@ func newBaseGoCollector() baseGoCollector { | |||
"A summary of the pause duration of garbage collection cycles.", | |||
nil, nil), | |||
gcLastTimeDesc: NewDesc( | |||
memstatNamespace("last_gc_time_seconds"), | |||
"go_memstats_last_gc_time_seconds", | |||
"Number of seconds since 1970 of last garbage collection.", | |||
nil, nil), | |||
goInfoDesc: NewDesc( | |||
@@ -246,8 +250,9 @@ func (c *baseGoCollector) Describe(ch chan<- *Desc) { | |||
// Collect returns the current state of all metrics of the collector. | |||
func (c *baseGoCollector) Collect(ch chan<- Metric) { | |||
ch <- MustNewConstMetric(c.goroutinesDesc, GaugeValue, float64(runtime.NumGoroutine())) | |||
n, _ := runtime.ThreadCreateProfile(nil) | |||
ch <- MustNewConstMetric(c.threadsDesc, GaugeValue, float64(n)) | |||
n := getRuntimeNumThreads() | |||
ch <- MustNewConstMetric(c.threadsDesc, GaugeValue, n) | |||
var stats debug.GCStats | |||
stats.PauseQuantiles = make([]time.Duration, 5) | |||
@@ -269,7 +274,6 @@ func memstatNamespace(s string) string { | |||
// memStatsMetrics provide description, evaluator, runtime/metrics name, and | |||
// value type for memstat metrics. | |||
// TODO(bwplotka): Remove with end Go 1.16 EOL and replace with runtime/metrics.Description | |||
type memStatsMetrics []struct { | |||
desc *Desc | |||
eval func(*runtime.MemStats) float64 | |||
@@ -31,9 +31,11 @@ import ( | |||
) | |||
const ( | |||
// constants for strings referenced more than once. | |||
goGCHeapTinyAllocsObjects = "/gc/heap/tiny/allocs:objects" | |||
goGCHeapAllocsObjects = "/gc/heap/allocs:objects" | |||
goGCHeapFreesObjects = "/gc/heap/frees:objects" | |||
goGCHeapFreesBytes = "/gc/heap/frees:bytes" | |||
goGCHeapAllocsBytes = "/gc/heap/allocs:bytes" | |||
goGCHeapObjects = "/gc/heap/objects:objects" | |||
goGCHeapGoalBytes = "/gc/heap/goal:bytes" | |||
@@ -53,8 +55,9 @@ const ( | |||
goMemoryClassesOtherBytes = "/memory/classes/other:bytes" | |||
) | |||
// runtime/metrics names required for runtimeMemStats like logic. | |||
var rmForMemStats = []string{goGCHeapTinyAllocsObjects, | |||
// rmNamesForMemStatsMetrics represents runtime/metrics names required to populate goRuntimeMemStats from like logic. | |||
var rmNamesForMemStatsMetrics = []string{ | |||
goGCHeapTinyAllocsObjects, | |||
goGCHeapAllocsObjects, | |||
goGCHeapFreesObjects, | |||
goGCHeapAllocsBytes, | |||
@@ -89,74 +92,90 @@ func bestEffortLookupRM(lookup []string) []metrics.Description { | |||
} | |||
type goCollector struct { | |||
opt GoCollectorOptions | |||
base baseGoCollector | |||
// mu protects updates to all fields ensuring a consistent | |||
// snapshot is always produced by Collect. | |||
mu sync.Mutex | |||
// rm... fields all pertain to the runtime/metrics package. | |||
rmSampleBuf []metrics.Sample | |||
rmSampleMap map[string]*metrics.Sample | |||
rmMetrics []collectorMetric | |||
// Contains all samples that has to retrieved from runtime/metrics (not all of them will be exposed). | |||
sampleBuf []metrics.Sample | |||
// sampleMap allows lookup for MemStats metrics and runtime/metrics histograms for exact sums. | |||
sampleMap map[string]*metrics.Sample | |||
// rmExposedMetrics represents all runtime/metrics package metrics | |||
// that were configured to be exposed. | |||
rmExposedMetrics []collectorMetric | |||
rmExactSumMapForHist map[string]string | |||
// With Go 1.17, the runtime/metrics package was introduced. | |||
// From that point on, metric names produced by the runtime/metrics | |||
// package could be generated from runtime/metrics names. However, | |||
// these differ from the old names for the same values. | |||
// | |||
// This field exist to export the same values under the old names | |||
// This field exists to export the same values under the old names | |||
// as well. | |||
msMetrics memStatsMetrics | |||
msMetrics memStatsMetrics | |||
msMetricsEnabled bool | |||
} | |||
const ( | |||
// Those are not exposed due to need to move Go collector to another package in v2. | |||
// See issue https://github.com/prometheus/client_golang/issues/1030. | |||
goRuntimeMemStatsCollection uint32 = 1 << iota | |||
goRuntimeMetricsCollection | |||
) | |||
// GoCollectorOptions should not be used be directly by anything, except `collectors` package. | |||
// Use it via collectors package instead. See issue | |||
// https://github.com/prometheus/client_golang/issues/1030. | |||
// | |||
// Deprecated: Use collectors.WithGoCollections | |||
type GoCollectorOptions struct { | |||
// EnabledCollection sets what type of collections collector should expose on top of base collection. | |||
// By default it's goMemStatsCollection | goRuntimeMetricsCollection. | |||
EnabledCollections uint32 | |||
type rmMetricDesc struct { | |||
metrics.Description | |||
} | |||
func (c GoCollectorOptions) isEnabled(flag uint32) bool { | |||
return c.EnabledCollections&flag != 0 | |||
func matchRuntimeMetricsRules(rules []internal.GoCollectorRule) []rmMetricDesc { | |||
var descs []rmMetricDesc | |||
for _, d := range metrics.All() { | |||
var ( | |||
deny = true | |||
desc rmMetricDesc | |||
) | |||
for _, r := range rules { | |||
if !r.Matcher.MatchString(d.Name) { | |||
continue | |||
} | |||
deny = r.Deny | |||
} | |||
if deny { | |||
continue | |||
} | |||
desc.Description = d | |||
descs = append(descs, desc) | |||
} | |||
return descs | |||
} | |||
const defaultGoCollections = goRuntimeMemStatsCollection | |||
func defaultGoCollectorOptions() internal.GoCollectorOptions { | |||
return internal.GoCollectorOptions{ | |||
RuntimeMetricSumForHist: map[string]string{ | |||
"/gc/heap/allocs-by-size:bytes": goGCHeapAllocsBytes, | |||
"/gc/heap/frees-by-size:bytes": goGCHeapFreesBytes, | |||
}, | |||
RuntimeMetricRules: []internal.GoCollectorRule{ | |||
//{Matcher: regexp.MustCompile("")}, | |||
}, | |||
} | |||
} | |||
// NewGoCollector is the obsolete version of collectors.NewGoCollector. | |||
// See there for documentation. | |||
// | |||
// Deprecated: Use collectors.NewGoCollector instead. | |||
func NewGoCollector(opts ...func(o *GoCollectorOptions)) Collector { | |||
opt := GoCollectorOptions{EnabledCollections: defaultGoCollections} | |||
func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector { | |||
opt := defaultGoCollectorOptions() | |||
for _, o := range opts { | |||
o(&opt) | |||
} | |||
var descriptions []metrics.Description | |||
if opt.isEnabled(goRuntimeMetricsCollection) { | |||
descriptions = metrics.All() | |||
} else if opt.isEnabled(goRuntimeMemStatsCollection) { | |||
descriptions = bestEffortLookupRM(rmForMemStats) | |||
} | |||
exposedDescriptions := matchRuntimeMetricsRules(opt.RuntimeMetricRules) | |||
// Collect all histogram samples so that we can get their buckets. | |||
// The API guarantees that the buckets are always fixed for the lifetime | |||
// of the process. | |||
var histograms []metrics.Sample | |||
for _, d := range descriptions { | |||
for _, d := range exposedDescriptions { | |||
if d.Kind == metrics.KindFloat64Histogram { | |||
histograms = append(histograms, metrics.Sample{Name: d.Name}) | |||
} | |||
@@ -171,13 +190,14 @@ func NewGoCollector(opts ...func(o *GoCollectorOptions)) Collector { | |||
bucketsMap[histograms[i].Name] = histograms[i].Value.Float64Histogram().Buckets | |||
} | |||
// Generate a Desc and ValueType for each runtime/metrics metric. | |||
metricSet := make([]collectorMetric, 0, len(descriptions)) | |||
sampleBuf := make([]metrics.Sample, 0, len(descriptions)) | |||
sampleMap := make(map[string]*metrics.Sample, len(descriptions)) | |||
for i := range descriptions { | |||
d := &descriptions[i] | |||
namespace, subsystem, name, ok := internal.RuntimeMetricsToProm(d) | |||
// Generate a collector for each exposed runtime/metrics metric. | |||
metricSet := make([]collectorMetric, 0, len(exposedDescriptions)) | |||
// SampleBuf is used for reading from runtime/metrics. | |||
// We are assuming the largest case to have stable pointers for sampleMap purposes. | |||
sampleBuf := make([]metrics.Sample, 0, len(exposedDescriptions)+len(opt.RuntimeMetricSumForHist)+len(rmNamesForMemStatsMetrics)) | |||
sampleMap := make(map[string]*metrics.Sample, len(exposedDescriptions)) | |||
for _, d := range exposedDescriptions { | |||
namespace, subsystem, name, ok := internal.RuntimeMetricsToProm(&d.Description) | |||
if !ok { | |||
// Just ignore this metric; we can't do anything with it here. | |||
// If a user decides to use the latest version of Go, we don't want | |||
@@ -185,19 +205,17 @@ func NewGoCollector(opts ...func(o *GoCollectorOptions)) Collector { | |||
continue | |||
} | |||
// Set up sample buffer for reading, and a map | |||
// for quick lookup of sample values. | |||
sampleBuf = append(sampleBuf, metrics.Sample{Name: d.Name}) | |||
sampleMap[d.Name] = &sampleBuf[len(sampleBuf)-1] | |||
var m collectorMetric | |||
if d.Kind == metrics.KindFloat64Histogram { | |||
_, hasSum := rmExactSumMap[d.Name] | |||
_, hasSum := opt.RuntimeMetricSumForHist[d.Name] | |||
unit := d.Name[strings.IndexRune(d.Name, ':')+1:] | |||
m = newBatchHistogram( | |||
NewDesc( | |||
BuildFQName(namespace, subsystem, name), | |||
d.Description, | |||
d.Description.Description, | |||
nil, | |||
nil, | |||
), | |||
@@ -209,30 +227,61 @@ func NewGoCollector(opts ...func(o *GoCollectorOptions)) Collector { | |||
Namespace: namespace, | |||
Subsystem: subsystem, | |||
Name: name, | |||
Help: d.Description, | |||
}) | |||
Help: d.Description.Description, | |||
}, | |||
) | |||
} else { | |||
m = NewGauge(GaugeOpts{ | |||
Namespace: namespace, | |||
Subsystem: subsystem, | |||
Name: name, | |||
Help: d.Description, | |||
Help: d.Description.Description, | |||
}) | |||
} | |||
metricSet = append(metricSet, m) | |||
} | |||
var msMetrics memStatsMetrics | |||
if opt.isEnabled(goRuntimeMemStatsCollection) { | |||
// Add exact sum metrics to sampleBuf if not added before. | |||
for _, h := range histograms { | |||
sumMetric, ok := opt.RuntimeMetricSumForHist[h.Name] | |||
if !ok { | |||
continue | |||
} | |||
if _, ok := sampleMap[sumMetric]; ok { | |||
continue | |||
} | |||
sampleBuf = append(sampleBuf, metrics.Sample{Name: sumMetric}) | |||
sampleMap[sumMetric] = &sampleBuf[len(sampleBuf)-1] | |||
} | |||
var ( | |||
msMetrics memStatsMetrics | |||
msDescriptions []metrics.Description | |||
) | |||
if !opt.DisableMemStatsLikeMetrics { | |||
msMetrics = goRuntimeMemStats() | |||
msDescriptions = bestEffortLookupRM(rmNamesForMemStatsMetrics) | |||
// Check if metric was not exposed before and if not, add to sampleBuf. | |||
for _, mdDesc := range msDescriptions { | |||
if _, ok := sampleMap[mdDesc.Name]; ok { | |||
continue | |||
} | |||
sampleBuf = append(sampleBuf, metrics.Sample{Name: mdDesc.Name}) | |||
sampleMap[mdDesc.Name] = &sampleBuf[len(sampleBuf)-1] | |||
} | |||
} | |||
return &goCollector{ | |||
opt: opt, | |||
base: newBaseGoCollector(), | |||
rmSampleBuf: sampleBuf, | |||
rmSampleMap: sampleMap, | |||
rmMetrics: metricSet, | |||
msMetrics: msMetrics, | |||
base: newBaseGoCollector(), | |||
sampleBuf: sampleBuf, | |||
sampleMap: sampleMap, | |||
rmExposedMetrics: metricSet, | |||
rmExactSumMapForHist: opt.RuntimeMetricSumForHist, | |||
msMetrics: msMetrics, | |||
msMetricsEnabled: !opt.DisableMemStatsLikeMetrics, | |||
} | |||
} | |||
@@ -242,7 +291,7 @@ func (c *goCollector) Describe(ch chan<- *Desc) { | |||
for _, i := range c.msMetrics { | |||
ch <- i.desc | |||
} | |||
for _, m := range c.rmMetrics { | |||
for _, m := range c.rmExposedMetrics { | |||
ch <- m.Desc() | |||
} | |||
} | |||
@@ -252,8 +301,12 @@ func (c *goCollector) Collect(ch chan<- Metric) { | |||
// Collect base non-memory metrics. | |||
c.base.Collect(ch) | |||
if len(c.sampleBuf) == 0 { | |||
return | |||
} | |||
// Collect must be thread-safe, so prevent concurrent use of | |||
// rmSampleBuf. Just read into rmSampleBuf but write all the data | |||
// sampleBuf elements. Just read into sampleBuf but write all the data | |||
// we get into our Metrics or MemStats. | |||
// | |||
// This lock also ensures that the Metrics we send out are all from | |||
@@ -267,44 +320,43 @@ func (c *goCollector) Collect(ch chan<- Metric) { | |||
c.mu.Lock() | |||
defer c.mu.Unlock() | |||
if len(c.rmSampleBuf) > 0 { | |||
// Populate runtime/metrics sample buffer. | |||
metrics.Read(c.rmSampleBuf) | |||
} | |||
if c.opt.isEnabled(goRuntimeMetricsCollection) { | |||
// Collect all our metrics from rmSampleBuf. | |||
for i, sample := range c.rmSampleBuf { | |||
// N.B. switch on concrete type because it's significantly more efficient | |||
// than checking for the Counter and Gauge interface implementations. In | |||
// this case, we control all the types here. | |||
switch m := c.rmMetrics[i].(type) { | |||
case *counter: | |||
// Guard against decreases. This should never happen, but a failure | |||
// to do so will result in a panic, which is a harsh consequence for | |||
// a metrics collection bug. | |||
v0, v1 := m.get(), unwrapScalarRMValue(sample.Value) | |||
if v1 > v0 { | |||
m.Add(unwrapScalarRMValue(sample.Value) - m.get()) | |||
} | |||
m.Collect(ch) | |||
case *gauge: | |||
m.Set(unwrapScalarRMValue(sample.Value)) | |||
m.Collect(ch) | |||
case *batchHistogram: | |||
m.update(sample.Value.Float64Histogram(), c.exactSumFor(sample.Name)) | |||
m.Collect(ch) | |||
default: | |||
panic("unexpected metric type") | |||
// Populate runtime/metrics sample buffer. | |||
metrics.Read(c.sampleBuf) | |||
// Collect all our runtime/metrics user chose to expose from sampleBuf (if any). | |||
for i, metric := range c.rmExposedMetrics { | |||
// We created samples for exposed metrics first in order, so indexes match. | |||
sample := c.sampleBuf[i] | |||
// N.B. switch on concrete type because it's significantly more efficient | |||
// than checking for the Counter and Gauge interface implementations. In | |||
// this case, we control all the types here. | |||
switch m := metric.(type) { | |||
case *counter: | |||
// Guard against decreases. This should never happen, but a failure | |||
// to do so will result in a panic, which is a harsh consequence for | |||
// a metrics collection bug. | |||
v0, v1 := m.get(), unwrapScalarRMValue(sample.Value) | |||
if v1 > v0 { | |||
m.Add(unwrapScalarRMValue(sample.Value) - m.get()) | |||
} | |||
m.Collect(ch) | |||
case *gauge: | |||
m.Set(unwrapScalarRMValue(sample.Value)) | |||
m.Collect(ch) | |||
case *batchHistogram: | |||
m.update(sample.Value.Float64Histogram(), c.exactSumFor(sample.Name)) | |||
m.Collect(ch) | |||
default: | |||
panic("unexpected metric type") | |||
} | |||
} | |||
// ms is a dummy MemStats that we populate ourselves so that we can | |||
// populate the old metrics from it if goMemStatsCollection is enabled. | |||
if c.opt.isEnabled(goRuntimeMemStatsCollection) { | |||
if c.msMetricsEnabled { | |||
// ms is a dummy MemStats that we populate ourselves so that we can | |||
// populate the old metrics from it if goMemStatsCollection is enabled. | |||
var ms runtime.MemStats | |||
memStatsFromRM(&ms, c.rmSampleMap) | |||
memStatsFromRM(&ms, c.sampleMap) | |||
for _, i := range c.msMetrics { | |||
ch <- MustNewConstMetric(i.desc, i.valType, i.eval(&ms)) | |||
} | |||
@@ -335,11 +387,6 @@ func unwrapScalarRMValue(v metrics.Value) float64 { | |||
} | |||
} | |||
var rmExactSumMap = map[string]string{ | |||
"/gc/heap/allocs-by-size:bytes": "/gc/heap/allocs:bytes", | |||
"/gc/heap/frees-by-size:bytes": "/gc/heap/frees:bytes", | |||
} | |||
// exactSumFor takes a runtime/metrics metric name (that is assumed to | |||
// be of kind KindFloat64Histogram) and returns its exact sum and whether | |||
// its exact sum exists. | |||
@@ -347,11 +394,11 @@ var rmExactSumMap = map[string]string{ | |||
// The runtime/metrics API for histograms doesn't currently expose exact | |||
// sums, but some of the other metrics are in fact exact sums of histograms. | |||
func (c *goCollector) exactSumFor(rmName string) float64 { | |||
sumName, ok := rmExactSumMap[rmName] | |||
sumName, ok := c.rmExactSumMapForHist[rmName] | |||
if !ok { | |||
return 0 | |||
} | |||
s, ok := c.rmSampleMap[sumName] | |||
s, ok := c.sampleMap[sumName] | |||
if !ok { | |||
return 0 | |||
} | |||
@@ -581,11 +581,11 @@ func (h *constHistogram) Desc() *Desc { | |||
func (h *constHistogram) Write(out *dto.Metric) error { | |||
his := &dto.Histogram{} | |||
buckets := make([]*dto.Bucket, 0, len(h.buckets)) | |||
his.SampleCount = proto.Uint64(h.count) | |||
his.SampleSum = proto.Float64(h.sum) | |||
for upperBound, count := range h.buckets { | |||
buckets = append(buckets, &dto.Bucket{ | |||
CumulativeCount: proto.Uint64(count), | |||
@@ -0,0 +1,651 @@ | |||
// Copyright 2022 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
// | |||
// It provides tools to compare sequences of strings and generate textual diffs. | |||
// | |||
// Maintaining `GetUnifiedDiffString` here because original repository | |||
// (https://github.com/pmezard/go-difflib) is no loger maintained. | |||
package internal | |||
import ( | |||
"bufio" | |||
"bytes" | |||
"fmt" | |||
"io" | |||
"strings" | |||
) | |||
func min(a, b int) int { | |||
if a < b { | |||
return a | |||
} | |||
return b | |||
} | |||
func max(a, b int) int { | |||
if a > b { | |||
return a | |||
} | |||
return b | |||
} | |||
func calculateRatio(matches, length int) float64 { | |||
if length > 0 { | |||
return 2.0 * float64(matches) / float64(length) | |||
} | |||
return 1.0 | |||
} | |||
type Match struct { | |||
A int | |||
B int | |||
Size int | |||
} | |||
type OpCode struct { | |||
Tag byte | |||
I1 int | |||
I2 int | |||
J1 int | |||
J2 int | |||
} | |||
// SequenceMatcher compares sequence of strings. The basic | |||
// algorithm predates, and is a little fancier than, an algorithm | |||
// published in the late 1980's by Ratcliff and Obershelp under the | |||
// hyperbolic name "gestalt pattern matching". The basic idea is to find | |||
// the longest contiguous matching subsequence that contains no "junk" | |||
// elements (R-O doesn't address junk). The same idea is then applied | |||
// recursively to the pieces of the sequences to the left and to the right | |||
// of the matching subsequence. This does not yield minimal edit | |||
// sequences, but does tend to yield matches that "look right" to people. | |||
// | |||
// SequenceMatcher tries to compute a "human-friendly diff" between two | |||
// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the | |||
// longest *contiguous* & junk-free matching subsequence. That's what | |||
// catches peoples' eyes. The Windows(tm) windiff has another interesting | |||
// notion, pairing up elements that appear uniquely in each sequence. | |||
// That, and the method here, appear to yield more intuitive difference | |||
// reports than does diff. This method appears to be the least vulnerable | |||
// to synching up on blocks of "junk lines", though (like blank lines in | |||
// ordinary text files, or maybe "<P>" lines in HTML files). That may be | |||
// because this is the only method of the 3 that has a *concept* of | |||
// "junk" <wink>. | |||
// | |||
// Timing: Basic R-O is cubic time worst case and quadratic time expected | |||
// case. SequenceMatcher is quadratic time for the worst case and has | |||
// expected-case behavior dependent in a complicated way on how many | |||
// elements the sequences have in common; best case time is linear. | |||
type SequenceMatcher struct { | |||
a []string | |||
b []string | |||
b2j map[string][]int | |||
IsJunk func(string) bool | |||
autoJunk bool | |||
bJunk map[string]struct{} | |||
matchingBlocks []Match | |||
fullBCount map[string]int | |||
bPopular map[string]struct{} | |||
opCodes []OpCode | |||
} | |||
func NewMatcher(a, b []string) *SequenceMatcher { | |||
m := SequenceMatcher{autoJunk: true} | |||
m.SetSeqs(a, b) | |||
return &m | |||
} | |||
func NewMatcherWithJunk(a, b []string, autoJunk bool, | |||
isJunk func(string) bool, | |||
) *SequenceMatcher { | |||
m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} | |||
m.SetSeqs(a, b) | |||
return &m | |||
} | |||
// Set two sequences to be compared. | |||
func (m *SequenceMatcher) SetSeqs(a, b []string) { | |||
m.SetSeq1(a) | |||
m.SetSeq2(b) | |||
} | |||
// Set the first sequence to be compared. The second sequence to be compared is | |||
// not changed. | |||
// | |||
// SequenceMatcher computes and caches detailed information about the second | |||
// sequence, so if you want to compare one sequence S against many sequences, | |||
// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other | |||
// sequences. | |||
// | |||
// See also SetSeqs() and SetSeq2(). | |||
func (m *SequenceMatcher) SetSeq1(a []string) { | |||
if &a == &m.a { | |||
return | |||
} | |||
m.a = a | |||
m.matchingBlocks = nil | |||
m.opCodes = nil | |||
} | |||
// Set the second sequence to be compared. The first sequence to be compared is | |||
// not changed. | |||
func (m *SequenceMatcher) SetSeq2(b []string) { | |||
if &b == &m.b { | |||
return | |||
} | |||
m.b = b | |||
m.matchingBlocks = nil | |||
m.opCodes = nil | |||
m.fullBCount = nil | |||
m.chainB() | |||
} | |||
func (m *SequenceMatcher) chainB() { | |||
// Populate line -> index mapping | |||
b2j := map[string][]int{} | |||
for i, s := range m.b { | |||
indices := b2j[s] | |||
indices = append(indices, i) | |||
b2j[s] = indices | |||
} | |||
// Purge junk elements | |||
m.bJunk = map[string]struct{}{} | |||
if m.IsJunk != nil { | |||
junk := m.bJunk | |||
for s := range b2j { | |||
if m.IsJunk(s) { | |||
junk[s] = struct{}{} | |||
} | |||
} | |||
for s := range junk { | |||
delete(b2j, s) | |||
} | |||
} | |||
// Purge remaining popular elements | |||
popular := map[string]struct{}{} | |||
n := len(m.b) | |||
if m.autoJunk && n >= 200 { | |||
ntest := n/100 + 1 | |||
for s, indices := range b2j { | |||
if len(indices) > ntest { | |||
popular[s] = struct{}{} | |||
} | |||
} | |||
for s := range popular { | |||
delete(b2j, s) | |||
} | |||
} | |||
m.bPopular = popular | |||
m.b2j = b2j | |||
} | |||
func (m *SequenceMatcher) isBJunk(s string) bool { | |||
_, ok := m.bJunk[s] | |||
return ok | |||
} | |||
// Find longest matching block in a[alo:ahi] and b[blo:bhi]. | |||
// | |||
// If IsJunk is not defined: | |||
// | |||
// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where | |||
// alo <= i <= i+k <= ahi | |||
// blo <= j <= j+k <= bhi | |||
// and for all (i',j',k') meeting those conditions, | |||
// k >= k' | |||
// i <= i' | |||
// and if i == i', j <= j' | |||
// | |||
// In other words, of all maximal matching blocks, return one that | |||
// starts earliest in a, and of all those maximal matching blocks that | |||
// start earliest in a, return the one that starts earliest in b. | |||
// | |||
// If IsJunk is defined, first the longest matching block is | |||
// determined as above, but with the additional restriction that no | |||
// junk element appears in the block. Then that block is extended as | |||
// far as possible by matching (only) junk elements on both sides. So | |||
// the resulting block never matches on junk except as identical junk | |||
// happens to be adjacent to an "interesting" match. | |||
// | |||
// If no blocks match, return (alo, blo, 0). | |||
func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { | |||
// CAUTION: stripping common prefix or suffix would be incorrect. | |||
// E.g., | |||
// ab | |||
// acab | |||
// Longest matching block is "ab", but if common prefix is | |||
// stripped, it's "a" (tied with "b"). UNIX(tm) diff does so | |||
// strip, so ends up claiming that ab is changed to acab by | |||
// inserting "ca" in the middle. That's minimal but unintuitive: | |||
// "it's obvious" that someone inserted "ac" at the front. | |||
// Windiff ends up at the same place as diff, but by pairing up | |||
// the unique 'b's and then matching the first two 'a's. | |||
besti, bestj, bestsize := alo, blo, 0 | |||
// find longest junk-free match | |||
// during an iteration of the loop, j2len[j] = length of longest | |||
// junk-free match ending with a[i-1] and b[j] | |||
j2len := map[int]int{} | |||
for i := alo; i != ahi; i++ { | |||
// look at all instances of a[i] in b; note that because | |||
// b2j has no junk keys, the loop is skipped if a[i] is junk | |||
newj2len := map[int]int{} | |||
for _, j := range m.b2j[m.a[i]] { | |||
// a[i] matches b[j] | |||
if j < blo { | |||
continue | |||
} | |||
if j >= bhi { | |||
break | |||
} | |||
k := j2len[j-1] + 1 | |||
newj2len[j] = k | |||
if k > bestsize { | |||
besti, bestj, bestsize = i-k+1, j-k+1, k | |||
} | |||
} | |||
j2len = newj2len | |||
} | |||
// Extend the best by non-junk elements on each end. In particular, | |||
// "popular" non-junk elements aren't in b2j, which greatly speeds | |||
// the inner loop above, but also means "the best" match so far | |||
// doesn't contain any junk *or* popular non-junk elements. | |||
for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && | |||
m.a[besti-1] == m.b[bestj-1] { | |||
besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 | |||
} | |||
for besti+bestsize < ahi && bestj+bestsize < bhi && | |||
!m.isBJunk(m.b[bestj+bestsize]) && | |||
m.a[besti+bestsize] == m.b[bestj+bestsize] { | |||
bestsize++ | |||
} | |||
// Now that we have a wholly interesting match (albeit possibly | |||
// empty!), we may as well suck up the matching junk on each | |||
// side of it too. Can't think of a good reason not to, and it | |||
// saves post-processing the (possibly considerable) expense of | |||
// figuring out what to do with it. In the case of an empty | |||
// interesting match, this is clearly the right thing to do, | |||
// because no other kind of match is possible in the regions. | |||
for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && | |||
m.a[besti-1] == m.b[bestj-1] { | |||
besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 | |||
} | |||
for besti+bestsize < ahi && bestj+bestsize < bhi && | |||
m.isBJunk(m.b[bestj+bestsize]) && | |||
m.a[besti+bestsize] == m.b[bestj+bestsize] { | |||
bestsize++ | |||
} | |||
return Match{A: besti, B: bestj, Size: bestsize} | |||
} | |||
// Return list of triples describing matching subsequences. | |||
// | |||
// Each triple is of the form (i, j, n), and means that | |||
// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in | |||
// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are | |||
// adjacent triples in the list, and the second is not the last triple in the | |||
// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe | |||
// adjacent equal blocks. | |||
// | |||
// The last triple is a dummy, (len(a), len(b), 0), and is the only | |||
// triple with n==0. | |||
func (m *SequenceMatcher) GetMatchingBlocks() []Match { | |||
if m.matchingBlocks != nil { | |||
return m.matchingBlocks | |||
} | |||
var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match | |||
matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { | |||
match := m.findLongestMatch(alo, ahi, blo, bhi) | |||
i, j, k := match.A, match.B, match.Size | |||
if match.Size > 0 { | |||
if alo < i && blo < j { | |||
matched = matchBlocks(alo, i, blo, j, matched) | |||
} | |||
matched = append(matched, match) | |||
if i+k < ahi && j+k < bhi { | |||
matched = matchBlocks(i+k, ahi, j+k, bhi, matched) | |||
} | |||
} | |||
return matched | |||
} | |||
matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) | |||
// It's possible that we have adjacent equal blocks in the | |||
// matching_blocks list now. | |||
nonAdjacent := []Match{} | |||
i1, j1, k1 := 0, 0, 0 | |||
for _, b := range matched { | |||
// Is this block adjacent to i1, j1, k1? | |||
i2, j2, k2 := b.A, b.B, b.Size | |||
if i1+k1 == i2 && j1+k1 == j2 { | |||
// Yes, so collapse them -- this just increases the length of | |||
// the first block by the length of the second, and the first | |||
// block so lengthened remains the block to compare against. | |||
k1 += k2 | |||
} else { | |||
// Not adjacent. Remember the first block (k1==0 means it's | |||
// the dummy we started with), and make the second block the | |||
// new block to compare against. | |||
if k1 > 0 { | |||
nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) | |||
} | |||
i1, j1, k1 = i2, j2, k2 | |||
} | |||
} | |||
if k1 > 0 { | |||
nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) | |||
} | |||
nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) | |||
m.matchingBlocks = nonAdjacent | |||
return m.matchingBlocks | |||
} | |||
// Return list of 5-tuples describing how to turn a into b. | |||
// | |||
// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple | |||
// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the | |||
// tuple preceding it, and likewise for j1 == the previous j2. | |||
// | |||
// The tags are characters, with these meanings: | |||
// | |||
// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] | |||
// | |||
// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. | |||
// | |||
// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. | |||
// | |||
// 'e' (equal): a[i1:i2] == b[j1:j2] | |||
func (m *SequenceMatcher) GetOpCodes() []OpCode { | |||
if m.opCodes != nil { | |||
return m.opCodes | |||
} | |||
i, j := 0, 0 | |||
matching := m.GetMatchingBlocks() | |||
opCodes := make([]OpCode, 0, len(matching)) | |||
for _, m := range matching { | |||
// invariant: we've pumped out correct diffs to change | |||
// a[:i] into b[:j], and the next matching block is | |||
// a[ai:ai+size] == b[bj:bj+size]. So we need to pump | |||
// out a diff to change a[i:ai] into b[j:bj], pump out | |||
// the matching block, and move (i,j) beyond the match | |||
ai, bj, size := m.A, m.B, m.Size | |||
tag := byte(0) | |||
if i < ai && j < bj { | |||
tag = 'r' | |||
} else if i < ai { | |||
tag = 'd' | |||
} else if j < bj { | |||
tag = 'i' | |||
} | |||
if tag > 0 { | |||
opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) | |||
} | |||
i, j = ai+size, bj+size | |||
// the list of matching blocks is terminated by a | |||
// sentinel with size 0 | |||
if size > 0 { | |||
opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) | |||
} | |||
} | |||
m.opCodes = opCodes | |||
return m.opCodes | |||
} | |||
// Isolate change clusters by eliminating ranges with no changes. | |||
// | |||
// Return a generator of groups with up to n lines of context. | |||
// Each group is in the same format as returned by GetOpCodes(). | |||
func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { | |||
if n < 0 { | |||
n = 3 | |||
} | |||
codes := m.GetOpCodes() | |||
if len(codes) == 0 { | |||
codes = []OpCode{{'e', 0, 1, 0, 1}} | |||
} | |||
// Fixup leading and trailing groups if they show no changes. | |||
if codes[0].Tag == 'e' { | |||
c := codes[0] | |||
i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 | |||
codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} | |||
} | |||
if codes[len(codes)-1].Tag == 'e' { | |||
c := codes[len(codes)-1] | |||
i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 | |||
codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} | |||
} | |||
nn := n + n | |||
groups := [][]OpCode{} | |||
group := []OpCode{} | |||
for _, c := range codes { | |||
i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 | |||
// End the current group and start a new one whenever | |||
// there is a large range with no changes. | |||
if c.Tag == 'e' && i2-i1 > nn { | |||
group = append(group, OpCode{ | |||
c.Tag, i1, min(i2, i1+n), | |||
j1, min(j2, j1+n), | |||
}) | |||
groups = append(groups, group) | |||
group = []OpCode{} | |||
i1, j1 = max(i1, i2-n), max(j1, j2-n) | |||
} | |||
group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) | |||
} | |||
if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { | |||
groups = append(groups, group) | |||
} | |||
return groups | |||
} | |||
// Return a measure of the sequences' similarity (float in [0,1]). | |||
// | |||
// Where T is the total number of elements in both sequences, and | |||
// M is the number of matches, this is 2.0*M / T. | |||
// Note that this is 1 if the sequences are identical, and 0 if | |||
// they have nothing in common. | |||
// | |||
// .Ratio() is expensive to compute if you haven't already computed | |||
// .GetMatchingBlocks() or .GetOpCodes(), in which case you may | |||
// want to try .QuickRatio() or .RealQuickRation() first to get an | |||
// upper bound. | |||
func (m *SequenceMatcher) Ratio() float64 { | |||
matches := 0 | |||
for _, m := range m.GetMatchingBlocks() { | |||
matches += m.Size | |||
} | |||
return calculateRatio(matches, len(m.a)+len(m.b)) | |||
} | |||
// Return an upper bound on ratio() relatively quickly. | |||
// | |||
// This isn't defined beyond that it is an upper bound on .Ratio(), and | |||
// is faster to compute. | |||
func (m *SequenceMatcher) QuickRatio() float64 { | |||
// viewing a and b as multisets, set matches to the cardinality | |||
// of their intersection; this counts the number of matches | |||
// without regard to order, so is clearly an upper bound | |||
if m.fullBCount == nil { | |||
m.fullBCount = map[string]int{} | |||
for _, s := range m.b { | |||
m.fullBCount[s]++ | |||
} | |||
} | |||
// avail[x] is the number of times x appears in 'b' less the | |||
// number of times we've seen it in 'a' so far ... kinda | |||
avail := map[string]int{} | |||
matches := 0 | |||
for _, s := range m.a { | |||
n, ok := avail[s] | |||
if !ok { | |||
n = m.fullBCount[s] | |||
} | |||
avail[s] = n - 1 | |||
if n > 0 { | |||
matches++ | |||
} | |||
} | |||
return calculateRatio(matches, len(m.a)+len(m.b)) | |||
} | |||
// Return an upper bound on ratio() very quickly. | |||
// | |||
// This isn't defined beyond that it is an upper bound on .Ratio(), and | |||
// is faster to compute than either .Ratio() or .QuickRatio(). | |||
func (m *SequenceMatcher) RealQuickRatio() float64 { | |||
la, lb := len(m.a), len(m.b) | |||
return calculateRatio(min(la, lb), la+lb) | |||
} | |||
// Convert range to the "ed" format | |||
func formatRangeUnified(start, stop int) string { | |||
// Per the diff spec at http://www.unix.org/single_unix_specification/ | |||
beginning := start + 1 // lines start numbering with one | |||
length := stop - start | |||
if length == 1 { | |||
return fmt.Sprintf("%d", beginning) | |||
} | |||
if length == 0 { | |||
beginning-- // empty ranges begin at line just before the range | |||
} | |||
return fmt.Sprintf("%d,%d", beginning, length) | |||
} | |||
// Unified diff parameters | |||
type UnifiedDiff struct { | |||
A []string // First sequence lines | |||
FromFile string // First file name | |||
FromDate string // First file time | |||
B []string // Second sequence lines | |||
ToFile string // Second file name | |||
ToDate string // Second file time | |||
Eol string // Headers end of line, defaults to LF | |||
Context int // Number of context lines | |||
} | |||
// Compare two sequences of lines; generate the delta as a unified diff. | |||
// | |||
// Unified diffs are a compact way of showing line changes and a few | |||
// lines of context. The number of context lines is set by 'n' which | |||
// defaults to three. | |||
// | |||
// By default, the diff control lines (those with ---, +++, or @@) are | |||
// created with a trailing newline. This is helpful so that inputs | |||
// created from file.readlines() result in diffs that are suitable for | |||
// file.writelines() since both the inputs and outputs have trailing | |||
// newlines. | |||
// | |||
// For inputs that do not have trailing newlines, set the lineterm | |||
// argument to "" so that the output will be uniformly newline free. | |||
// | |||
// The unidiff format normally has a header for filenames and modification | |||
// times. Any or all of these may be specified using strings for | |||
// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. | |||
// The modification times are normally expressed in the ISO 8601 format. | |||
func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { | |||
buf := bufio.NewWriter(writer) | |||
defer buf.Flush() | |||
wf := func(format string, args ...interface{}) error { | |||
_, err := buf.WriteString(fmt.Sprintf(format, args...)) | |||
return err | |||
} | |||
ws := func(s string) error { | |||
_, err := buf.WriteString(s) | |||
return err | |||
} | |||
if len(diff.Eol) == 0 { | |||
diff.Eol = "\n" | |||
} | |||
started := false | |||
m := NewMatcher(diff.A, diff.B) | |||
for _, g := range m.GetGroupedOpCodes(diff.Context) { | |||
if !started { | |||
started = true | |||
fromDate := "" | |||
if len(diff.FromDate) > 0 { | |||
fromDate = "\t" + diff.FromDate | |||
} | |||
toDate := "" | |||
if len(diff.ToDate) > 0 { | |||
toDate = "\t" + diff.ToDate | |||
} | |||
if diff.FromFile != "" || diff.ToFile != "" { | |||
err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) | |||
if err != nil { | |||
return err | |||
} | |||
err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) | |||
if err != nil { | |||
return err | |||
} | |||
} | |||
} | |||
first, last := g[0], g[len(g)-1] | |||
range1 := formatRangeUnified(first.I1, last.I2) | |||
range2 := formatRangeUnified(first.J1, last.J2) | |||
if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { | |||
return err | |||
} | |||
for _, c := range g { | |||
i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 | |||
if c.Tag == 'e' { | |||
for _, line := range diff.A[i1:i2] { | |||
if err := ws(" " + line); err != nil { | |||
return err | |||
} | |||
} | |||
continue | |||
} | |||
if c.Tag == 'r' || c.Tag == 'd' { | |||
for _, line := range diff.A[i1:i2] { | |||
if err := ws("-" + line); err != nil { | |||
return err | |||
} | |||
} | |||
} | |||
if c.Tag == 'r' || c.Tag == 'i' { | |||
for _, line := range diff.B[j1:j2] { | |||
if err := ws("+" + line); err != nil { | |||
return err | |||
} | |||
} | |||
} | |||
} | |||
} | |||
return nil | |||
} | |||
// Like WriteUnifiedDiff but returns the diff a string. | |||
func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { | |||
w := &bytes.Buffer{} | |||
err := WriteUnifiedDiff(w, diff) | |||
return w.String(), err | |||
} | |||
// Split a string on "\n" while preserving them. The output can be used | |||
// as input for UnifiedDiff and ContextDiff structures. | |||
func SplitLines(s string) []string { | |||
lines := strings.SplitAfter(s, "\n") | |||
lines[len(lines)-1] += "\n" | |||
return lines | |||
} |
@@ -0,0 +1,32 @@ | |||
// Copyright 2021 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
package internal | |||
import "regexp" | |||
type GoCollectorRule struct { | |||
Matcher *regexp.Regexp | |||
Deny bool | |||
} | |||
// GoCollectorOptions should not be used be directly by anything, except `collectors` package. | |||
// Use it via collectors package instead. See issue | |||
// https://github.com/prometheus/client_golang/issues/1030. | |||
// | |||
// This is internal, so external users only can use it via `collector.WithGoCollector*` methods | |||
type GoCollectorOptions struct { | |||
DisableMemStatsLikeMetrics bool | |||
RuntimeMetricSumForHist map[string]string | |||
RuntimeMetricRules []GoCollectorRule | |||
} |
@@ -61,9 +61,9 @@ func RuntimeMetricsToProm(d *metrics.Description) (string, string, string, bool) | |||
// name has - replaced with _ and is concatenated with the unit and | |||
// other data. | |||
name = strings.ReplaceAll(name, "-", "_") | |||
name = name + "_" + unit | |||
name += "_" + unit | |||
if d.Cumulative && d.Kind != metrics.KindFloat64Histogram { | |||
name = name + "_total" | |||
name += "_total" | |||
} | |||
valid := model.IsValidMetricName(model.LabelValue(namespace + "_" + subsystem + "_" + name)) | |||
@@ -19,18 +19,34 @@ import ( | |||
dto "github.com/prometheus/client_model/go" | |||
) | |||
// metricSorter is a sortable slice of *dto.Metric. | |||
type metricSorter []*dto.Metric | |||
// LabelPairSorter implements sort.Interface. It is used to sort a slice of | |||
// dto.LabelPair pointers. | |||
type LabelPairSorter []*dto.LabelPair | |||
func (s metricSorter) Len() int { | |||
func (s LabelPairSorter) Len() int { | |||
return len(s) | |||
} | |||
func (s metricSorter) Swap(i, j int) { | |||
func (s LabelPairSorter) Swap(i, j int) { | |||
s[i], s[j] = s[j], s[i] | |||
} | |||
func (s metricSorter) Less(i, j int) bool { | |||
func (s LabelPairSorter) Less(i, j int) bool { | |||
return s[i].GetName() < s[j].GetName() | |||
} | |||
// MetricSorter is a sortable slice of *dto.Metric. | |||
type MetricSorter []*dto.Metric | |||
func (s MetricSorter) Len() int { | |||
return len(s) | |||
} | |||
func (s MetricSorter) Swap(i, j int) { | |||
s[i], s[j] = s[j], s[i] | |||
} | |||
func (s MetricSorter) Less(i, j int) bool { | |||
if len(s[i].Label) != len(s[j].Label) { | |||
// This should not happen. The metrics are | |||
// inconsistent. However, we have to deal with the fact, as | |||
@@ -68,7 +84,7 @@ func (s metricSorter) Less(i, j int) bool { | |||
// the slice, with the contained Metrics sorted within each MetricFamily. | |||
func NormalizeMetricFamilies(metricFamiliesByName map[string]*dto.MetricFamily) []*dto.MetricFamily { | |||
for _, mf := range metricFamiliesByName { | |||
sort.Sort(metricSorter(mf.Metric)) | |||
sort.Sort(MetricSorter(mf.Metric)) | |||
} | |||
names := make([]string, 0, len(metricFamiliesByName)) | |||
for name, mf := range metricFamiliesByName { | |||
@@ -39,7 +39,7 @@ var errInconsistentCardinality = errors.New("inconsistent label cardinality") | |||
func makeInconsistentCardinalityError(fqName string, labels, labelValues []string) error { | |||
return fmt.Errorf( | |||
"%s: %q has %d variable labels named %q but %d values %q were provided", | |||
"%w: %q has %d variable labels named %q but %d values %q were provided", | |||
errInconsistentCardinality, fqName, | |||
len(labels), labels, | |||
len(labelValues), labelValues, | |||
@@ -49,7 +49,7 @@ func makeInconsistentCardinalityError(fqName string, labels, labelValues []strin | |||
func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error { | |||
if len(labels) != expectedNumberOfValues { | |||
return fmt.Errorf( | |||
"%s: expected %d label values but got %d in %#v", | |||
"%w: expected %d label values but got %d in %#v", | |||
errInconsistentCardinality, expectedNumberOfValues, | |||
len(labels), labels, | |||
) | |||
@@ -67,7 +67,7 @@ func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error { | |||
func validateLabelValues(vals []string, expectedNumberOfValues int) error { | |||
if len(vals) != expectedNumberOfValues { | |||
return fmt.Errorf( | |||
"%s: expected %d label values but got %d in %#v", | |||
"%w: expected %d label values but got %d in %#v", | |||
errInconsistentCardinality, expectedNumberOfValues, | |||
len(vals), vals, | |||
) | |||
@@ -14,6 +14,9 @@ | |||
package prometheus | |||
import ( | |||
"errors" | |||
"math" | |||
"sort" | |||
"strings" | |||
"time" | |||
@@ -115,22 +118,6 @@ func BuildFQName(namespace, subsystem, name string) string { | |||
return name | |||
} | |||
// labelPairSorter implements sort.Interface. It is used to sort a slice of | |||
// dto.LabelPair pointers. | |||
type labelPairSorter []*dto.LabelPair | |||
func (s labelPairSorter) Len() int { | |||
return len(s) | |||
} | |||
func (s labelPairSorter) Swap(i, j int) { | |||
s[i], s[j] = s[j], s[i] | |||
} | |||
func (s labelPairSorter) Less(i, j int) bool { | |||
return s[i].GetName() < s[j].GetName() | |||
} | |||
type invalidMetric struct { | |||
desc *Desc | |||
err error | |||
@@ -174,3 +161,96 @@ func (m timestampedMetric) Write(pb *dto.Metric) error { | |||
func NewMetricWithTimestamp(t time.Time, m Metric) Metric { | |||
return timestampedMetric{Metric: m, t: t} | |||
} | |||
type withExemplarsMetric struct { | |||
Metric | |||
exemplars []*dto.Exemplar | |||
} | |||
func (m *withExemplarsMetric) Write(pb *dto.Metric) error { | |||
if err := m.Metric.Write(pb); err != nil { | |||
return err | |||
} | |||
switch { | |||
case pb.Counter != nil: | |||
pb.Counter.Exemplar = m.exemplars[len(m.exemplars)-1] | |||
case pb.Histogram != nil: | |||
for _, e := range m.exemplars { | |||
// pb.Histogram.Bucket are sorted by UpperBound. | |||
i := sort.Search(len(pb.Histogram.Bucket), func(i int) bool { | |||
return pb.Histogram.Bucket[i].GetUpperBound() >= e.GetValue() | |||
}) | |||
if i < len(pb.Histogram.Bucket) { | |||
pb.Histogram.Bucket[i].Exemplar = e | |||
} else { | |||
// The +Inf bucket should be explicitly added if there is an exemplar for it, similar to non-const histogram logic in https://github.com/prometheus/client_golang/blob/main/prometheus/histogram.go#L357-L365. | |||
b := &dto.Bucket{ | |||
CumulativeCount: proto.Uint64(pb.Histogram.Bucket[len(pb.Histogram.GetBucket())-1].GetCumulativeCount()), | |||
UpperBound: proto.Float64(math.Inf(1)), | |||
Exemplar: e, | |||
} | |||
pb.Histogram.Bucket = append(pb.Histogram.Bucket, b) | |||
} | |||
} | |||
default: | |||
// TODO(bwplotka): Implement Gauge? | |||
return errors.New("cannot inject exemplar into Gauge, Summary or Untyped") | |||
} | |||
return nil | |||
} | |||
// Exemplar is easier to use, user-facing representation of *dto.Exemplar. | |||
type Exemplar struct { | |||
Value float64 | |||
Labels Labels | |||
// Optional. | |||
// Default value (time.Time{}) indicates its empty, which should be | |||
// understood as time.Now() time at the moment of creation of metric. | |||
Timestamp time.Time | |||
} | |||
// NewMetricWithExemplars returns a new Metric wrapping the provided Metric with given | |||
// exemplars. Exemplars are validated. | |||
// | |||
// Only last applicable exemplar is injected from the list. | |||
// For example for Counter it means last exemplar is injected. | |||
// For Histogram, it means last applicable exemplar for each bucket is injected. | |||
// | |||
// NewMetricWithExemplars works best with MustNewConstMetric and | |||
// MustNewConstHistogram, see example. | |||
func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) { | |||
if len(exemplars) == 0 { | |||
return nil, errors.New("no exemplar was passed for NewMetricWithExemplars") | |||
} | |||
var ( | |||
now = time.Now() | |||
exs = make([]*dto.Exemplar, len(exemplars)) | |||
err error | |||
) | |||
for i, e := range exemplars { | |||
ts := e.Timestamp | |||
if ts == (time.Time{}) { | |||
ts = now | |||
} | |||
exs[i], err = newExemplar(e.Value, ts, e.Labels) | |||
if err != nil { | |||
return nil, err | |||
} | |||
} | |||
return &withExemplarsMetric{Metric: m, exemplars: exs}, nil | |||
} | |||
// MustNewMetricWithExemplars is a version of NewMetricWithExemplars that panics where | |||
// NewMetricWithExemplars would have returned an error. | |||
func MustNewMetricWithExemplars(m Metric, exemplars ...Exemplar) Metric { | |||
ret, err := NewMetricWithExemplars(m, exemplars...) | |||
if err != nil { | |||
panic(err) | |||
} | |||
return ret | |||
} |
@@ -0,0 +1,25 @@ | |||
// Copyright 2018 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build !js || wasm | |||
// +build !js wasm | |||
package prometheus | |||
import "runtime" | |||
// getRuntimeNumThreads returns the number of open OS threads. | |||
func getRuntimeNumThreads() float64 { | |||
n, _ := runtime.ThreadCreateProfile(nil) | |||
return float64(n) | |||
} |
@@ -0,0 +1,22 @@ | |||
// Copyright 2018 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build js && !wasm | |||
// +build js,!wasm | |||
package prometheus | |||
// getRuntimeNumThreads returns the number of open OS threads. | |||
func getRuntimeNumThreads() float64 { | |||
return 1 | |||
} |
@@ -58,7 +58,7 @@ type ObserverVec interface { | |||
// current time as timestamp, and the provided Labels. Empty Labels will lead to | |||
// a valid (label-less) exemplar. But if Labels is nil, the current exemplar is | |||
// left in place. ObserveWithExemplar panics if any of the provided labels are | |||
// invalid or if the provided labels contain more than 64 runes in total. | |||
// invalid or if the provided labels contain more than 128 runes in total. | |||
type ExemplarObserver interface { | |||
ObserveWithExemplar(value float64, exemplar Labels) | |||
} |
@@ -16,7 +16,6 @@ package prometheus | |||
import ( | |||
"errors" | |||
"fmt" | |||
"io/ioutil" | |||
"os" | |||
"strconv" | |||
"strings" | |||
@@ -104,8 +103,7 @@ func NewProcessCollector(opts ProcessCollectorOpts) Collector { | |||
} | |||
if opts.PidFn == nil { | |||
pid := os.Getpid() | |||
c.pidFn = func() (int, error) { return pid, nil } | |||
c.pidFn = getPIDFn() | |||
} else { | |||
c.pidFn = opts.PidFn | |||
} | |||
@@ -152,13 +150,13 @@ func (c *processCollector) reportError(ch chan<- Metric, desc *Desc, err error) | |||
// It is meant to be used for the PidFn field in ProcessCollectorOpts. | |||
func NewPidFileFn(pidFilePath string) func() (int, error) { | |||
return func() (int, error) { | |||
content, err := ioutil.ReadFile(pidFilePath) | |||
content, err := os.ReadFile(pidFilePath) | |||
if err != nil { | |||
return 0, fmt.Errorf("can't read pid file %q: %+v", pidFilePath, err) | |||
return 0, fmt.Errorf("can't read pid file %q: %w", pidFilePath, err) | |||
} | |||
pid, err := strconv.Atoi(strings.TrimSpace(string(content))) | |||
if err != nil { | |||
return 0, fmt.Errorf("can't parse pid file %q: %+v", pidFilePath, err) | |||
return 0, fmt.Errorf("can't parse pid file %q: %w", pidFilePath, err) | |||
} | |||
return pid, nil | |||
@@ -0,0 +1,26 @@ | |||
// Copyright 2019 The Prometheus Authors | |||
// Licensed under the Apache License, Version 2.0 (the "License"); | |||
// you may not use this file except in compliance with the License. | |||
// You may obtain a copy of the License at | |||
// | |||
// http://www.apache.org/licenses/LICENSE-2.0 | |||
// | |||
// Unless required by applicable law or agreed to in writing, software | |||
// distributed under the License is distributed on an "AS IS" BASIS, | |||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build js | |||
// +build js | |||
package prometheus | |||
func canCollectProcess() bool { | |||
return false | |||
} | |||
func (c *processCollector) processCollect(ch chan<- Metric) { | |||
// noop on this platform | |||
return | |||
} |
@@ -11,8 +11,8 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
//go:build !windows | |||
// +build !windows | |||
//go:build !windows && !js | |||
// +build !windows,!js | |||
package prometheus | |||
@@ -76,16 +76,19 @@ func (r *responseWriterDelegator) Write(b []byte) (int, error) { | |||
return n, err | |||
} | |||
type closeNotifierDelegator struct{ *responseWriterDelegator } | |||
type flusherDelegator struct{ *responseWriterDelegator } | |||
type hijackerDelegator struct{ *responseWriterDelegator } | |||
type readerFromDelegator struct{ *responseWriterDelegator } | |||
type pusherDelegator struct{ *responseWriterDelegator } | |||
type ( | |||
closeNotifierDelegator struct{ *responseWriterDelegator } | |||
flusherDelegator struct{ *responseWriterDelegator } | |||
hijackerDelegator struct{ *responseWriterDelegator } | |||
readerFromDelegator struct{ *responseWriterDelegator } | |||
pusherDelegator struct{ *responseWriterDelegator } | |||
) | |||
func (d closeNotifierDelegator) CloseNotify() <-chan bool { | |||
//nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. | |||
return d.ResponseWriter.(http.CloseNotifier).CloseNotify() | |||
} | |||
func (d flusherDelegator) Flush() { | |||
// If applicable, call WriteHeader here so that observeWriteHeader is | |||
// handled appropriately. | |||
@@ -94,9 +97,11 @@ func (d flusherDelegator) Flush() { | |||
} | |||
d.ResponseWriter.(http.Flusher).Flush() | |||
} | |||
func (d hijackerDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error) { | |||
return d.ResponseWriter.(http.Hijacker).Hijack() | |||
} | |||
func (d readerFromDelegator) ReadFrom(re io.Reader) (int64, error) { | |||
// If applicable, call WriteHeader here so that observeWriteHeader is | |||
// handled appropriately. | |||
@@ -107,6 +112,7 @@ func (d readerFromDelegator) ReadFrom(re io.Reader) (int64, error) { | |||
d.written += n | |||
return n, err | |||
} | |||
func (d pusherDelegator) Push(target string, opts *http.PushOptions) error { | |||
return d.ResponseWriter.(http.Pusher).Push(target, opts) | |||
} | |||
@@ -261,7 +267,7 @@ func init() { | |||
http.Flusher | |||
}{d, pusherDelegator{d}, hijackerDelegator{d}, flusherDelegator{d}} | |||
} | |||
pickDelegator[pusher+hijacker+flusher+closeNotifier] = func(d *responseWriterDelegator) delegator { //23 | |||
pickDelegator[pusher+hijacker+flusher+closeNotifier] = func(d *responseWriterDelegator) delegator { // 23 | |||
return struct { | |||
*responseWriterDelegator | |||
http.Pusher | |||
@@ -33,6 +33,7 @@ package promhttp | |||
import ( | |||
"compress/gzip" | |||
"errors" | |||
"fmt" | |||
"io" | |||
"net/http" | |||
@@ -84,6 +85,13 @@ func Handler() http.Handler { | |||
// instrumentation. Use the InstrumentMetricHandler function to apply the same | |||
// kind of instrumentation as it is used by the Handler function. | |||
func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { | |||
return HandlerForTransactional(prometheus.ToTransactionalGatherer(reg), opts) | |||
} | |||
// HandlerForTransactional is like HandlerFor, but it uses transactional gather, which | |||
// can safely change in-place returned *dto.MetricFamily before call to `Gather` and after | |||
// call to `done` of that `Gather`. | |||
func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerOpts) http.Handler { | |||
var ( | |||
inFlightSem chan struct{} | |||
errCnt = prometheus.NewCounterVec( | |||
@@ -103,7 +111,8 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { | |||
errCnt.WithLabelValues("gathering") | |||
errCnt.WithLabelValues("encoding") | |||
if err := opts.Registry.Register(errCnt); err != nil { | |||
if are, ok := err.(prometheus.AlreadyRegisteredError); ok { | |||
are := &prometheus.AlreadyRegisteredError{} | |||
if errors.As(err, are) { | |||
errCnt = are.ExistingCollector.(*prometheus.CounterVec) | |||
} else { | |||
panic(err) | |||
@@ -123,7 +132,8 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { | |||
return | |||
} | |||
} | |||
mfs, err := reg.Gather() | |||
mfs, done, err := reg.Gather() | |||
defer done() | |||
if err != nil { | |||
if opts.ErrorLog != nil { | |||
opts.ErrorLog.Println("error gathering metrics:", err) | |||
@@ -242,7 +252,8 @@ func InstrumentMetricHandler(reg prometheus.Registerer, handler http.Handler) ht | |||
cnt.WithLabelValues("500") | |||
cnt.WithLabelValues("503") | |||
if err := reg.Register(cnt); err != nil { | |||
if are, ok := err.(prometheus.AlreadyRegisteredError); ok { | |||
are := &prometheus.AlreadyRegisteredError{} | |||
if errors.As(err, are) { | |||
cnt = are.ExistingCollector.(*prometheus.CounterVec) | |||
} else { | |||
panic(err) | |||
@@ -254,7 +265,8 @@ func InstrumentMetricHandler(reg prometheus.Registerer, handler http.Handler) ht | |||
Help: "Current number of scrapes being served.", | |||
}) | |||
if err := reg.Register(gge); err != nil { | |||
if are, ok := err.(prometheus.AlreadyRegisteredError); ok { | |||
are := &prometheus.AlreadyRegisteredError{} | |||
if errors.As(err, are) { | |||
gge = are.ExistingCollector.(prometheus.Gauge) | |||
} else { | |||
panic(err) | |||
@@ -38,11 +38,11 @@ func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { | |||
// | |||
// See the example for ExampleInstrumentRoundTripperDuration for example usage. | |||
func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripper) RoundTripperFunc { | |||
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { | |||
return func(r *http.Request) (*http.Response, error) { | |||
gauge.Inc() | |||
defer gauge.Dec() | |||
return next.RoundTrip(r) | |||
}) | |||
} | |||
} | |||
// InstrumentRoundTripperCounter is a middleware that wraps the provided | |||
@@ -59,22 +59,29 @@ func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripp | |||
// If the wrapped RoundTripper panics or returns a non-nil error, the Counter | |||
// is not incremented. | |||
// | |||
// Use with WithExemplarFromContext to instrument the exemplars on the counter of requests. | |||
// | |||
// See the example for ExampleInstrumentRoundTripperDuration for example usage. | |||
func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { | |||
rtOpts := &option{} | |||
rtOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(rtOpts) | |||
o.apply(rtOpts) | |||
} | |||
code, method := checkLabels(counter) | |||
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { | |||
return func(r *http.Request) (*http.Response, error) { | |||
resp, err := next.RoundTrip(r) | |||
if err == nil { | |||
exemplarAdd( | |||
counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)), | |||
1, | |||
rtOpts.getExemplarFn(r.Context()), | |||
) | |||
counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc() | |||
} | |||
return resp, err | |||
}) | |||
} | |||
} | |||
// InstrumentRoundTripperDuration is a middleware that wraps the provided | |||
@@ -94,24 +101,30 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou | |||
// If the wrapped RoundTripper panics or returns a non-nil error, no values are | |||
// reported. | |||
// | |||
// Use with WithExemplarFromContext to instrument the exemplars on the duration histograms. | |||
// | |||
// Note that this method is only guaranteed to never observe negative durations | |||
// if used with Go1.9+. | |||
func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { | |||
rtOpts := &option{} | |||
rtOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(rtOpts) | |||
o.apply(rtOpts) | |||
} | |||
code, method := checkLabels(obs) | |||
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { | |||
return func(r *http.Request) (*http.Response, error) { | |||
start := time.Now() | |||
resp, err := next.RoundTrip(r) | |||
if err == nil { | |||
obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Observe(time.Since(start).Seconds()) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)), | |||
time.Since(start).Seconds(), | |||
rtOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
return resp, err | |||
}) | |||
} | |||
} | |||
// InstrumentTrace is used to offer flexibility in instrumenting the available | |||
@@ -149,7 +162,7 @@ type InstrumentTrace struct { | |||
// | |||
// See the example for ExampleInstrumentRoundTripperDuration for example usage. | |||
func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) RoundTripperFunc { | |||
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { | |||
return func(r *http.Request) (*http.Response, error) { | |||
start := time.Now() | |||
trace := &httptrace.ClientTrace{ | |||
@@ -231,5 +244,5 @@ func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) Ro | |||
r = r.WithContext(httptrace.WithClientTrace(r.Context(), trace)) | |||
return next.RoundTrip(r) | |||
}) | |||
} | |||
} |
@@ -28,6 +28,22 @@ import ( | |||
// magicString is used for the hacky label test in checkLabels. Remove once fixed. | |||
const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa" | |||
func exemplarObserve(obs prometheus.Observer, val float64, labels map[string]string) { | |||
if labels == nil { | |||
obs.Observe(val) | |||
return | |||
} | |||
obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels) | |||
} | |||
func exemplarAdd(obs prometheus.Counter, val float64, labels map[string]string) { | |||
if labels == nil { | |||
obs.Add(val) | |||
return | |||
} | |||
obs.(prometheus.ExemplarAdder).AddWithExemplar(val, labels) | |||
} | |||
// InstrumentHandlerInFlight is a middleware that wraps the provided | |||
// http.Handler. It sets the provided prometheus.Gauge to the number of | |||
// requests currently handled by the wrapped http.Handler. | |||
@@ -48,7 +64,7 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl | |||
// names are "code" and "method". The function panics otherwise. For the "method" | |||
// label a predefined default label value set is used to filter given values. | |||
// Values besides predefined values will count as `unknown` method. | |||
//`WithExtraMethods` can be used to add more methods to the set. The Observe | |||
// `WithExtraMethods` can be used to add more methods to the set. The Observe | |||
// method of the Observer in the ObserverVec is called with the request duration | |||
// in seconds. Partitioning happens by HTTP status code and/or HTTP method if | |||
// the respective instance label names are present in the ObserverVec. For | |||
@@ -62,28 +78,37 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl | |||
// Note that this method is only guaranteed to never observe negative durations | |||
// if used with Go1.9+. | |||
func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { | |||
mwOpts := &option{} | |||
hOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(mwOpts) | |||
o.apply(hOpts) | |||
} | |||
code, method := checkLabels(obs) | |||
if code { | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
now := time.Now() | |||
d := newDelegator(w, nil) | |||
next.ServeHTTP(d, r) | |||
obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) | |||
}) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), | |||
time.Since(now).Seconds(), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
now := time.Now() | |||
next.ServeHTTP(w, r) | |||
obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) | |||
}) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), | |||
time.Since(now).Seconds(), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
// InstrumentHandlerCounter is a middleware that wraps the provided http.Handler | |||
@@ -104,25 +129,34 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op | |||
// | |||
// See the example for InstrumentHandlerDuration for example usage. | |||
func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, opts ...Option) http.HandlerFunc { | |||
mwOpts := &option{} | |||
hOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(mwOpts) | |||
o.apply(hOpts) | |||
} | |||
code, method := checkLabels(counter) | |||
if code { | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
d := newDelegator(w, nil) | |||
next.ServeHTTP(d, r) | |||
counter.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Inc() | |||
}) | |||
exemplarAdd( | |||
counter.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), | |||
1, | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
next.ServeHTTP(w, r) | |||
counter.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Inc() | |||
}) | |||
exemplarAdd( | |||
counter.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), | |||
1, | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
// InstrumentHandlerTimeToWriteHeader is a middleware that wraps the provided | |||
@@ -148,20 +182,24 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, | |||
// | |||
// See the example for InstrumentHandlerDuration for example usage. | |||
func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { | |||
mwOpts := &option{} | |||
hOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(mwOpts) | |||
o.apply(hOpts) | |||
} | |||
code, method := checkLabels(obs) | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
now := time.Now() | |||
d := newDelegator(w, func(status int) { | |||
obs.With(labels(code, method, r.Method, status, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, status, hOpts.extraMethods...)), | |||
time.Since(now).Seconds(), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
}) | |||
next.ServeHTTP(d, r) | |||
}) | |||
} | |||
} | |||
// InstrumentHandlerRequestSize is a middleware that wraps the provided | |||
@@ -184,27 +222,34 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha | |||
// | |||
// See the example for InstrumentHandlerDuration for example usage. | |||
func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { | |||
mwOpts := &option{} | |||
hOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(mwOpts) | |||
o.apply(hOpts) | |||
} | |||
code, method := checkLabels(obs) | |||
if code { | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
d := newDelegator(w, nil) | |||
next.ServeHTTP(d, r) | |||
size := computeApproximateRequestSize(r) | |||
obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(size)) | |||
}) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), | |||
float64(size), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
return func(w http.ResponseWriter, r *http.Request) { | |||
next.ServeHTTP(w, r) | |||
size := computeApproximateRequestSize(r) | |||
obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(float64(size)) | |||
}) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, 0, hOpts.extraMethods...)), | |||
float64(size), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
} | |||
} | |||
// InstrumentHandlerResponseSize is a middleware that wraps the provided | |||
@@ -227,9 +272,9 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, | |||
// | |||
// See the example for InstrumentHandlerDuration for example usage. | |||
func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.Handler { | |||
mwOpts := &option{} | |||
hOpts := defaultOptions() | |||
for _, o := range opts { | |||
o(mwOpts) | |||
o.apply(hOpts) | |||
} | |||
code, method := checkLabels(obs) | |||
@@ -237,7 +282,11 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
d := newDelegator(w, nil) | |||
next.ServeHTTP(d, r) | |||
obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(d.Written())) | |||
exemplarObserve( | |||
obs.With(labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)), | |||
float64(d.Written()), | |||
hOpts.getExemplarFn(r.Context()), | |||
) | |||
}) | |||
} | |||
@@ -246,7 +295,7 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler | |||
// Collector does not have a Desc or has more than one Desc or its Desc is | |||
// invalid. It also panics if the Collector has any non-const, non-curried | |||
// labels that are not named "code" or "method". | |||
func checkLabels(c prometheus.Collector) (code bool, method bool) { | |||
func checkLabels(c prometheus.Collector) (code, method bool) { | |||
// TODO(beorn7): Remove this hacky way to check for instance labels | |||
// once Descriptors can have their dimensionality queried. | |||
var ( | |||
@@ -13,19 +13,46 @@ | |||
package promhttp | |||
// Option are used to configure a middleware or round tripper.. | |||
type Option func(*option) | |||
import ( | |||
"context" | |||
type option struct { | |||
extraMethods []string | |||
"github.com/prometheus/client_golang/prometheus" | |||
) | |||
// Option are used to configure both handler (middleware) or round tripper. | |||
type Option interface { | |||
apply(*options) | |||
} | |||
// options store options for both a handler or round tripper. | |||
type options struct { | |||
extraMethods []string | |||
getExemplarFn func(requestCtx context.Context) prometheus.Labels | |||
} | |||
func defaultOptions() *options { | |||
return &options{getExemplarFn: func(ctx context.Context) prometheus.Labels { return nil }} | |||
} | |||
type optionApplyFunc func(*options) | |||
func (o optionApplyFunc) apply(opt *options) { o(opt) } | |||
// WithExtraMethods adds additional HTTP methods to the list of allowed methods. | |||
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list. | |||
// | |||
// See the example for ExampleInstrumentHandlerWithExtraMethods for example usage. | |||
func WithExtraMethods(methods ...string) Option { | |||
return func(o *option) { | |||
return optionApplyFunc(func(o *options) { | |||
o.extraMethods = methods | |||
} | |||
}) | |||
} | |||
// WithExemplarFromContext adds allows to put a hook to all counter and histogram metrics. | |||
// If the hook function returns non-nil labels, exemplars will be added for that request, otherwise metric | |||
// will get instrumented without exemplar. | |||
func WithExemplarFromContext(getExemplarFn func(requestCtx context.Context) prometheus.Labels) Option { | |||
return optionApplyFunc(func(o *options) { | |||
o.getExemplarFn = getExemplarFn | |||
}) | |||
} |
@@ -15,8 +15,8 @@ package prometheus | |||
import ( | |||
"bytes" | |||
"errors" | |||
"fmt" | |||
"io/ioutil" | |||
"os" | |||
"path/filepath" | |||
"runtime" | |||
@@ -289,7 +289,7 @@ func (r *Registry) Register(c Collector) error { | |||
// Is the descriptor valid at all? | |||
if desc.err != nil { | |||
return fmt.Errorf("descriptor %s is invalid: %s", desc, desc.err) | |||
return fmt.Errorf("descriptor %s is invalid: %w", desc, desc.err) | |||
} | |||
// Is the descID unique? | |||
@@ -407,6 +407,14 @@ func (r *Registry) MustRegister(cs ...Collector) { | |||
// Gather implements Gatherer. | |||
func (r *Registry) Gather() ([]*dto.MetricFamily, error) { | |||
r.mtx.RLock() | |||
if len(r.collectorsByID) == 0 && len(r.uncheckedCollectors) == 0 { | |||
// Fast path. | |||
r.mtx.RUnlock() | |||
return nil, nil | |||
} | |||
var ( | |||
checkedMetricChan = make(chan Metric, capMetricChan) | |||
uncheckedMetricChan = make(chan Metric, capMetricChan) | |||
@@ -416,7 +424,6 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { | |||
registeredDescIDs map[uint64]struct{} // Only used for pedantic checks | |||
) | |||
r.mtx.RLock() | |||
goroutineBudget := len(r.collectorsByID) + len(r.uncheckedCollectors) | |||
metricFamiliesByName := make(map[string]*dto.MetricFamily, len(r.dimHashesByName)) | |||
checkedCollectors := make(chan Collector, len(r.collectorsByID)) | |||
@@ -556,7 +563,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { | |||
// This is intended for use with the textfile collector of the node exporter. | |||
// Note that the node exporter expects the filename to be suffixed with ".prom". | |||
func WriteToTextfile(filename string, g Gatherer) error { | |||
tmp, err := ioutil.TempFile(filepath.Dir(filename), filepath.Base(filename)) | |||
tmp, err := os.CreateTemp(filepath.Dir(filename), filepath.Base(filename)) | |||
if err != nil { | |||
return err | |||
} | |||
@@ -575,7 +582,7 @@ func WriteToTextfile(filename string, g Gatherer) error { | |||
return err | |||
} | |||
if err := os.Chmod(tmp.Name(), 0644); err != nil { | |||
if err := os.Chmod(tmp.Name(), 0o644); err != nil { | |||
return err | |||
} | |||
return os.Rename(tmp.Name(), filename) | |||
@@ -596,7 +603,7 @@ func processMetric( | |||
} | |||
dtoMetric := &dto.Metric{} | |||
if err := metric.Write(dtoMetric); err != nil { | |||
return fmt.Errorf("error collecting metric %v: %s", desc, err) | |||
return fmt.Errorf("error collecting metric %v: %w", desc, err) | |||
} | |||
metricFamily, ok := metricFamiliesByName[desc.fqName] | |||
if ok { // Existing name. | |||
@@ -718,12 +725,13 @@ func (gs Gatherers) Gather() ([]*dto.MetricFamily, error) { | |||
for i, g := range gs { | |||
mfs, err := g.Gather() | |||
if err != nil { | |||
if multiErr, ok := err.(MultiError); ok { | |||
multiErr := MultiError{} | |||
if errors.As(err, &multiErr) { | |||
for _, err := range multiErr { | |||
errs = append(errs, fmt.Errorf("[from Gatherer #%d] %s", i+1, err)) | |||
errs = append(errs, fmt.Errorf("[from Gatherer #%d] %w", i+1, err)) | |||
} | |||
} else { | |||
errs = append(errs, fmt.Errorf("[from Gatherer #%d] %s", i+1, err)) | |||
errs = append(errs, fmt.Errorf("[from Gatherer #%d] %w", i+1, err)) | |||
} | |||
} | |||
for _, mf := range mfs { | |||
@@ -884,11 +892,11 @@ func checkMetricConsistency( | |||
h.Write(separatorByteSlice) | |||
// Make sure label pairs are sorted. We depend on it for the consistency | |||
// check. | |||
if !sort.IsSorted(labelPairSorter(dtoMetric.Label)) { | |||
if !sort.IsSorted(internal.LabelPairSorter(dtoMetric.Label)) { | |||
// We cannot sort dtoMetric.Label in place as it is immutable by contract. | |||
copiedLabels := make([]*dto.LabelPair, len(dtoMetric.Label)) | |||
copy(copiedLabels, dtoMetric.Label) | |||
sort.Sort(labelPairSorter(copiedLabels)) | |||
sort.Sort(internal.LabelPairSorter(copiedLabels)) | |||
dtoMetric.Label = copiedLabels | |||
} | |||
for _, lp := range dtoMetric.Label { | |||
@@ -935,7 +943,7 @@ func checkDescConsistency( | |||
metricFamily.GetName(), dtoMetric, desc, | |||
) | |||
} | |||
sort.Sort(labelPairSorter(lpsFromDesc)) | |||
sort.Sort(internal.LabelPairSorter(lpsFromDesc)) | |||
for i, lpFromDesc := range lpsFromDesc { | |||
lpFromMetric := dtoMetric.Label[i] | |||
if lpFromDesc.GetName() != lpFromMetric.GetName() || | |||
@@ -948,3 +956,89 @@ func checkDescConsistency( | |||
} | |||
return nil | |||
} | |||
var _ TransactionalGatherer = &MultiTRegistry{} | |||
// MultiTRegistry is a TransactionalGatherer that joins gathered metrics from multiple | |||
// transactional gatherers. | |||
// | |||
// It is caller responsibility to ensure two registries have mutually exclusive metric families, | |||
// no deduplication will happen. | |||
type MultiTRegistry struct { | |||
tGatherers []TransactionalGatherer | |||
} | |||
// NewMultiTRegistry creates MultiTRegistry. | |||
func NewMultiTRegistry(tGatherers ...TransactionalGatherer) *MultiTRegistry { | |||
return &MultiTRegistry{ | |||
tGatherers: tGatherers, | |||
} | |||
} | |||
// Gather implements TransactionalGatherer interface. | |||
func (r *MultiTRegistry) Gather() (mfs []*dto.MetricFamily, done func(), err error) { | |||
errs := MultiError{} | |||
dFns := make([]func(), 0, len(r.tGatherers)) | |||
// TODO(bwplotka): Implement concurrency for those? | |||
for _, g := range r.tGatherers { | |||
// TODO(bwplotka): Check for duplicates? | |||
m, d, err := g.Gather() | |||
errs.Append(err) | |||
mfs = append(mfs, m...) | |||
dFns = append(dFns, d) | |||
} | |||
// TODO(bwplotka): Consider sort in place, given metric family in gather is sorted already. | |||
sort.Slice(mfs, func(i, j int) bool { | |||
return *mfs[i].Name < *mfs[j].Name | |||
}) | |||
return mfs, func() { | |||
for _, d := range dFns { | |||
d() | |||
} | |||
}, errs.MaybeUnwrap() | |||
} | |||
// TransactionalGatherer represents transactional gatherer that can be triggered to notify gatherer that memory | |||
// used by metric family is no longer used by a caller. This allows implementations with cache. | |||
type TransactionalGatherer interface { | |||
// Gather returns metrics in a lexicographically sorted slice | |||
// of uniquely named MetricFamily protobufs. Gather ensures that the | |||
// returned slice is valid and self-consistent so that it can be used | |||
// for valid exposition. As an exception to the strict consistency | |||
// requirements described for metric.Desc, Gather will tolerate | |||
// different sets of label names for metrics of the same metric family. | |||
// | |||
// Even if an error occurs, Gather attempts to gather as many metrics as | |||
// possible. Hence, if a non-nil error is returned, the returned | |||
// MetricFamily slice could be nil (in case of a fatal error that | |||
// prevented any meaningful metric collection) or contain a number of | |||
// MetricFamily protobufs, some of which might be incomplete, and some | |||
// might be missing altogether. The returned error (which might be a | |||
// MultiError) explains the details. Note that this is mostly useful for | |||
// debugging purposes. If the gathered protobufs are to be used for | |||
// exposition in actual monitoring, it is almost always better to not | |||
// expose an incomplete result and instead disregard the returned | |||
// MetricFamily protobufs in case the returned error is non-nil. | |||
// | |||
// Important: done is expected to be triggered (even if the error occurs!) | |||
// once caller does not need returned slice of dto.MetricFamily. | |||
Gather() (_ []*dto.MetricFamily, done func(), err error) | |||
} | |||
// ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function. | |||
func ToTransactionalGatherer(g Gatherer) TransactionalGatherer { | |||
return &noTransactionGatherer{g: g} | |||
} | |||
type noTransactionGatherer struct { | |||
g Gatherer | |||
} | |||
// Gather implements TransactionalGatherer interface. | |||
func (g *noTransactionGatherer) Gather() (_ []*dto.MetricFamily, done func(), err error) { | |||
mfs, err := g.g.Gather() | |||
return mfs, func() {}, err | |||
} |
@@ -23,6 +23,8 @@ import ( | |||
"github.com/golang/protobuf/proto" | |||
"google.golang.org/protobuf/types/known/timestamppb" | |||
"github.com/prometheus/client_golang/prometheus/internal" | |||
dto "github.com/prometheus/client_model/go" | |||
) | |||
@@ -38,6 +40,23 @@ const ( | |||
UntypedValue | |||
) | |||
var ( | |||
CounterMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_COUNTER; return &d }() | |||
GaugeMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_GAUGE; return &d }() | |||
UntypedMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_UNTYPED; return &d }() | |||
) | |||
func (v ValueType) ToDTO() *dto.MetricType { | |||
switch v { | |||
case CounterValue: | |||
return CounterMetricTypePtr | |||
case GaugeValue: | |||
return GaugeMetricTypePtr | |||
default: | |||
return UntypedMetricTypePtr | |||
} | |||
} | |||
// valueFunc is a generic metric for simple values retrieved on collect time | |||
// from a function. It implements Metric and Collector. Its effective type is | |||
// determined by ValueType. This is a low-level building block used by the | |||
@@ -91,11 +110,15 @@ func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues | |||
if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil { | |||
return nil, err | |||
} | |||
metric := &dto.Metric{} | |||
if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric); err != nil { | |||
return nil, err | |||
} | |||
return &constMetric{ | |||
desc: desc, | |||
valType: valueType, | |||
val: value, | |||
labelPairs: MakeLabelPairs(desc, labelValues), | |||
desc: desc, | |||
metric: metric, | |||
}, nil | |||
} | |||
@@ -110,10 +133,8 @@ func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelVal | |||
} | |||
type constMetric struct { | |||
desc *Desc | |||
valType ValueType | |||
val float64 | |||
labelPairs []*dto.LabelPair | |||
desc *Desc | |||
metric *dto.Metric | |||
} | |||
func (m *constMetric) Desc() *Desc { | |||
@@ -121,7 +142,11 @@ func (m *constMetric) Desc() *Desc { | |||
} | |||
func (m *constMetric) Write(out *dto.Metric) error { | |||
return populateMetric(m.valType, m.val, m.labelPairs, nil, out) | |||
out.Label = m.metric.Label | |||
out.Counter = m.metric.Counter | |||
out.Gauge = m.metric.Gauge | |||
out.Untyped = m.metric.Untyped | |||
return nil | |||
} | |||
func populateMetric( | |||
@@ -170,12 +195,12 @@ func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { | |||
}) | |||
} | |||
labelPairs = append(labelPairs, desc.constLabelPairs...) | |||
sort.Sort(labelPairSorter(labelPairs)) | |||
sort.Sort(internal.LabelPairSorter(labelPairs)) | |||
return labelPairs | |||
} | |||
// ExemplarMaxRunes is the max total number of runes allowed in exemplar labels. | |||
const ExemplarMaxRunes = 64 | |||
const ExemplarMaxRunes = 128 | |||
// newExemplar creates a new dto.Exemplar from the provided values. An error is | |||
// returned if any of the label names or values are invalid or if the total | |||
@@ -99,6 +99,16 @@ func (m *MetricVec) Delete(labels Labels) bool { | |||
return m.metricMap.deleteByHashWithLabels(h, labels, m.curry) | |||
} | |||
// DeletePartialMatch deletes all metrics where the variable labels contain all of those | |||
// passed in as labels. The order of the labels does not matter. | |||
// It returns the number of metrics deleted. | |||
// | |||
// Note that curried labels will never be matched if deleting from the curried vector. | |||
// To match curried labels with DeletePartialMatch, it must be called on the base vector. | |||
func (m *MetricVec) DeletePartialMatch(labels Labels) int { | |||
return m.metricMap.deleteByLabels(labels, m.curry) | |||
} | |||
// Without explicit forwarding of Describe, Collect, Reset, those methods won't | |||
// show up in GoDoc. | |||
@@ -381,6 +391,82 @@ func (m *metricMap) deleteByHashWithLabels( | |||
return true | |||
} | |||
// deleteByLabels deletes a metric if the given labels are present in the metric. | |||
func (m *metricMap) deleteByLabels(labels Labels, curry []curriedLabelValue) int { | |||
m.mtx.Lock() | |||
defer m.mtx.Unlock() | |||
var numDeleted int | |||
for h, metrics := range m.metrics { | |||
i := findMetricWithPartialLabels(m.desc, metrics, labels, curry) | |||
if i >= len(metrics) { | |||
// Didn't find matching labels in this metric slice. | |||
continue | |||
} | |||
delete(m.metrics, h) | |||
numDeleted++ | |||
} | |||
return numDeleted | |||
} | |||
// findMetricWithPartialLabel returns the index of the matching metric or | |||
// len(metrics) if not found. | |||
func findMetricWithPartialLabels( | |||
desc *Desc, metrics []metricWithLabelValues, labels Labels, curry []curriedLabelValue, | |||
) int { | |||
for i, metric := range metrics { | |||
if matchPartialLabels(desc, metric.values, labels, curry) { | |||
return i | |||
} | |||
} | |||
return len(metrics) | |||
} | |||
// indexOf searches the given slice of strings for the target string and returns | |||
// the index or len(items) as well as a boolean whether the search succeeded. | |||
func indexOf(target string, items []string) (int, bool) { | |||
for i, l := range items { | |||
if l == target { | |||
return i, true | |||
} | |||
} | |||
return len(items), false | |||
} | |||
// valueMatchesVariableOrCurriedValue determines if a value was previously curried, | |||
// and returns whether it matches either the "base" value or the curried value accordingly. | |||
// It also indicates whether the match is against a curried or uncurried value. | |||
func valueMatchesVariableOrCurriedValue(targetValue string, index int, values []string, curry []curriedLabelValue) (bool, bool) { | |||
for _, curriedValue := range curry { | |||
if curriedValue.index == index { | |||
// This label was curried. See if the curried value matches our target. | |||
return curriedValue.value == targetValue, true | |||
} | |||
} | |||
// This label was not curried. See if the current value matches our target label. | |||
return values[index] == targetValue, false | |||
} | |||
// matchPartialLabels searches the current metric and returns whether all of the target label:value pairs are present. | |||
func matchPartialLabels(desc *Desc, values []string, labels Labels, curry []curriedLabelValue) bool { | |||
for l, v := range labels { | |||
// Check if the target label exists in our metrics and get the index. | |||
varLabelIndex, validLabel := indexOf(l, desc.variableLabels) | |||
if validLabel { | |||
// Check the value of that label against the target value. | |||
// We don't consider curried values in partial matches. | |||
matches, curried := valueMatchesVariableOrCurriedValue(v, varLabelIndex, values, curry) | |||
if matches && !curried { | |||
continue | |||
} | |||
} | |||
return false | |||
} | |||
return true | |||
} | |||
// getOrCreateMetricWithLabelValues retrieves the metric by hash and label value | |||
// or creates it and returns the new one. | |||
// | |||
@@ -485,7 +571,7 @@ func findMetricWithLabels( | |||
return len(metrics) | |||
} | |||
func matchLabelValues(values []string, lvs []string, curry []curriedLabelValue) bool { | |||
func matchLabelValues(values, lvs []string, curry []curriedLabelValue) bool { | |||
if len(values) != len(lvs)+len(curry) { | |||
return false | |||
} | |||
@@ -21,6 +21,8 @@ import ( | |||
"github.com/golang/protobuf/proto" | |||
dto "github.com/prometheus/client_model/go" | |||
"github.com/prometheus/client_golang/prometheus/internal" | |||
) | |||
// WrapRegistererWith returns a Registerer wrapping the provided | |||
@@ -182,7 +184,7 @@ func (m *wrappingMetric) Write(out *dto.Metric) error { | |||
Value: proto.String(lv), | |||
}) | |||
} | |||
sort.Sort(labelPairSorter(out.Label)) | |||
sort.Sort(internal.LabelPairSorter(out.Label)) | |||
return nil | |||
} | |||
@@ -0,0 +1,31 @@ | |||
// Copyright 2022 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build (darwin || freebsd || netbsd || openbsd) && gc | |||
// +build darwin freebsd netbsd openbsd | |||
// +build gc | |||
#include "textflag.h" | |||
// | |||
// System call support for ppc64, BSD | |||
// | |||
// Just jump to package syscall's implementation for all these functions. | |||
// The runtime may know about them. | |||
TEXT ·Syscall(SB),NOSPLIT,$0-56 | |||
JMP syscall·Syscall(SB) | |||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 | |||
JMP syscall·Syscall6(SB) | |||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 | |||
JMP syscall·Syscall9(SB) | |||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 | |||
JMP syscall·RawSyscall(SB) | |||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 | |||
JMP syscall·RawSyscall6(SB) |
@@ -4,9 +4,7 @@ | |||
package unix | |||
import ( | |||
"unsafe" | |||
) | |||
import "unsafe" | |||
// IoctlRetInt performs an ioctl operation specified by req on a device | |||
// associated with opened file descriptor fd, and returns a non-negative | |||
@@ -217,3 +215,19 @@ func IoctlKCMAttach(fd int, info KCMAttach) error { | |||
func IoctlKCMUnattach(fd int, info KCMUnattach) error { | |||
return ioctlPtr(fd, SIOCKCMUNATTACH, unsafe.Pointer(&info)) | |||
} | |||
// IoctlLoopGetStatus64 gets the status of the loop device associated with the | |||
// file descriptor fd using the LOOP_GET_STATUS64 operation. | |||
func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) { | |||
var value LoopInfo64 | |||
if err := ioctlPtr(fd, LOOP_GET_STATUS64, unsafe.Pointer(&value)); err != nil { | |||
return nil, err | |||
} | |||
return &value, nil | |||
} | |||
// IoctlLoopSetStatus64 sets the status of the loop device associated with the | |||
// file descriptor fd using the LOOP_SET_STATUS64 operation. | |||
func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error { | |||
return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value)) | |||
} |
@@ -73,12 +73,12 @@ aix_ppc64) | |||
darwin_amd64) | |||
mkerrors="$mkerrors -m64" | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs" | |||
mkasm="go run mkasm_darwin.go" | |||
mkasm="go run mkasm.go" | |||
;; | |||
darwin_arm64) | |||
mkerrors="$mkerrors -m64" | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs" | |||
mkasm="go run mkasm_darwin.go" | |||
mkasm="go run mkasm.go" | |||
;; | |||
dragonfly_amd64) | |||
mkerrors="$mkerrors -m64" | |||
@@ -142,33 +142,33 @@ netbsd_arm64) | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs" | |||
;; | |||
openbsd_386) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors -m32" | |||
mksyscall="go run mksyscall.go -l32 -openbsd" | |||
mksyscall="go run mksyscall.go -l32 -openbsd -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs" | |||
;; | |||
openbsd_amd64) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors -m64" | |||
mksyscall="go run mksyscall.go -openbsd" | |||
mksyscall="go run mksyscall.go -openbsd -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs" | |||
;; | |||
openbsd_arm) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors" | |||
mksyscall="go run mksyscall.go -l32 -openbsd -arm" | |||
mksyscall="go run mksyscall.go -l32 -openbsd -arm -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" | |||
# Let the type of C char be signed for making the bare syscall | |||
# API consistent across platforms. | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" | |||
;; | |||
openbsd_arm64) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors -m64" | |||
mksyscall="go run mksyscall.go -openbsd" | |||
mksyscall="go run mksyscall.go -openbsd -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" | |||
# Let the type of C char be signed for making the bare syscall | |||
# API consistent across platforms. | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" | |||
@@ -182,6 +182,24 @@ openbsd_mips64) | |||
# API consistent across platforms. | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" | |||
;; | |||
openbsd_ppc64) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors -m64" | |||
mksyscall="go run mksyscall.go -openbsd -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
# Let the type of C char be signed for making the bare syscall | |||
# API consistent across platforms. | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" | |||
;; | |||
openbsd_riscv64) | |||
mkasm="go run mkasm.go" | |||
mkerrors="$mkerrors -m64" | |||
mksyscall="go run mksyscall.go -openbsd -libc" | |||
mksysctl="go run mksysctl_openbsd.go" | |||
# Let the type of C char be signed for making the bare syscall | |||
# API consistent across platforms. | |||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" | |||
;; | |||
solaris_amd64) | |||
mksyscall="go run mksyscall_solaris.go" | |||
mkerrors="$mkerrors -m64" | |||
@@ -214,11 +232,6 @@ esac | |||
if [ "$GOOSARCH" == "aix_ppc64" ]; then | |||
# aix/ppc64 script generates files instead of writing to stdin. | |||
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; | |||
elif [ "$GOOS" == "darwin" ]; then | |||
# 1.12 and later, syscalls via libSystem | |||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; | |||
# 1.13 and later, syscalls via libSystem (including syscallPtr) | |||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go"; | |||
elif [ "$GOOS" == "illumos" ]; then | |||
# illumos code generation requires a --illumos switch | |||
echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go"; | |||
@@ -232,5 +245,5 @@ esac | |||
if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi | |||
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi | |||
if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; fi | |||
if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi | |||
if [ -n "$mkasm" ]; then echo "$mkasm $GOOS $GOARCH"; fi | |||
) | $run |
@@ -642,7 +642,7 @@ errors=$( | |||
signals=$( | |||
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | | |||
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | | |||
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | | |||
grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | | |||
sort | |||
) | |||
@@ -652,7 +652,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags | | |||
sort >_error.grep | |||
echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags | | |||
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | | |||
egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | | |||
grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' | | |||
sort >_signal.grep | |||
echo '// mkerrors.sh' "$@" | |||
@@ -1,27 +0,0 @@ | |||
// 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. | |||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris | |||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris | |||
package unix | |||
func itoa(val int) string { // do it here rather than with fmt to avoid dependency | |||
if val < 0 { | |||
return "-" + uitoa(uint(-val)) | |||
} | |||
return uitoa(uint(val)) | |||
} | |||
func uitoa(val uint) string { | |||
var buf [32]byte // big enough for int64 | |||
i := len(buf) - 1 | |||
for val >= 10 { | |||
buf[i] = byte(val%10 + '0') | |||
i-- | |||
val /= 10 | |||
} | |||
buf[i] = byte(val + '0') | |||
return string(buf[i:]) | |||
} |
@@ -29,8 +29,6 @@ import ( | |||
"bytes" | |||
"strings" | |||
"unsafe" | |||
"golang.org/x/sys/internal/unsafeheader" | |||
) | |||
// ByteSliceFromString returns a NUL-terminated slice of bytes | |||
@@ -82,13 +80,7 @@ func BytePtrToString(p *byte) string { | |||
ptr = unsafe.Pointer(uintptr(ptr) + 1) | |||
} | |||
var s []byte | |||
h := (*unsafeheader.Slice)(unsafe.Pointer(&s)) | |||
h.Data = unsafe.Pointer(p) | |||
h.Len = n | |||
h.Cap = n | |||
return string(s) | |||
return string(unsafe.Slice(p, n)) | |||
} | |||
// Single-word zero for use when we need a valid pointer to 0 bytes. | |||
@@ -1,32 +0,0 @@ | |||
// Copyright 2019 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build darwin && go1.12 && !go1.13 | |||
// +build darwin,go1.12,!go1.13 | |||
package unix | |||
import ( | |||
"unsafe" | |||
) | |||
const _SYS_GETDIRENTRIES64 = 344 | |||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { | |||
// To implement this using libSystem we'd need syscall_syscallPtr for | |||
// fdopendir. However, syscallPtr was only added in Go 1.13, so we fall | |||
// back to raw syscalls for this func on Go 1.12. | |||
var p unsafe.Pointer | |||
if len(buf) > 0 { | |||
p = unsafe.Pointer(&buf[0]) | |||
} else { | |||
p = unsafe.Pointer(&_zero) | |||
} | |||
r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) | |||
n = int(r0) | |||
if e1 != 0 { | |||
return n, errnoErr(e1) | |||
} | |||
return n, nil | |||
} |
@@ -1,108 +0,0 @@ | |||
// Copyright 2019 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build darwin && go1.13 | |||
// +build darwin,go1.13 | |||
package unix | |||
import ( | |||
"unsafe" | |||
"golang.org/x/sys/internal/unsafeheader" | |||
) | |||
//sys closedir(dir uintptr) (err error) | |||
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) | |||
func fdopendir(fd int) (dir uintptr, err error) { | |||
r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0) | |||
dir = uintptr(r0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_fdopendir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib" | |||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { | |||
// Simulate Getdirentries using fdopendir/readdir_r/closedir. | |||
// We store the number of entries to skip in the seek | |||
// offset of fd. See issue #31368. | |||
// It's not the full required semantics, but should handle the case | |||
// of calling Getdirentries or ReadDirent repeatedly. | |||
// It won't handle assigning the results of lseek to *basep, or handle | |||
// the directory being edited underfoot. | |||
skip, err := Seek(fd, 0, 1 /* SEEK_CUR */) | |||
if err != nil { | |||
return 0, err | |||
} | |||
// We need to duplicate the incoming file descriptor | |||
// because the caller expects to retain control of it, but | |||
// fdopendir expects to take control of its argument. | |||
// Just Dup'ing the file descriptor is not enough, as the | |||
// result shares underlying state. Use Openat to make a really | |||
// new file descriptor referring to the same directory. | |||
fd2, err := Openat(fd, ".", O_RDONLY, 0) | |||
if err != nil { | |||
return 0, err | |||
} | |||
d, err := fdopendir(fd2) | |||
if err != nil { | |||
Close(fd2) | |||
return 0, err | |||
} | |||
defer closedir(d) | |||
var cnt int64 | |||
for { | |||
var entry Dirent | |||
var entryp *Dirent | |||
e := readdir_r(d, &entry, &entryp) | |||
if e != 0 { | |||
return n, errnoErr(e) | |||
} | |||
if entryp == nil { | |||
break | |||
} | |||
if skip > 0 { | |||
skip-- | |||
cnt++ | |||
continue | |||
} | |||
reclen := int(entry.Reclen) | |||
if reclen > len(buf) { | |||
// Not enough room. Return for now. | |||
// The counter will let us know where we should start up again. | |||
// Note: this strategy for suspending in the middle and | |||
// restarting is O(n^2) in the length of the directory. Oh well. | |||
break | |||
} | |||
// Copy entry into return buffer. | |||
var s []byte | |||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&s)) | |||
hdr.Data = unsafe.Pointer(&entry) | |||
hdr.Cap = reclen | |||
hdr.Len = reclen | |||
copy(buf, s) | |||
buf = buf[reclen:] | |||
n += reclen | |||
cnt++ | |||
} | |||
// Set the seek offset of the input fd to record | |||
// how many files we've already returned. | |||
_, err = Seek(fd, cnt, 0 /* SEEK_SET */) | |||
if err != nil { | |||
return n, err | |||
} | |||
return n, nil | |||
} |
@@ -19,6 +19,96 @@ import ( | |||
"unsafe" | |||
) | |||
//sys closedir(dir uintptr) (err error) | |||
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) | |||
func fdopendir(fd int) (dir uintptr, err error) { | |||
r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0) | |||
dir = uintptr(r0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_fdopendir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib" | |||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { | |||
// Simulate Getdirentries using fdopendir/readdir_r/closedir. | |||
// We store the number of entries to skip in the seek | |||
// offset of fd. See issue #31368. | |||
// It's not the full required semantics, but should handle the case | |||
// of calling Getdirentries or ReadDirent repeatedly. | |||
// It won't handle assigning the results of lseek to *basep, or handle | |||
// the directory being edited underfoot. | |||
skip, err := Seek(fd, 0, 1 /* SEEK_CUR */) | |||
if err != nil { | |||
return 0, err | |||
} | |||
// We need to duplicate the incoming file descriptor | |||
// because the caller expects to retain control of it, but | |||
// fdopendir expects to take control of its argument. | |||
// Just Dup'ing the file descriptor is not enough, as the | |||
// result shares underlying state. Use Openat to make a really | |||
// new file descriptor referring to the same directory. | |||
fd2, err := Openat(fd, ".", O_RDONLY, 0) | |||
if err != nil { | |||
return 0, err | |||
} | |||
d, err := fdopendir(fd2) | |||
if err != nil { | |||
Close(fd2) | |||
return 0, err | |||
} | |||
defer closedir(d) | |||
var cnt int64 | |||
for { | |||
var entry Dirent | |||
var entryp *Dirent | |||
e := readdir_r(d, &entry, &entryp) | |||
if e != 0 { | |||
return n, errnoErr(e) | |||
} | |||
if entryp == nil { | |||
break | |||
} | |||
if skip > 0 { | |||
skip-- | |||
cnt++ | |||
continue | |||
} | |||
reclen := int(entry.Reclen) | |||
if reclen > len(buf) { | |||
// Not enough room. Return for now. | |||
// The counter will let us know where we should start up again. | |||
// Note: this strategy for suspending in the middle and | |||
// restarting is O(n^2) in the length of the directory. Oh well. | |||
break | |||
} | |||
// Copy entry into return buffer. | |||
s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen) | |||
copy(buf, s) | |||
buf = buf[reclen:] | |||
n += reclen | |||
cnt++ | |||
} | |||
// Set the seek offset of the input fd to record | |||
// how many files we've already returned. | |||
_, err = Seek(fd, cnt, 0 /* SEEK_SET */) | |||
if err != nil { | |||
return n, err | |||
} | |||
return n, nil | |||
} | |||
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. | |||
type SockaddrDatalink struct { | |||
Len uint8 | |||
@@ -61,7 +61,7 @@ func PtraceGetFsBase(pid int, fsbase *int64) (err error) { | |||
} | |||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)} | |||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) | |||
return int(ioDesc.Len), err | |||
} |
@@ -61,7 +61,7 @@ func PtraceGetFsBase(pid int, fsbase *int64) (err error) { | |||
} | |||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) | |||
return int(ioDesc.Len), err | |||
} |
@@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e | |||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) | |||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)} | |||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) | |||
return int(ioDesc.Len), err | |||
} |
@@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e | |||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) | |||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) | |||
return int(ioDesc.Len), err | |||
} |
@@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e | |||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) | |||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)} | |||
err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) | |||
return int(ioDesc.Len), err | |||
} |
@@ -10,8 +10,6 @@ | |||
package unix | |||
import ( | |||
"fmt" | |||
"runtime" | |||
"unsafe" | |||
) | |||
@@ -79,107 +77,3 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { | |||
} | |||
return | |||
} | |||
//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) | |||
func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { | |||
var clp, datap *strbuf | |||
if len(cl) > 0 { | |||
clp = &strbuf{ | |||
Len: int32(len(cl)), | |||
Buf: (*int8)(unsafe.Pointer(&cl[0])), | |||
} | |||
} | |||
if len(data) > 0 { | |||
datap = &strbuf{ | |||
Len: int32(len(data)), | |||
Buf: (*int8)(unsafe.Pointer(&data[0])), | |||
} | |||
} | |||
return putmsg(fd, clp, datap, flags) | |||
} | |||
//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) | |||
func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { | |||
var clp, datap *strbuf | |||
if len(cl) > 0 { | |||
clp = &strbuf{ | |||
Maxlen: int32(len(cl)), | |||
Buf: (*int8)(unsafe.Pointer(&cl[0])), | |||
} | |||
} | |||
if len(data) > 0 { | |||
datap = &strbuf{ | |||
Maxlen: int32(len(data)), | |||
Buf: (*int8)(unsafe.Pointer(&data[0])), | |||
} | |||
} | |||
if err = getmsg(fd, clp, datap, &flags); err != nil { | |||
return nil, nil, 0, err | |||
} | |||
if len(cl) > 0 { | |||
retCl = cl[:clp.Len] | |||
} | |||
if len(data) > 0 { | |||
retData = data[:datap.Len] | |||
} | |||
return retCl, retData, flags, nil | |||
} | |||
func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) { | |||
return ioctlRet(fd, req, uintptr(arg)) | |||
} | |||
func IoctlSetString(fd int, req uint, val string) error { | |||
bs := make([]byte, len(val)+1) | |||
copy(bs[:len(bs)-1], val) | |||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0]))) | |||
runtime.KeepAlive(&bs[0]) | |||
return err | |||
} | |||
// Lifreq Helpers | |||
func (l *Lifreq) SetName(name string) error { | |||
if len(name) >= len(l.Name) { | |||
return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1) | |||
} | |||
for i := range name { | |||
l.Name[i] = int8(name[i]) | |||
} | |||
return nil | |||
} | |||
func (l *Lifreq) SetLifruInt(d int) { | |||
*(*int)(unsafe.Pointer(&l.Lifru[0])) = d | |||
} | |||
func (l *Lifreq) GetLifruInt() int { | |||
return *(*int)(unsafe.Pointer(&l.Lifru[0])) | |||
} | |||
func (l *Lifreq) SetLifruUint(d uint) { | |||
*(*uint)(unsafe.Pointer(&l.Lifru[0])) = d | |||
} | |||
func (l *Lifreq) GetLifruUint() uint { | |||
return *(*uint)(unsafe.Pointer(&l.Lifru[0])) | |||
} | |||
func IoctlLifreq(fd int, req uint, l *Lifreq) error { | |||
return ioctl(fd, req, uintptr(unsafe.Pointer(l))) | |||
} | |||
// Strioctl Helpers | |||
func (s *Strioctl) SetInt(i int) { | |||
s.Len = int32(unsafe.Sizeof(i)) | |||
s.Dp = (*int8)(unsafe.Pointer(&i)) | |||
} | |||
func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) { | |||
return ioctlRet(fd, req, uintptr(unsafe.Pointer(s))) | |||
} |
@@ -13,6 +13,7 @@ package unix | |||
import ( | |||
"encoding/binary" | |||
"strconv" | |||
"syscall" | |||
"time" | |||
"unsafe" | |||
@@ -233,7 +234,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) error { | |||
func Futimes(fd int, tv []Timeval) (err error) { | |||
// Believe it or not, this is the best we can do on Linux | |||
// (and is what glibc does). | |||
return Utimes("/proc/self/fd/"+itoa(fd), tv) | |||
return Utimes("/proc/self/fd/"+strconv.Itoa(fd), tv) | |||
} | |||
const ImplementsGetwd = true | |||
@@ -1891,17 +1892,28 @@ func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uint | |||
return int(ret), nil | |||
} | |||
// issue 1435. | |||
// On linux Setuid and Setgid only affects the current thread, not the process. | |||
// This does not match what most callers expect so we must return an error | |||
// here rather than letting the caller think that the call succeeded. | |||
func Setuid(uid int) (err error) { | |||
return EOPNOTSUPP | |||
return syscall.Setuid(uid) | |||
} | |||
func Setgid(gid int) (err error) { | |||
return syscall.Setgid(gid) | |||
} | |||
func Setreuid(ruid, euid int) (err error) { | |||
return syscall.Setreuid(ruid, euid) | |||
} | |||
func Setregid(rgid, egid int) (err error) { | |||
return syscall.Setregid(rgid, egid) | |||
} | |||
func Setgid(uid int) (err error) { | |||
return EOPNOTSUPP | |||
func Setresuid(ruid, euid, suid int) (err error) { | |||
return syscall.Setresuid(ruid, euid, suid) | |||
} | |||
func Setresgid(rgid, egid, sgid int) (err error) { | |||
return syscall.Setresgid(rgid, egid, sgid) | |||
} | |||
// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set. | |||
@@ -2240,7 +2252,7 @@ func (fh *FileHandle) Bytes() []byte { | |||
if n == 0 { | |||
return nil | |||
} | |||
return (*[1 << 30]byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type)) + 4))[:n:n] | |||
return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n) | |||
} | |||
// NameToHandleAt wraps the name_to_handle_at system call; it obtains | |||
@@ -2356,6 +2368,16 @@ func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) { | |||
return prev, nil | |||
} | |||
//sysnb rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) = SYS_RT_SIGPROCMASK | |||
func PthreadSigmask(how int, set, oldset *Sigset_t) error { | |||
if oldset != nil { | |||
// Explicitly clear in case Sigset_t is larger than _C__NSIG. | |||
*oldset = Sigset_t{} | |||
} | |||
return rtSigprocmask(how, set, oldset, _C__NSIG/8) | |||
} | |||
/* | |||
* Unimplemented | |||
*/ | |||
@@ -2414,7 +2436,6 @@ func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) { | |||
// RestartSyscall | |||
// RtSigaction | |||
// RtSigpending | |||
// RtSigprocmask | |||
// RtSigqueueinfo | |||
// RtSigreturn | |||
// RtSigsuspend | |||
@@ -41,10 +41,6 @@ func setTimeval(sec, usec int64) Timeval { | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 | |||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 | |||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 | |||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 | |||
//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32 | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 | |||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) | |||
@@ -46,11 +46,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
@@ -62,10 +62,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { | |||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT | |||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 | |||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 | |||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 | |||
//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32 | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 | |||
@@ -39,11 +39,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
@@ -34,10 +34,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
@@ -37,11 +37,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
//sys Statfs(path string, buf *Statfs_t) (err error) | |||
@@ -32,10 +32,6 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) | |||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) | |||
@@ -34,10 +34,6 @@ import ( | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 | |||
@@ -34,11 +34,7 @@ package unix | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) | |||
@@ -38,11 +38,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
@@ -34,11 +34,7 @@ import ( | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) | |||
//sys Statfs(path string, buf *Statfs_t) (err error) | |||
@@ -31,11 +31,7 @@ package unix | |||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) | |||
//sys setfsgid(gid int) (prev int, err error) | |||
//sys setfsuid(uid int) (prev int, err error) | |||
//sysnb Setregid(rgid int, egid int) (err error) | |||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) | |||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) | |||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) | |||
//sysnb Setreuid(ruid int, euid int) (err error) | |||
//sys Shutdown(fd int, how int) (err error) | |||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) | |||
//sys Stat(path string, stat *Stat_t) (err error) | |||
@@ -0,0 +1,27 @@ | |||
// Copyright 2022 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build openbsd && !mips64 | |||
// +build openbsd,!mips64 | |||
package unix | |||
import _ "unsafe" | |||
// Implemented in the runtime package (runtime/sys_openbsd3.go) | |||
func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) | |||
func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) | |||
func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) | |||
func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) | |||
func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) | |||
//go:linkname syscall_syscall syscall.syscall | |||
//go:linkname syscall_syscall6 syscall.syscall6 | |||
//go:linkname syscall_syscall10 syscall.syscall10 | |||
//go:linkname syscall_rawSyscall syscall.rawSyscall | |||
//go:linkname syscall_rawSyscall6 syscall.rawSyscall6 | |||
func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { | |||
return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) | |||
} |
@@ -0,0 +1,42 @@ | |||
// Copyright 2019 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build ppc64 && openbsd | |||
// +build ppc64,openbsd | |||
package unix | |||
func setTimespec(sec, nsec int64) Timespec { | |||
return Timespec{Sec: sec, Nsec: nsec} | |||
} | |||
func setTimeval(sec, usec int64) Timeval { | |||
return Timeval{Sec: sec, Usec: usec} | |||
} | |||
func SetKevent(k *Kevent_t, fd, mode, flags int) { | |||
k.Ident = uint64(fd) | |||
k.Filter = int16(mode) | |||
k.Flags = uint16(flags) | |||
} | |||
func (iov *Iovec) SetLen(length int) { | |||
iov.Len = uint64(length) | |||
} | |||
func (msghdr *Msghdr) SetControllen(length int) { | |||
msghdr.Controllen = uint32(length) | |||
} | |||
func (msghdr *Msghdr) SetIovlen(length int) { | |||
msghdr.Iovlen = uint32(length) | |||
} | |||
func (cmsg *Cmsghdr) SetLen(length int) { | |||
cmsg.Len = uint32(length) | |||
} | |||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions | |||
// of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. | |||
const SYS___SYSCTL = SYS_SYSCTL |
@@ -0,0 +1,42 @@ | |||
// Copyright 2019 The Go Authors. All rights reserved. | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build riscv64 && openbsd | |||
// +build riscv64,openbsd | |||
package unix | |||
func setTimespec(sec, nsec int64) Timespec { | |||
return Timespec{Sec: sec, Nsec: nsec} | |||
} | |||
func setTimeval(sec, usec int64) Timeval { | |||
return Timeval{Sec: sec, Usec: usec} | |||
} | |||
func SetKevent(k *Kevent_t, fd, mode, flags int) { | |||
k.Ident = uint64(fd) | |||
k.Filter = int16(mode) | |||
k.Flags = uint16(flags) | |||
} | |||
func (iov *Iovec) SetLen(length int) { | |||
iov.Len = uint64(length) | |||
} | |||
func (msghdr *Msghdr) SetControllen(length int) { | |||
msghdr.Controllen = uint32(length) | |||
} | |||
func (msghdr *Msghdr) SetIovlen(length int) { | |||
msghdr.Iovlen = uint32(length) | |||
} | |||
func (cmsg *Cmsghdr) SetLen(length int) { | |||
cmsg.Len = uint32(length) | |||
} | |||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions | |||
// of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. | |||
const SYS___SYSCTL = SYS_SYSCTL |
@@ -750,8 +750,8 @@ type EventPort struct { | |||
// we should handle things gracefully. To do so, we need to keep an extra | |||
// reference to the cookie around until the event is processed | |||
// thus the otherwise seemingly extraneous "cookies" map | |||
// The key of this map is a pointer to the corresponding &fCookie.cookie | |||
cookies map[*interface{}]*fileObjCookie | |||
// The key of this map is a pointer to the corresponding fCookie | |||
cookies map[*fileObjCookie]struct{} | |||
} | |||
// PortEvent is an abstraction of the port_event C struct. | |||
@@ -778,7 +778,7 @@ func NewEventPort() (*EventPort, error) { | |||
port: port, | |||
fds: make(map[uintptr]*fileObjCookie), | |||
paths: make(map[string]*fileObjCookie), | |||
cookies: make(map[*interface{}]*fileObjCookie), | |||
cookies: make(map[*fileObjCookie]struct{}), | |||
} | |||
return e, nil | |||
} | |||
@@ -799,6 +799,7 @@ func (e *EventPort) Close() error { | |||
} | |||
e.fds = nil | |||
e.paths = nil | |||
e.cookies = nil | |||
return nil | |||
} | |||
@@ -826,17 +827,16 @@ func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, coo | |||
if _, found := e.paths[path]; found { | |||
return fmt.Errorf("%v is already associated with this Event Port", path) | |||
} | |||
fobj, err := createFileObj(path, stat) | |||
fCookie, err := createFileObjCookie(path, stat, cookie) | |||
if err != nil { | |||
return err | |||
} | |||
fCookie := &fileObjCookie{fobj, cookie} | |||
_, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fobj)), events, (*byte)(unsafe.Pointer(&fCookie.cookie))) | |||
_, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fCookie.fobj)), events, (*byte)(unsafe.Pointer(fCookie))) | |||
if err != nil { | |||
return err | |||
} | |||
e.paths[path] = fCookie | |||
e.cookies[&fCookie.cookie] = fCookie | |||
e.cookies[fCookie] = struct{}{} | |||
return nil | |||
} | |||
@@ -858,7 +858,7 @@ func (e *EventPort) DissociatePath(path string) error { | |||
if err == nil { | |||
// dissociate was successful, safe to delete the cookie | |||
fCookie := e.paths[path] | |||
delete(e.cookies, &fCookie.cookie) | |||
delete(e.cookies, fCookie) | |||
} | |||
delete(e.paths, path) | |||
return err | |||
@@ -871,13 +871,16 @@ func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) erro | |||
if _, found := e.fds[fd]; found { | |||
return fmt.Errorf("%v is already associated with this Event Port", fd) | |||
} | |||
fCookie := &fileObjCookie{nil, cookie} | |||
_, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(&fCookie.cookie))) | |||
fCookie, err := createFileObjCookie("", nil, cookie) | |||
if err != nil { | |||
return err | |||
} | |||
_, err = port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(fCookie))) | |||
if err != nil { | |||
return err | |||
} | |||
e.fds[fd] = fCookie | |||
e.cookies[&fCookie.cookie] = fCookie | |||
e.cookies[fCookie] = struct{}{} | |||
return nil | |||
} | |||
@@ -896,27 +899,31 @@ func (e *EventPort) DissociateFd(fd uintptr) error { | |||
if err == nil { | |||
// dissociate was successful, safe to delete the cookie | |||
fCookie := e.fds[fd] | |||
delete(e.cookies, &fCookie.cookie) | |||
delete(e.cookies, fCookie) | |||
} | |||
delete(e.fds, fd) | |||
return err | |||
} | |||
func createFileObj(name string, stat os.FileInfo) (*fileObj, error) { | |||
fobj := new(fileObj) | |||
bs, err := ByteSliceFromString(name) | |||
if err != nil { | |||
return nil, err | |||
} | |||
fobj.Name = (*int8)(unsafe.Pointer(&bs[0])) | |||
s := stat.Sys().(*syscall.Stat_t) | |||
fobj.Atim.Sec = s.Atim.Sec | |||
fobj.Atim.Nsec = s.Atim.Nsec | |||
fobj.Mtim.Sec = s.Mtim.Sec | |||
fobj.Mtim.Nsec = s.Mtim.Nsec | |||
fobj.Ctim.Sec = s.Ctim.Sec | |||
fobj.Ctim.Nsec = s.Ctim.Nsec | |||
return fobj, nil | |||
func createFileObjCookie(name string, stat os.FileInfo, cookie interface{}) (*fileObjCookie, error) { | |||
fCookie := new(fileObjCookie) | |||
fCookie.cookie = cookie | |||
if name != "" && stat != nil { | |||
fCookie.fobj = new(fileObj) | |||
bs, err := ByteSliceFromString(name) | |||
if err != nil { | |||
return nil, err | |||
} | |||
fCookie.fobj.Name = (*int8)(unsafe.Pointer(&bs[0])) | |||
s := stat.Sys().(*syscall.Stat_t) | |||
fCookie.fobj.Atim.Sec = s.Atim.Sec | |||
fCookie.fobj.Atim.Nsec = s.Atim.Nsec | |||
fCookie.fobj.Mtim.Sec = s.Mtim.Sec | |||
fCookie.fobj.Mtim.Nsec = s.Mtim.Nsec | |||
fCookie.fobj.Ctim.Sec = s.Ctim.Sec | |||
fCookie.fobj.Ctim.Nsec = s.Ctim.Nsec | |||
} | |||
return fCookie, nil | |||
} | |||
// GetOne wraps port_get(3c) and returns a single PortEvent. | |||
@@ -929,44 +936,50 @@ func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) { | |||
p := new(PortEvent) | |||
e.mu.Lock() | |||
defer e.mu.Unlock() | |||
e.peIntToExt(pe, p) | |||
err = e.peIntToExt(pe, p) | |||
if err != nil { | |||
return nil, err | |||
} | |||
return p, nil | |||
} | |||
// peIntToExt converts a cgo portEvent struct into the friendlier PortEvent | |||
// NOTE: Always call this function while holding the e.mu mutex | |||
func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) { | |||
func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) error { | |||
if e.cookies == nil { | |||
return fmt.Errorf("this EventPort is already closed") | |||
} | |||
peExt.Events = peInt.Events | |||
peExt.Source = peInt.Source | |||
cookie := (*interface{})(unsafe.Pointer(peInt.User)) | |||
peExt.Cookie = *cookie | |||
fCookie := (*fileObjCookie)(unsafe.Pointer(peInt.User)) | |||
_, found := e.cookies[fCookie] | |||
if !found { | |||
panic("unexpected event port address; may be due to kernel bug; see https://go.dev/issue/54254") | |||
} | |||
peExt.Cookie = fCookie.cookie | |||
delete(e.cookies, fCookie) | |||
switch peInt.Source { | |||
case PORT_SOURCE_FD: | |||
delete(e.cookies, cookie) | |||
peExt.Fd = uintptr(peInt.Object) | |||
// Only remove the fds entry if it exists and this cookie matches | |||
if fobj, ok := e.fds[peExt.Fd]; ok { | |||
if &fobj.cookie == cookie { | |||
if fobj == fCookie { | |||
delete(e.fds, peExt.Fd) | |||
} | |||
} | |||
case PORT_SOURCE_FILE: | |||
if fCookie, ok := e.cookies[cookie]; ok && uintptr(unsafe.Pointer(fCookie.fobj)) == uintptr(peInt.Object) { | |||
// Use our stashed reference rather than using unsafe on what we got back | |||
// the unsafe version would be (*fileObj)(unsafe.Pointer(uintptr(peInt.Object))) | |||
peExt.fobj = fCookie.fobj | |||
} else { | |||
panic("mismanaged memory") | |||
} | |||
delete(e.cookies, cookie) | |||
peExt.fobj = fCookie.fobj | |||
peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name))) | |||
// Only remove the paths entry if it exists and this cookie matches | |||
if fobj, ok := e.paths[peExt.Path]; ok { | |||
if &fobj.cookie == cookie { | |||
if fobj == fCookie { | |||
delete(e.paths, peExt.Path) | |||
} | |||
} | |||
} | |||
return nil | |||
} | |||
// Pending wraps port_getn(3c) and returns how many events are pending. | |||
@@ -990,7 +1003,7 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) | |||
got := uint32(min) | |||
max := uint32(len(s)) | |||
var err error | |||
ps := make([]portEvent, max, max) | |||
ps := make([]portEvent, max) | |||
_, err = port_getn(e.port, &ps[0], max, &got, timeout) | |||
// got will be trustworthy with ETIME, but not any other error. | |||
if err != nil && err != ETIME { | |||
@@ -998,8 +1011,122 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) | |||
} | |||
e.mu.Lock() | |||
defer e.mu.Unlock() | |||
valid := 0 | |||
for i := 0; i < int(got); i++ { | |||
e.peIntToExt(&ps[i], &s[i]) | |||
err2 := e.peIntToExt(&ps[i], &s[i]) | |||
if err2 != nil { | |||
if valid == 0 && err == nil { | |||
// If err2 is the only error and there are no valid events | |||
// to return, return it to the caller. | |||
err = err2 | |||
} | |||
break | |||
} | |||
valid = i + 1 | |||
} | |||
return valid, err | |||
} | |||
//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) | |||
func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { | |||
var clp, datap *strbuf | |||
if len(cl) > 0 { | |||
clp = &strbuf{ | |||
Len: int32(len(cl)), | |||
Buf: (*int8)(unsafe.Pointer(&cl[0])), | |||
} | |||
} | |||
return int(got), err | |||
if len(data) > 0 { | |||
datap = &strbuf{ | |||
Len: int32(len(data)), | |||
Buf: (*int8)(unsafe.Pointer(&data[0])), | |||
} | |||
} | |||
return putmsg(fd, clp, datap, flags) | |||
} | |||
//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) | |||
func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { | |||
var clp, datap *strbuf | |||
if len(cl) > 0 { | |||
clp = &strbuf{ | |||
Maxlen: int32(len(cl)), | |||
Buf: (*int8)(unsafe.Pointer(&cl[0])), | |||
} | |||
} | |||
if len(data) > 0 { | |||
datap = &strbuf{ | |||
Maxlen: int32(len(data)), | |||
Buf: (*int8)(unsafe.Pointer(&data[0])), | |||
} | |||
} | |||
if err = getmsg(fd, clp, datap, &flags); err != nil { | |||
return nil, nil, 0, err | |||
} | |||
if len(cl) > 0 { | |||
retCl = cl[:clp.Len] | |||
} | |||
if len(data) > 0 { | |||
retData = data[:datap.Len] | |||
} | |||
return retCl, retData, flags, nil | |||
} | |||
func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) { | |||
return ioctlRet(fd, req, uintptr(arg)) | |||
} | |||
func IoctlSetString(fd int, req uint, val string) error { | |||
bs := make([]byte, len(val)+1) | |||
copy(bs[:len(bs)-1], val) | |||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0]))) | |||
runtime.KeepAlive(&bs[0]) | |||
return err | |||
} | |||
// Lifreq Helpers | |||
func (l *Lifreq) SetName(name string) error { | |||
if len(name) >= len(l.Name) { | |||
return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1) | |||
} | |||
for i := range name { | |||
l.Name[i] = int8(name[i]) | |||
} | |||
return nil | |||
} | |||
func (l *Lifreq) SetLifruInt(d int) { | |||
*(*int)(unsafe.Pointer(&l.Lifru[0])) = d | |||
} | |||
func (l *Lifreq) GetLifruInt() int { | |||
return *(*int)(unsafe.Pointer(&l.Lifru[0])) | |||
} | |||
func (l *Lifreq) SetLifruUint(d uint) { | |||
*(*uint)(unsafe.Pointer(&l.Lifru[0])) = d | |||
} | |||
func (l *Lifreq) GetLifruUint() uint { | |||
return *(*uint)(unsafe.Pointer(&l.Lifru[0])) | |||
} | |||
func IoctlLifreq(fd int, req uint, l *Lifreq) error { | |||
return ioctl(fd, req, uintptr(unsafe.Pointer(l))) | |||
} | |||
// Strioctl Helpers | |||
func (s *Strioctl) SetInt(i int) { | |||
s.Len = int32(unsafe.Sizeof(i)) | |||
s.Dp = (*int8)(unsafe.Pointer(&i)) | |||
} | |||
func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) { | |||
return ioctlRet(fd, req, uintptr(unsafe.Pointer(s))) | |||
} |
@@ -13,8 +13,6 @@ import ( | |||
"sync" | |||
"syscall" | |||
"unsafe" | |||
"golang.org/x/sys/internal/unsafeheader" | |||
) | |||
var ( | |||
@@ -117,11 +115,7 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d | |||
} | |||
// Use unsafe to convert addr into a []byte. | |||
var b []byte | |||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b)) | |||
hdr.Data = unsafe.Pointer(addr) | |||
hdr.Cap = length | |||
hdr.Len = length | |||
b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length) | |||
// Register mapping in m and return it. | |||
p := &b[cap(b)-1] | |||
@@ -429,11 +423,15 @@ func Send(s int, buf []byte, flags int) (err error) { | |||
} | |||
func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) { | |||
ptr, n, err := to.sockaddr() | |||
if err != nil { | |||
return err | |||
var ptr unsafe.Pointer | |||
var salen _Socklen | |||
if to != nil { | |||
ptr, salen, err = to.sockaddr() | |||
if err != nil { | |||
return err | |||
} | |||
} | |||
return sendto(fd, p, flags, ptr, n) | |||
return sendto(fd, p, flags, ptr, salen) | |||
} | |||
func SetsockoptByte(fd, level, opt int, value byte) (err error) { | |||
@@ -2,11 +2,9 @@ | |||
// Use of this source code is governed by a BSD-style | |||
// license that can be found in the LICENSE file. | |||
//go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 | |||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris | |||
//go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc | |||
// +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris | |||
// +build gc | |||
// +build !ppc64le | |||
// +build !ppc64 | |||
package unix | |||
@@ -7,11 +7,7 @@ | |||
package unix | |||
import ( | |||
"unsafe" | |||
"golang.org/x/sys/internal/unsafeheader" | |||
) | |||
import "unsafe" | |||
// SysvShmAttach attaches the Sysv shared memory segment associated with the | |||
// shared memory identifier id. | |||
@@ -34,12 +30,7 @@ func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { | |||
} | |||
// Use unsafe to convert addr into a []byte. | |||
// TODO: convert to unsafe.Slice once we can assume Go 1.17 | |||
var b []byte | |||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b)) | |||
hdr.Data = unsafe.Pointer(addr) | |||
hdr.Cap = int(info.Segsz) | |||
hdr.Len = int(info.Segsz) | |||
b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) | |||
return b, nil | |||
} | |||
@@ -160,13 +160,12 @@ func Lremovexattr(link string, attr string) (err error) { | |||
} | |||
func Listxattr(file string, dest []byte) (sz int, err error) { | |||
d := initxattrdest(dest, 0) | |||
destsiz := len(dest) | |||
// FreeBSD won't allow you to list xattrs from multiple namespaces | |||
s := 0 | |||
s, pos := 0, 0 | |||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { | |||
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) | |||
stmp, e := ListxattrNS(file, nsid, dest[pos:]) | |||
/* Errors accessing system attrs are ignored so that | |||
* we can implement the Linux-like behavior of omitting errors that | |||
@@ -175,66 +174,102 @@ func Listxattr(file string, dest []byte) (sz int, err error) { | |||
* Linux will still error if we ask for user attributes on a file that | |||
* we don't have read permissions on, so don't ignore those errors | |||
*/ | |||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} else if e != nil { | |||
if e != nil { | |||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} | |||
return s, e | |||
} | |||
s += stmp | |||
destsiz -= s | |||
if destsiz < 0 { | |||
destsiz = 0 | |||
pos = s | |||
if pos > destsiz { | |||
pos = destsiz | |||
} | |||
d = initxattrdest(dest, s) | |||
} | |||
return s, nil | |||
} | |||
func Flistxattr(fd int, dest []byte) (sz int, err error) { | |||
func ListxattrNS(file string, nsid int, dest []byte) (sz int, err error) { | |||
d := initxattrdest(dest, 0) | |||
destsiz := len(dest) | |||
s := 0 | |||
s, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) | |||
if e != nil { | |||
return 0, err | |||
} | |||
return s, nil | |||
} | |||
func Flistxattr(fd int, dest []byte) (sz int, err error) { | |||
destsiz := len(dest) | |||
s, pos := 0, 0 | |||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { | |||
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) | |||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} else if e != nil { | |||
stmp, e := FlistxattrNS(fd, nsid, dest[pos:]) | |||
if e != nil { | |||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} | |||
return s, e | |||
} | |||
s += stmp | |||
destsiz -= s | |||
if destsiz < 0 { | |||
destsiz = 0 | |||
pos = s | |||
if pos > destsiz { | |||
pos = destsiz | |||
} | |||
d = initxattrdest(dest, s) | |||
} | |||
return s, nil | |||
} | |||
func Llistxattr(link string, dest []byte) (sz int, err error) { | |||
func FlistxattrNS(fd int, nsid int, dest []byte) (sz int, err error) { | |||
d := initxattrdest(dest, 0) | |||
destsiz := len(dest) | |||
s := 0 | |||
s, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) | |||
if e != nil { | |||
return 0, err | |||
} | |||
return s, nil | |||
} | |||
func Llistxattr(link string, dest []byte) (sz int, err error) { | |||
destsiz := len(dest) | |||
s, pos := 0, 0 | |||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { | |||
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) | |||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} else if e != nil { | |||
stmp, e := LlistxattrNS(link, nsid, dest[pos:]) | |||
if e != nil { | |||
if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { | |||
continue | |||
} | |||
return s, e | |||
} | |||
s += stmp | |||
destsiz -= s | |||
if destsiz < 0 { | |||
destsiz = 0 | |||
pos = s | |||
if pos > destsiz { | |||
pos = destsiz | |||
} | |||
d = initxattrdest(dest, s) | |||
} | |||
return s, nil | |||
} | |||
func LlistxattrNS(link string, nsid int, dest []byte) (sz int, err error) { | |||
d := initxattrdest(dest, 0) | |||
destsiz := len(dest) | |||
s, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) | |||
if e != nil { | |||
return 0, err | |||
} | |||
return s, nil | |||
@@ -1,40 +0,0 @@ | |||
// go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go | |||
// Code generated by the command above; see README.md. DO NOT EDIT. | |||
//go:build darwin && amd64 && go1.13 | |||
// +build darwin,amd64,go1.13 | |||
package unix | |||
import ( | |||
"syscall" | |||
"unsafe" | |||
) | |||
var _ syscall.Errno | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func closedir(dir uintptr) (err error) { | |||
_, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_closedir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { | |||
r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) | |||
res = Errno(r0) | |||
return | |||
} | |||
var libc_readdir_r_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" |
@@ -1,25 +0,0 @@ | |||
// go run mkasm_darwin.go amd64 | |||
// Code generated by the command above; DO NOT EDIT. | |||
//go:build go1.13 | |||
// +build go1.13 | |||
#include "textflag.h" | |||
TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fdopendir(SB) | |||
GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) | |||
TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_closedir(SB) | |||
GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) | |||
TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readdir_r(SB) | |||
GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) |
@@ -1,8 +1,8 @@ | |||
// go run mksyscall.go -tags darwin,amd64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go | |||
// go run mksyscall.go -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go | |||
// Code generated by the command above; see README.md. DO NOT EDIT. | |||
//go:build darwin && amd64 && go1.12 | |||
// +build darwin,amd64,go1.12 | |||
//go:build darwin && amd64 | |||
// +build darwin,amd64 | |||
package unix | |||
@@ -463,6 +463,32 @@ var libc_munlockall_trampoline_addr uintptr | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func closedir(dir uintptr) (err error) { | |||
_, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_closedir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { | |||
r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) | |||
res = Errno(r0) | |||
return | |||
} | |||
var libc_readdir_r_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func pipe(p *[2]int32) (err error) { | |||
_, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0) | |||
if e1 != 0 { | |||
@@ -1,11 +1,14 @@ | |||
// go run mkasm_darwin.go amd64 | |||
// go run mkasm.go darwin amd64 | |||
// Code generated by the command above; DO NOT EDIT. | |||
//go:build go1.12 | |||
// +build go1.12 | |||
#include "textflag.h" | |||
TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fdopendir(SB) | |||
GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) | |||
TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgroups(SB) | |||
@@ -174,6 +177,18 @@ TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) | |||
TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_closedir(SB) | |||
GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) | |||
TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readdir_r(SB) | |||
GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) | |||
TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pipe(SB) | |||
@@ -1,40 +0,0 @@ | |||
// go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go | |||
// Code generated by the command above; see README.md. DO NOT EDIT. | |||
//go:build darwin && arm64 && go1.13 | |||
// +build darwin,arm64,go1.13 | |||
package unix | |||
import ( | |||
"syscall" | |||
"unsafe" | |||
) | |||
var _ syscall.Errno | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func closedir(dir uintptr) (err error) { | |||
_, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_closedir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { | |||
r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) | |||
res = Errno(r0) | |||
return | |||
} | |||
var libc_readdir_r_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" |
@@ -1,25 +0,0 @@ | |||
// go run mkasm_darwin.go arm64 | |||
// Code generated by the command above; DO NOT EDIT. | |||
//go:build go1.13 | |||
// +build go1.13 | |||
#include "textflag.h" | |||
TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fdopendir(SB) | |||
GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) | |||
TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_closedir(SB) | |||
GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) | |||
TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readdir_r(SB) | |||
GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) |
@@ -1,8 +1,8 @@ | |||
// go run mksyscall.go -tags darwin,arm64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go | |||
// go run mksyscall.go -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go | |||
// Code generated by the command above; see README.md. DO NOT EDIT. | |||
//go:build darwin && arm64 && go1.12 | |||
// +build darwin,arm64,go1.12 | |||
//go:build darwin && arm64 | |||
// +build darwin,arm64 | |||
package unix | |||
@@ -463,6 +463,32 @@ var libc_munlockall_trampoline_addr uintptr | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func closedir(dir uintptr) (err error) { | |||
_, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
var libc_closedir_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { | |||
r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) | |||
res = Errno(r0) | |||
return | |||
} | |||
var libc_readdir_r_trampoline_addr uintptr | |||
//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func pipe(p *[2]int32) (err error) { | |||
_, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0) | |||
if e1 != 0 { | |||
@@ -1,11 +1,14 @@ | |||
// go run mkasm_darwin.go arm64 | |||
// go run mkasm.go darwin arm64 | |||
// Code generated by the command above; DO NOT EDIT. | |||
//go:build go1.12 | |||
// +build go1.12 | |||
#include "textflag.h" | |||
TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fdopendir(SB) | |||
GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) | |||
TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgroups(SB) | |||
@@ -174,6 +177,18 @@ TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) | |||
TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_closedir(SB) | |||
GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) | |||
TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readdir_r(SB) | |||
GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) | |||
TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pipe(SB) | |||
@@ -15,25 +15,19 @@ import ( | |||
//go:cgo_import_dynamic libc_writev writev "libc.so" | |||
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" | |||
//go:cgo_import_dynamic libc_accept4 accept4 "libsocket.so" | |||
//go:cgo_import_dynamic libc_putmsg putmsg "libc.so" | |||
//go:cgo_import_dynamic libc_getmsg getmsg "libc.so" | |||
//go:linkname procreadv libc_readv | |||
//go:linkname procpreadv libc_preadv | |||
//go:linkname procwritev libc_writev | |||
//go:linkname procpwritev libc_pwritev | |||
//go:linkname procaccept4 libc_accept4 | |||
//go:linkname procputmsg libc_putmsg | |||
//go:linkname procgetmsg libc_getmsg | |||
var ( | |||
procreadv, | |||
procpreadv, | |||
procwritev, | |||
procpwritev, | |||
procaccept4, | |||
procputmsg, | |||
procgetmsg syscallFunc | |||
procaccept4 syscallFunc | |||
) | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
@@ -106,23 +100,3 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) { | |||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procputmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(flags), 0, 0) | |||
if e1 != 0 { | |||
err = e1 | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) { | |||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(unsafe.Pointer(flags)), 0, 0) | |||
if e1 != 0 { | |||
err = e1 | |||
} | |||
return | |||
} |
@@ -2151,3 +2151,13 @@ func setitimer(which int, newValue *Itimerval, oldValue *Itimerval) (err error) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) { | |||
_, _, e1 := RawSyscall6(SYS_RT_SIGPROCMASK, uintptr(how), uintptr(unsafe.Pointer(set)), uintptr(unsafe.Pointer(oldset)), uintptr(sigsetsize), 0, 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} |
@@ -287,46 +287,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { | |||
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) | |||
n = int(r0) | |||
@@ -334,36 +334,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -374,16 +344,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -412,46 +412,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -289,36 +289,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -329,16 +299,6 @@ func setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -223,46 +223,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -248,46 +248,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -278,36 +278,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -318,16 +288,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -278,36 +278,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -318,16 +288,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -248,46 +248,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -308,46 +308,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -349,36 +349,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -389,16 +359,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -349,36 +349,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -389,16 +359,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -269,36 +269,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -309,16 +279,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -319,36 +319,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -359,16 +329,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { | |||
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) | |||
n = int64(r0) | |||
@@ -329,36 +329,6 @@ func setfsuid(uid int) (prev int, err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setregid(rgid int, egid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresgid(rgid int, egid int, sgid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setresuid(ruid int, euid int, suid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) | |||
if e1 != 0 { | |||
@@ -369,16 +339,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Setreuid(ruid int, euid int) (err error) { | |||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) | |||
if e1 != 0 { | |||
err = errnoErr(e1) | |||
} | |||
return | |||
} | |||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |||
func Shutdown(fd int, how int) (err error) { | |||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) | |||
if e1 != 0 { | |||
@@ -0,0 +1,796 @@ | |||
// go run mkasm.go openbsd 386 | |||
// Code generated by the command above; DO NOT EDIT. | |||
#include "textflag.h" | |||
TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgroups(SB) | |||
GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) | |||
TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgroups(SB) | |||
GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) | |||
TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_wait4(SB) | |||
GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) | |||
TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_accept(SB) | |||
GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) | |||
TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_bind(SB) | |||
GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) | |||
TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_connect(SB) | |||
GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) | |||
TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socket(SB) | |||
GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) | |||
TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockopt(SB) | |||
GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) | |||
TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsockopt(SB) | |||
GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) | |||
TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpeername(SB) | |||
GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) | |||
TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockname(SB) | |||
GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) | |||
TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_shutdown(SB) | |||
GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) | |||
TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socketpair(SB) | |||
GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) | |||
TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvfrom(SB) | |||
GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) | |||
TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendto(SB) | |||
GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) | |||
TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvmsg(SB) | |||
GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) | |||
TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendmsg(SB) | |||
GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) | |||
TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kevent(SB) | |||
GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) | |||
TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimes(SB) | |||
GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) | |||
TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_futimes(SB) | |||
GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) | |||
TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_poll(SB) | |||
GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) | |||
TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_madvise(SB) | |||
GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) | |||
TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlock(SB) | |||
GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) | |||
TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlockall(SB) | |||
GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) | |||
TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mprotect(SB) | |||
GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) | |||
TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_msync(SB) | |||
GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) | |||
TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlock(SB) | |||
GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) | |||
TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlockall(SB) | |||
GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) | |||
TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pipe2(SB) | |||
GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) | |||
TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getdents(SB) | |||
GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) | |||
TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getcwd(SB) | |||
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) | |||
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ioctl(SB) | |||
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) | |||
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sysctl(SB) | |||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) | |||
TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ppoll(SB) | |||
GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) | |||
TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_access(SB) | |||
GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) | |||
TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_adjtime(SB) | |||
GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) | |||
TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chdir(SB) | |||
GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) | |||
TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chflags(SB) | |||
GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) | |||
TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chmod(SB) | |||
GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) | |||
TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chown(SB) | |||
GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) | |||
TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chroot(SB) | |||
GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) | |||
TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_close(SB) | |||
GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) | |||
TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup(SB) | |||
GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) | |||
TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup2(SB) | |||
GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) | |||
TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup3(SB) | |||
GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) | |||
TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_exit(SB) | |||
GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) | |||
TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_faccessat(SB) | |||
GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) | |||
TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchdir(SB) | |||
GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) | |||
TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchflags(SB) | |||
GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) | |||
TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmod(SB) | |||
GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) | |||
TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmodat(SB) | |||
GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) | |||
TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchown(SB) | |||
GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) | |||
TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchownat(SB) | |||
GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) | |||
TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_flock(SB) | |||
GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) | |||
TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fpathconf(SB) | |||
GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) | |||
TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstat(SB) | |||
GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) | |||
TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatat(SB) | |||
GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) | |||
TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatfs(SB) | |||
GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) | |||
TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fsync(SB) | |||
GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) | |||
TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ftruncate(SB) | |||
GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) | |||
TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getegid(SB) | |||
GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) | |||
TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_geteuid(SB) | |||
GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) | |||
TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgid(SB) | |||
GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) | |||
TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgid(SB) | |||
GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) | |||
TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgrp(SB) | |||
GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) | |||
TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpid(SB) | |||
GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) | |||
TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getppid(SB) | |||
GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) | |||
TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpriority(SB) | |||
GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) | |||
TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrlimit(SB) | |||
GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) | |||
TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrtable(SB) | |||
GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) | |||
TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrusage(SB) | |||
GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) | |||
TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsid(SB) | |||
GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) | |||
TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_gettimeofday(SB) | |||
GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) | |||
TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getuid(SB) | |||
GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) | |||
TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_issetugid(SB) | |||
GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) | |||
TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kill(SB) | |||
GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) | |||
TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kqueue(SB) | |||
GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) | |||
TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lchown(SB) | |||
GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) | |||
TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_link(SB) | |||
GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) | |||
TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_linkat(SB) | |||
GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) | |||
TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_listen(SB) | |||
GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) | |||
TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lstat(SB) | |||
GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) | |||
TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdir(SB) | |||
GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) | |||
TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdirat(SB) | |||
GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) | |||
TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifo(SB) | |||
GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) | |||
TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifoat(SB) | |||
GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) | |||
TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknod(SB) | |||
GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) | |||
TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknodat(SB) | |||
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) | |||
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_nanosleep(SB) | |||
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) | |||
TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_open(SB) | |||
GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) | |||
TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_openat(SB) | |||
GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) | |||
TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pathconf(SB) | |||
GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) | |||
TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pread(SB) | |||
GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) | |||
TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pwrite(SB) | |||
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) | |||
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_read(SB) | |||
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) | |||
TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlink(SB) | |||
GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) | |||
TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlinkat(SB) | |||
GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) | |||
TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rename(SB) | |||
GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) | |||
TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_renameat(SB) | |||
GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) | |||
TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_revoke(SB) | |||
GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) | |||
TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rmdir(SB) | |||
GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) | |||
TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lseek(SB) | |||
GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) | |||
TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_select(SB) | |||
GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) | |||
TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setegid(SB) | |||
GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) | |||
TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_seteuid(SB) | |||
GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) | |||
TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgid(SB) | |||
GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) | |||
TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setlogin(SB) | |||
GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) | |||
TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpgid(SB) | |||
GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) | |||
TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpriority(SB) | |||
GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) | |||
TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setregid(SB) | |||
GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) | |||
TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setreuid(SB) | |||
GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) | |||
TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresgid(SB) | |||
GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) | |||
TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresuid(SB) | |||
GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) | |||
TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrlimit(SB) | |||
GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setrlimit_trampoline_addr(SB)/4, $libc_setrlimit_trampoline<>(SB) | |||
TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrtable(SB) | |||
GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) | |||
TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsid(SB) | |||
GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) | |||
TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_settimeofday(SB) | |||
GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) | |||
TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setuid(SB) | |||
GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) | |||
TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_stat(SB) | |||
GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) | |||
TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_statfs(SB) | |||
GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) | |||
TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlink(SB) | |||
GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) | |||
TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlinkat(SB) | |||
GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) | |||
TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sync(SB) | |||
GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) | |||
TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_truncate(SB) | |||
GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) | |||
TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_umask(SB) | |||
GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) | |||
TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlink(SB) | |||
GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) | |||
TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlinkat(SB) | |||
GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) | |||
TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unmount(SB) | |||
GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) | |||
TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_write(SB) | |||
GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) | |||
TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mmap(SB) | |||
GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) | |||
TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munmap(SB) | |||
GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) | |||
TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimensat(SB) | |||
GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) |
@@ -0,0 +1,796 @@ | |||
// go run mkasm.go openbsd amd64 | |||
// Code generated by the command above; DO NOT EDIT. | |||
#include "textflag.h" | |||
TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgroups(SB) | |||
GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) | |||
TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgroups(SB) | |||
GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) | |||
TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_wait4(SB) | |||
GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) | |||
TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_accept(SB) | |||
GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) | |||
TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_bind(SB) | |||
GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) | |||
TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_connect(SB) | |||
GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) | |||
TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socket(SB) | |||
GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) | |||
TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockopt(SB) | |||
GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) | |||
TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsockopt(SB) | |||
GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) | |||
TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpeername(SB) | |||
GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) | |||
TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockname(SB) | |||
GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) | |||
TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_shutdown(SB) | |||
GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) | |||
TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socketpair(SB) | |||
GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) | |||
TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvfrom(SB) | |||
GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) | |||
TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendto(SB) | |||
GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) | |||
TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvmsg(SB) | |||
GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) | |||
TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendmsg(SB) | |||
GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) | |||
TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kevent(SB) | |||
GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) | |||
TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimes(SB) | |||
GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) | |||
TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_futimes(SB) | |||
GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) | |||
TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_poll(SB) | |||
GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) | |||
TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_madvise(SB) | |||
GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) | |||
TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlock(SB) | |||
GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) | |||
TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlockall(SB) | |||
GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) | |||
TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mprotect(SB) | |||
GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) | |||
TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_msync(SB) | |||
GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) | |||
TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlock(SB) | |||
GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) | |||
TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlockall(SB) | |||
GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) | |||
TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pipe2(SB) | |||
GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) | |||
TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getdents(SB) | |||
GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) | |||
TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getcwd(SB) | |||
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) | |||
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ioctl(SB) | |||
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) | |||
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sysctl(SB) | |||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) | |||
TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ppoll(SB) | |||
GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) | |||
TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_access(SB) | |||
GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) | |||
TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_adjtime(SB) | |||
GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) | |||
TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chdir(SB) | |||
GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) | |||
TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chflags(SB) | |||
GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) | |||
TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chmod(SB) | |||
GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) | |||
TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chown(SB) | |||
GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) | |||
TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chroot(SB) | |||
GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) | |||
TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_close(SB) | |||
GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) | |||
TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup(SB) | |||
GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) | |||
TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup2(SB) | |||
GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) | |||
TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup3(SB) | |||
GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) | |||
TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_exit(SB) | |||
GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) | |||
TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_faccessat(SB) | |||
GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) | |||
TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchdir(SB) | |||
GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) | |||
TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchflags(SB) | |||
GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) | |||
TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmod(SB) | |||
GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) | |||
TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmodat(SB) | |||
GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) | |||
TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchown(SB) | |||
GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) | |||
TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchownat(SB) | |||
GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) | |||
TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_flock(SB) | |||
GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) | |||
TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fpathconf(SB) | |||
GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) | |||
TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstat(SB) | |||
GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) | |||
TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatat(SB) | |||
GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) | |||
TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatfs(SB) | |||
GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) | |||
TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fsync(SB) | |||
GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) | |||
TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ftruncate(SB) | |||
GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) | |||
TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getegid(SB) | |||
GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) | |||
TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_geteuid(SB) | |||
GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) | |||
TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgid(SB) | |||
GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) | |||
TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgid(SB) | |||
GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) | |||
TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgrp(SB) | |||
GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) | |||
TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpid(SB) | |||
GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) | |||
TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getppid(SB) | |||
GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) | |||
TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpriority(SB) | |||
GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) | |||
TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrlimit(SB) | |||
GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) | |||
TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrtable(SB) | |||
GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) | |||
TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrusage(SB) | |||
GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) | |||
TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsid(SB) | |||
GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) | |||
TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_gettimeofday(SB) | |||
GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) | |||
TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getuid(SB) | |||
GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) | |||
TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_issetugid(SB) | |||
GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) | |||
TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kill(SB) | |||
GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) | |||
TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kqueue(SB) | |||
GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) | |||
TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lchown(SB) | |||
GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) | |||
TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_link(SB) | |||
GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) | |||
TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_linkat(SB) | |||
GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) | |||
TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_listen(SB) | |||
GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) | |||
TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lstat(SB) | |||
GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) | |||
TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdir(SB) | |||
GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) | |||
TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdirat(SB) | |||
GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) | |||
TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifo(SB) | |||
GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) | |||
TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifoat(SB) | |||
GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) | |||
TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknod(SB) | |||
GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) | |||
TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknodat(SB) | |||
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) | |||
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_nanosleep(SB) | |||
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) | |||
TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_open(SB) | |||
GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) | |||
TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_openat(SB) | |||
GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) | |||
TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pathconf(SB) | |||
GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) | |||
TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pread(SB) | |||
GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) | |||
TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pwrite(SB) | |||
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) | |||
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_read(SB) | |||
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) | |||
TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlink(SB) | |||
GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) | |||
TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlinkat(SB) | |||
GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) | |||
TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rename(SB) | |||
GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) | |||
TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_renameat(SB) | |||
GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) | |||
TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_revoke(SB) | |||
GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) | |||
TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rmdir(SB) | |||
GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) | |||
TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lseek(SB) | |||
GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) | |||
TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_select(SB) | |||
GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) | |||
TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setegid(SB) | |||
GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) | |||
TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_seteuid(SB) | |||
GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) | |||
TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgid(SB) | |||
GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) | |||
TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setlogin(SB) | |||
GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) | |||
TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpgid(SB) | |||
GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) | |||
TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpriority(SB) | |||
GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) | |||
TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setregid(SB) | |||
GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) | |||
TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setreuid(SB) | |||
GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) | |||
TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresgid(SB) | |||
GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) | |||
TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresuid(SB) | |||
GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) | |||
TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrlimit(SB) | |||
GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setrlimit_trampoline_addr(SB)/8, $libc_setrlimit_trampoline<>(SB) | |||
TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrtable(SB) | |||
GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) | |||
TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsid(SB) | |||
GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) | |||
TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_settimeofday(SB) | |||
GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) | |||
TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setuid(SB) | |||
GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) | |||
TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_stat(SB) | |||
GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) | |||
TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_statfs(SB) | |||
GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) | |||
TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlink(SB) | |||
GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) | |||
TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlinkat(SB) | |||
GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) | |||
TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sync(SB) | |||
GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) | |||
TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_truncate(SB) | |||
GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) | |||
TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_umask(SB) | |||
GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) | |||
TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlink(SB) | |||
GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) | |||
TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlinkat(SB) | |||
GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) | |||
TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unmount(SB) | |||
GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) | |||
TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_write(SB) | |||
GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) | |||
TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mmap(SB) | |||
GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) | |||
TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munmap(SB) | |||
GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) | |||
TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimensat(SB) | |||
GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 | |||
DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) |
@@ -0,0 +1,796 @@ | |||
// go run mkasm.go openbsd arm | |||
// Code generated by the command above; DO NOT EDIT. | |||
#include "textflag.h" | |||
TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgroups(SB) | |||
GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) | |||
TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgroups(SB) | |||
GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) | |||
TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_wait4(SB) | |||
GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) | |||
TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_accept(SB) | |||
GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) | |||
TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_bind(SB) | |||
GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) | |||
TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_connect(SB) | |||
GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) | |||
TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socket(SB) | |||
GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) | |||
TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockopt(SB) | |||
GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) | |||
TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsockopt(SB) | |||
GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) | |||
TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpeername(SB) | |||
GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) | |||
TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsockname(SB) | |||
GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) | |||
TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_shutdown(SB) | |||
GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) | |||
TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_socketpair(SB) | |||
GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) | |||
TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvfrom(SB) | |||
GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) | |||
TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendto(SB) | |||
GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) | |||
TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_recvmsg(SB) | |||
GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) | |||
TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sendmsg(SB) | |||
GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) | |||
TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kevent(SB) | |||
GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) | |||
TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimes(SB) | |||
GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) | |||
TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_futimes(SB) | |||
GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) | |||
TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_poll(SB) | |||
GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) | |||
TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_madvise(SB) | |||
GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) | |||
TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlock(SB) | |||
GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) | |||
TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mlockall(SB) | |||
GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) | |||
TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mprotect(SB) | |||
GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) | |||
TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_msync(SB) | |||
GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) | |||
TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlock(SB) | |||
GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) | |||
TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munlockall(SB) | |||
GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) | |||
TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pipe2(SB) | |||
GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) | |||
TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getdents(SB) | |||
GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) | |||
TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getcwd(SB) | |||
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) | |||
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ioctl(SB) | |||
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) | |||
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sysctl(SB) | |||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) | |||
TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ppoll(SB) | |||
GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) | |||
TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_access(SB) | |||
GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) | |||
TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_adjtime(SB) | |||
GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) | |||
TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chdir(SB) | |||
GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) | |||
TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chflags(SB) | |||
GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) | |||
TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chmod(SB) | |||
GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) | |||
TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chown(SB) | |||
GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) | |||
TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_chroot(SB) | |||
GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) | |||
TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_close(SB) | |||
GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) | |||
TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup(SB) | |||
GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) | |||
TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup2(SB) | |||
GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) | |||
TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_dup3(SB) | |||
GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) | |||
TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_exit(SB) | |||
GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) | |||
TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_faccessat(SB) | |||
GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) | |||
TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchdir(SB) | |||
GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) | |||
TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchflags(SB) | |||
GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) | |||
TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmod(SB) | |||
GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) | |||
TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchmodat(SB) | |||
GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) | |||
TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchown(SB) | |||
GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) | |||
TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fchownat(SB) | |||
GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) | |||
TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_flock(SB) | |||
GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) | |||
TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fpathconf(SB) | |||
GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) | |||
TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstat(SB) | |||
GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) | |||
TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatat(SB) | |||
GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) | |||
TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fstatfs(SB) | |||
GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) | |||
TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_fsync(SB) | |||
GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) | |||
TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_ftruncate(SB) | |||
GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) | |||
TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getegid(SB) | |||
GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) | |||
TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_geteuid(SB) | |||
GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) | |||
TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getgid(SB) | |||
GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) | |||
TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgid(SB) | |||
GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) | |||
TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpgrp(SB) | |||
GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) | |||
TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpid(SB) | |||
GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) | |||
TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getppid(SB) | |||
GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) | |||
TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getpriority(SB) | |||
GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) | |||
TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrlimit(SB) | |||
GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) | |||
TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrtable(SB) | |||
GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) | |||
TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getrusage(SB) | |||
GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) | |||
TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getsid(SB) | |||
GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) | |||
TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_gettimeofday(SB) | |||
GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) | |||
TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_getuid(SB) | |||
GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) | |||
TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_issetugid(SB) | |||
GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) | |||
TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kill(SB) | |||
GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) | |||
TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_kqueue(SB) | |||
GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) | |||
TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lchown(SB) | |||
GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) | |||
TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_link(SB) | |||
GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) | |||
TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_linkat(SB) | |||
GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) | |||
TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_listen(SB) | |||
GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) | |||
TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lstat(SB) | |||
GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) | |||
TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdir(SB) | |||
GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) | |||
TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkdirat(SB) | |||
GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) | |||
TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifo(SB) | |||
GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) | |||
TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mkfifoat(SB) | |||
GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) | |||
TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknod(SB) | |||
GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) | |||
TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mknodat(SB) | |||
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) | |||
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_nanosleep(SB) | |||
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) | |||
TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_open(SB) | |||
GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) | |||
TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_openat(SB) | |||
GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) | |||
TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pathconf(SB) | |||
GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) | |||
TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pread(SB) | |||
GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) | |||
TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_pwrite(SB) | |||
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) | |||
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_read(SB) | |||
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) | |||
TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlink(SB) | |||
GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) | |||
TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_readlinkat(SB) | |||
GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) | |||
TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rename(SB) | |||
GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) | |||
TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_renameat(SB) | |||
GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) | |||
TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_revoke(SB) | |||
GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) | |||
TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_rmdir(SB) | |||
GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) | |||
TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_lseek(SB) | |||
GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) | |||
TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_select(SB) | |||
GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) | |||
TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setegid(SB) | |||
GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) | |||
TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_seteuid(SB) | |||
GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) | |||
TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setgid(SB) | |||
GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) | |||
TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setlogin(SB) | |||
GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) | |||
TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpgid(SB) | |||
GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) | |||
TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setpriority(SB) | |||
GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) | |||
TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setregid(SB) | |||
GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) | |||
TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setreuid(SB) | |||
GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) | |||
TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresgid(SB) | |||
GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) | |||
TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setresuid(SB) | |||
GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) | |||
TEXT libc_setrlimit_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrlimit(SB) | |||
GLOBL ·libc_setrlimit_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setrlimit_trampoline_addr(SB)/4, $libc_setrlimit_trampoline<>(SB) | |||
TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setrtable(SB) | |||
GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) | |||
TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setsid(SB) | |||
GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) | |||
TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_settimeofday(SB) | |||
GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) | |||
TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_setuid(SB) | |||
GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) | |||
TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_stat(SB) | |||
GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) | |||
TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_statfs(SB) | |||
GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) | |||
TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlink(SB) | |||
GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) | |||
TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_symlinkat(SB) | |||
GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) | |||
TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_sync(SB) | |||
GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) | |||
TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_truncate(SB) | |||
GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) | |||
TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_umask(SB) | |||
GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) | |||
TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlink(SB) | |||
GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) | |||
TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unlinkat(SB) | |||
GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) | |||
TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_unmount(SB) | |||
GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) | |||
TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_write(SB) | |||
GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) | |||
TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_mmap(SB) | |||
GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) | |||
TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_munmap(SB) | |||
GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) | |||
TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 | |||
JMP libc_utimensat(SB) | |||
GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 | |||
DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) |