system calls - #84
Merged
rikvanriel merged 2 commits intoAug 29, 2026
Merged
Conversation
The loop over a file's functions computes, inline, which of the file's calls fall inside one function and which of those go through a declared pointer. A body found any other way needs the same treatment and cannot reach it. Move it to a method taking a byte range. No behavioural change. Assisted-by: claw:claude-opus-5 Signed-off-by: Rik van Riel <[email protected]>
SYSCALL_DEFINE3(old_readdir, unsigned int, fd, ...)
{
error = iterate_dir(f, &buf.ctx);
}
The parser reads the invocation as an expression statement and the block as an
unrelated compound statement, so no function is found. 783 syscalls were
absent from the functions table, and with them every call their bodies make:
`callers iterate_dir` named 17 functions and none of the five syscalls that
reach it.
The names in the table were prototypes from syscalls.h with no body, which is
why counting them showed nothing missing. Counting bodies does: 233 syscall
rows had their calls recorded, 930 after this.
(semcode) callers iterate_dir
17 functions directly call 'iterate_dir':
... sys_getdents, sys_old_readdir, compat_sys_old_readdir
Both directions come from the same column, so the syscall's own chain works
too.
The shape is a file-scope invocation followed by a block, in the file or
inside a conditional: `SYSCALL_DEFINE3(old_readdir, ...)` sits inside
`#ifdef __ARCH_WANT_OLD_READDIR`, and looking only at the translation unit's
children found 717 of the 930.
A block holding an initializer is not a body. `define_machine(pseries) {
.name = ... }` has the same shape and defines no function.
The name comes from a listed family, since the prefix lives in the macro and
not at the invocation. Return type and parameters are left empty: the macro
states them in pairs the parser reads as errors, and a guess there would be
read as a fact.
Assisted-by: claw:claude-opus-5
Signed-off-by: Rik van Riel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes allow semcode to expand the macro below into sys_old_readdir, making all the system calls visible.
SYSCALL_DEFINE3(old_readdir, unsigned int, fd, ...)