-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/openbsd: add sysctl descriptions #1761
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you didn't write this all by hand...
Could you check out 'make generate' smoke test complaint?
Codecov Report
@@ Coverage Diff @@
## master #1761 +/- ##
========================================
- Coverage 56.7% 56.7% -0.0%
========================================
Files 148 148
Lines 27718 27719 +1
========================================
- Hits 15719 15717 -2
- Misses 11198 11201 +3
Partials 801 801
Continue to review full report at Codecov.
|
On Sun, May 24, 2020 at 10:12:58AM -0700, Greg Steuck wrote:
@blackgnezdo commented on this pull request.
I hope you didn't write this all by hand...
A semi automated process glued together with some C and shell scripting :)
Could you check out 'make generate' smoke test complaint?
Should be fixed by now.
|
# XXX can includes be made conditional based on the architecture? | ||
include <amd64/cpu.h> | ||
|
||
sysctl$ddb(name ptr[in, ctl_ddb], namelen len[name], oldp buffer[inout], oldlenp ptr[inout, len[oldp, int64]], newp buffer[in], newlen len[newp]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that namelen
is wrong here. name
is just an int array pointer, namelen
must denote the number of elements, not the number of bytes. So basically sizeof(ctl_ddb) / 4
. Can that be expressed?
/cc @dvyukov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"len": length of another field (for array it is number of elements), type-options:
argname of the object
https://github.com/google/syzkaller/blob/master/docs/syscall_descriptions_syntax.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. However I'm not able to express what I want. Ideally, I would like an array type consisting of both constant entries and others referering to another flag
type. Expressed in pseudo notation array[const[CTL_DDB, int32], flags[ctl_ddb_flags, int32]]
. Or if len
could accept an optional denominator like len[name, 4]
but that might be too tailored for my need.
Do you have any other ideas? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok, I see.
We actually have precisely bytesize4
which is sizeof/4. It won't work in general case, but will work here.
Another option would be: array of unions of const and flags (won't guarantee precise interleaving of const+flag), but len
will work.
The namelen argument must reflect the number of elements in the name vector. Since it's a vector of integers, bytesize4 seems more appropriate. With help from by Dmitry[1]. [1] #1761 (comment)
No description provided.