rr-debugger / rr-debugger/rr

Add back openat() wrapper

Open
#244 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

It's originating from libc in a way that we can't wrap. Here's the impl, not tested obviously

int openat(int dirfd, const char* pathname, int flags, ...)
{
    void* ptr = prep_syscall(NO_DESCHED);
    int mode = 0;
    long ret;

    if (O_CREAT & flags) {
        va_list mode_arg;
        va_start(mode_arg, flags);
        mode = va_arg(mode_arg, int);
        va_end(mode_arg);
    }
    if (!can_buffer_syscall(ptr)) {
        return syscall(SYS_openat, dirfd, pathname, flags, mode);
    }
    ret = untraced_syscall4(SYS_openat, dirfd, pathname, flags, mode);
    return commit_syscall(SYS_openat, ptr, ret, NO_DESCHED);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the existing syscall-wrapper entry points for openat and reviewing the supplied implementation, including its variadic mode handling and SYS_openat calls. Done means openat is wrapped again and its behavior is covered by the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.