Currently, SyscallReturnCode is limited to system call return values of type i32. However, not all system calls return 32-bit integer values. For example, the read system call returns an ssize_t type, which will map to a 64-bit integer on 64-bit systems.
This PR updates SyscallReturnCode to be a generic type that can contain any signed integer value, so it can be used with other integer types. Since existing code may not specify generic type values, I set the type parameter to default to the existing type of c_int to try and preserve compatibility.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
[x] All commits in this PR are signed (with git commit -s), and the commit
message has max 60 characters for the summary and max 75 characters for each
description line.
[x] All added/changed functionality has a corresponding unit/integration
test.
[x] All added/changed public-facing functionality has entries in the "Upcoming
Release" section of CHANGELOG.md (if no such section exists, please create one).
[ ] Any newly added unsafe code is properly documented.
Summary of the PR
Currently,
SyscallReturnCode
is limited to system call return values of typei32
. However, not all system calls return 32-bit integer values. For example, theread
system call returns anssize_t
type, which will map to a 64-bit integer on 64-bit systems.This PR updates
SyscallReturnCode
to be a generic type that can contain any signed integer value, so it can be used with other integer types. Since existing code may not specify generic type values, I set the type parameter to default to the existing type ofc_int
to try and preserve compatibility.Requirements
Before submitting your PR, please make sure you addressed the following requirements:
git commit -s
), and the commit message has max 60 characters for the summary and max 75 characters for each description line.unsafe
code is properly documented.