Skip to content
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

Merged
merged 1 commit into from
May 24, 2020
Merged

sys/openbsd: add sysctl descriptions #1761

merged 1 commit into from
May 24, 2020

Conversation

mptre
Copy link
Collaborator

@mptre mptre commented May 24, 2020

No description provided.

@mptre mptre requested review from dvyukov and blackgnezdo May 24, 2020 08:15
Copy link
Collaborator

@blackgnezdo blackgnezdo left a 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
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #1761 into master will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           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             
Impacted Files Coverage Δ
prog/rand.go 91.8% <0.0%> (-0.4%) ⬇️
pkg/build/netbsd.go 0.0% <0.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96c92ad...bd184b4. Read the comment docs.

@mptre
Copy link
Collaborator Author

mptre commented May 24, 2020 via email

@mptre mptre merged commit 1128418 into google:master May 24, 2020
@mptre mptre deleted the openbsd-sysctl branch May 24, 2020 19:38
# 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])
Copy link
Collaborator Author

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

Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

dvyukov pushed a commit that referenced this pull request May 27, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants