Enumerations

enum AccessType
Name Value
Read 0
Write 1

Defined at line 508 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h

Records

Functions

  • void DropAllCapabilities ()

    Drops all capabilities from the effective, permitted, and inheritable sets.

    Defined at line 18 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapability (int cap)

    Checks if a capability is in the effective set.

    Defined at line 27 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapability (int cap)

    Unsets a capability from the effective set.

    Defined at line 30 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapabilityEffective (int cap)

    Checks whether a capability is in the thread's effective set.

    Defined at line 33 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapabilityPermitted (int cap)

    Checks whether a capability is in the thread's permitted set.

    Defined at line 43 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapabilityInheritable (int cap)

    Checks whether a capability is in the thread's inheritable set.

    Defined at line 53 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapabilityAmbient (int cap)

    Checks whether a capability is in the thread's ambient set.

    Defined at line 62 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • bool HasCapabilityBounding (int cap)

    Checks whether a capability is in the thread's bounding set.

    Defined at line 66 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapabilityEffective (int cap)

    Removes a capability from the thread's effective set.

    Defined at line 69 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapabilityPermitted (int cap)

    Removes a capability from the thread's permitted set.

    Defined at line 80 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapabilityInheritable (int cap)

    Removes a capability from the thread's inheritable set.

    Defined at line 91 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapabilityAmbient (int cap)

    Removes a capability from the thread's ambient set.

    Defined at line 102 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void UnsetCapabilityBounding (int cap)

    Removes a capability from the thread's bounded set.

    Defined at line 107 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void DropAllAmbientCapabilities ()

    Drops all capabilities from the ambient set.

    Defined at line 147 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void SetCapabilityEffective (int cap)

    Sets a capability in the thread's effective set.

    Defined at line 110 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void SetCapabilityPermitted (int cap)

    Sets a capability in the thread's permitted set.

    Defined at line 121 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void SetCapabilityInheritable (int cap)

    Sets a capability in the thread's inheritable set.

    Defined at line 132 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void SetCapabilityAmbient (int cap)

    Sets a capability in the thread's ambient set.

    Defined at line 143 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc

  • void SetCapabilityBounding (int cap)

    Sets a capability in the thread's bounding set.

  • void waitForChildSucceeds (unsigned int waitFlag, int cloneFlags, int (*)(void *) childRunFunction, int (*)(void *) parentRunFunction)

    Defined at line 284 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • void waitForChildFails (unsigned int waitFlag, int cloneFlags, int (*)(void *) childRunFunction, int (*)(void *) parentRunFunction)

    Defined at line 300 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::string get_tmp_path ()

    Defined at line 314 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::ostream & operator<< (std::ostream & os, const MemoryMappingExt & mapping)

    Defined at line 455 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::optional<size_t> parse_field_in_kb (std::string_view value)

    Defined at line 372 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::optional<MemoryMapping> find_memory_mapping (fit::function<bool (const MemoryMapping &)> match, std::string_view maps)

    Returns the first memory mapping that matches the given predicate.

    Defined at line 386 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::optional<MemoryMapping> find_memory_mapping (uintptr_t addr, std::string_view maps)

    Defined at line 403 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::optional<MemoryMappingExt> find_memory_mapping_ext (fit::function<bool (const MemoryMappingExt &)> match, std::string_view maps)

    Same as above, but with info from smaps

    Defined at line 409 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::optional<MemoryMappingExt> find_memory_mapping_ext (uintptr_t addr, std::string_view maps)

    Defined at line 447 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • std::string RandomHexString (size_t length)

    Returns a random hex string of the given length.

    Defined at line 471 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • bool HasSysAdmin ()

    Returns true if running with sysadmin capabilities.

    Defined at line 483 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • bool HasCapability (uint32_t cap)

    Returns true if running with the given capability.

  • bool IsStarnix ()

    Returns true if running on Starnix. This is likely only necessary when there are known bugs.

    Defined at line 485 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • bool IsKernelVersionAtLeast (int min_major, int min_minor)

    Returns true if reported kernel version is equal or greater than a given one.

    Defined at line 490 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • void RecursiveUnmountAndRemove (const std::string & path)

    Unmount anything mounted at or under `path` and remove it.

    Defined at line 502 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • bool TryRead (uintptr_t addr)

    Attempts to read a byte from the given memory address.

    Returns whether the read succeeded or not.

    Defined at line 544 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • bool TryWrite (uintptr_t addr)

    Attempts to write a zero byte to the given memory address.

    Returns whether the write succeeded or not.

    Defined at line 553 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • int MemFdCreate (const char * name, unsigned int flags)

    Wrapper for the memfd_create system call.

    Defined at line 534 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • int PidFdOpen (pid_t pid, unsigned int flags)

    Wrapper for the pidfd_open system call.

    Defined at line 538 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • void WaitUntilBlocked (pid_t target, bool ignore_tracer)

    Loop until the target process indicates a sleeping state in /proc/pid/stat.

    Defined at line 561 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • testing::AssertionResult TestThatAccessSegfaults (void * test_address, AccessType type)

    Checks whether the provided access segfaults.

    Defined at line 585 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • Rendezvous MakeRendezvous ()

    Constructs a new pipe-backed `Poker`-`Holder` pair for synchronization of two

    threads or processes.

    Defined at line 687 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc

  • Rendezvous MakeRendezvous (ScopedPipe pipe)

    Constructs a `Poker`-`Holder` pair from an existing pipe.

    Defined at line 689 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc