diff options
| author | Pimyn Girgis <bemenboshra2001@gmail.com> | 2024-08-06 14:10:45 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-08-12 09:22:32 +0000 |
| commit | 421e1cbedb47cb499201512defc2baf79d7b87f7 (patch) | |
| tree | d3575138e30c98c96e6ecc180b4b06fdcd71fa4b /pkg/vminfo/syscalls.go | |
| parent | 1fef415f27727712346c8e7ad9c945e74d217b1b (diff) | |
pkg/mgrconfig, prog, tools: allow automatically generated or manually written descriptions or both
Add "Auto" type and allow to choose descriptions mode in configurations. Defaults to using manual only.
Diffstat (limited to 'pkg/vminfo/syscalls.go')
| -rw-r--r-- | pkg/vminfo/syscalls.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/vminfo/syscalls.go b/pkg/vminfo/syscalls.go index 178e5d52c..707ab6543 100644 --- a/pkg/vminfo/syscalls.go +++ b/pkg/vminfo/syscalls.go @@ -161,7 +161,7 @@ func (ctx *checkContext) supportedSyscalls(names []string) string { } func supportedOpenat(ctx *checkContext, call *prog.Syscall) string { - fname, ok := extractStringConst(call.Args[1].Type) + fname, ok := extractStringConst(call.Args[1].Type, call.Attrs.Automatic) if !ok || fname[0] != '/' { return "" } @@ -277,7 +277,10 @@ func alwaysSupported(ctx *checkContext, call *prog.Syscall) string { return "" } -func extractStringConst(typ prog.Type) (string, bool) { +func extractStringConst(typ prog.Type, isAutomatic bool) (string, bool) { + if isAutomatic { + return "", false + } ptr, ok := typ.(*prog.PtrType) if !ok { panic("first open arg is not a pointer to string const") |
