diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-29 22:43:38 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-29 22:43:38 +0300 |
| commit | 7a2207e215dfde246f0e9c4e415eff962f4c044c (patch) | |
| tree | 22a155f51bc61accfb3a21133cf69ab58265263a /cmd | |
| parent | 8da6c62f617d6351a4ab6062bf2ea104b3b31ec2 (diff) | |
test(dup2): lock in fd_event handler captures oldfd (args[0])
Audit of dup2(2) found the tracing implementation already correct and
consistent with its dup/dup3 siblings: dup2 is KindFd (a plain fd_event),
the enter handler captures ev->fd from args[0] (oldfd) per the KindFd
convention, it is in the FS family, and its exit returns the new fd
(newfd/-1) as a plain UNCLASSIFIED ret_event (never a byte-count
transfer). Unlike dup3 it carries no flags and clears O_CLOEXEC on the
duplicate, which the eventloop registerDup path already honors.
No discrepancies were found, so add a lock-in test (matching prior
audits) that asserts the generated BPF C for dup2 captures fd from
args[0] (not args[1]/newfd), emits an fd_event (not a dup3_event), wires
no flags, and classifies the exit UNCLASSIFIED. Adds FormatExitDup2
testdata to drive the exit handler assertions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
0 files changed, 0 insertions, 0 deletions
