Summary: This removes the need for `safeptrace` to depend on `reverie-syscalls`, which is a somewhat heavyweight library.
Reviewed By: VladimirMakaev
Differential Revision: D41751372
fbshipit-source-id: 36f601c7f441b070cd3a0678621649c4fb12b28e
Summary:
Everything in Reverie is super Linux-specific, so we should just skip compilation if we're not targetting Linux.
This is helpful for consumers of the library when it gets published to crates.io. With this, they don't need to have a special case for this in the `[dependencies]` section of `Cargo.toml`.
Reviewed By: VladimirMakaev
Differential Revision: D41824410
fbshipit-source-id: be1e0a887e35ed151cfad27af8107246df30c2e5
Summary: `sendfile` is available on aarch64, so this was a mistake.
Differential Revision: D41590782
fbshipit-source-id: 6e704bc0c3358c232768a5382c7b5435445c3976
Summary: Adds `ReadFamily` to make it easier to handle all `read` syscall variants.
Reviewed By: igorsugak
Differential Revision: D41239542
fbshipit-source-id: 2c847e421b38281aa5243d8dfc00a8d1de0c075a
Summary: These operations are misleading and should never be called. Since the address could be a remote address, dereferencing it like this is wildly wrong. Not quite sure how they got there in the first place.
Reviewed By: igorsugak
Differential Revision: D41193389
fbshipit-source-id: 143c491df81125b319f7d5d88049021a81981795
Summary:
Implementing Displayable can be quite annoying (see D40877692)
This macro provides a boilerplate implementation for a custom struct wrapper for AddrMut<T>
Additional customization can be achieved by implementing Displayable for T
Reviewed By: jasonwhite
Differential Revision: D40946491
fbshipit-source-id: daff74b2c0c23c6d970f920c7d43ab2c381a1dcb
Summary: While investigating a test failure I've narrowed down a divergence to a gettimeofday syscall having different result in trace-replay use case in certain conditions. In this diff I'm enhacing the syscalls DETLOGS with "output buffers" derefed. Currently barelly any of the parameters are supported but hopefully we'll handle Displayable in a more general purpose way in a future
Reviewed By: jasonwhite
Differential Revision: D40877692
fbshipit-source-id: 47c3d310713e400fb2ab18dc736b84999e8c7b99
Summary: The syscall `fstatat` is defined a bit weirdly on x86-64 as `newfstatat`. To make the platform differences slightly easier to deal with, lets just define a type alias for it.
Reviewed By: wkhughes
Differential Revision: D40910778
fbshipit-source-id: 4bf307e574d2d2c13f1cf764e7604b32113d209e
Summary: Update from 0.2.135 to 0.2.137, the latest version on crates.io, in preparation for backporting a PR in the diff after this one.
Reviewed By: zertosh
Differential Revision: D40874274
fbshipit-source-id: debf9dae82ecc20201470e634f10904a2b308e51
Summary:
Followed guide here https://www.internalfb.com/intern/wiki/Linting/License_Lint/ to add fbcode/hermetic_infra/** code to license linter. As we have parts of our code shipped as Open Source it's important to get this automated
This diff is updating existing file's licenses to not get conflict after lint rule enablement
Reviewed By: jasonwhite
Differential Revision: D40674080
fbshipit-source-id: da6ecac036f8964619cf7912058f3a911558e7b1
Summary: Get reverie-syscalls building on aarch64
Reviewed By: jasonwhite
Differential Revision: D40323777
fbshipit-source-id: bc7a326dc06deb2247a4b2a8f784b05745e961b7
Summary: This updates the libc crate to 0.2.135, which includes the FICLONE constant needed to the given ioctl.
Reviewed By: justintrudell
Differential Revision: D40286796
fbshipit-source-id: acfa115479cd289f478d8d73937be34ced5c4bbb
Summary:
When I was trying to use `nix::unistd::gethostname` in D39783468, the version `0.23.0` will require users to pass in a `buf` as a parameter, however, in `0.25.0`, there is no need to pass in a `buf` as a parameter. Hence, I would love to update `nix` crate from `0.23` to `0.25` in order to not pass a redundant `buf` while calling `nix::unistd::gethostname`.
I fixed conflicts reflected from the signals manually so this diff is more than a few lines of code in `Cargo.toml`.
Here are the [changes](https://github.com/nix-rust/nix/compare/v0.23.0..v0.25.0) between `0.23` and `0.25`. See `CHANGELOG.md` for the most significant changes in this version.
Reviewed By: bgw
Differential Revision: D39919100
fbshipit-source-id: 7f62585ff72230bd2608aeb5a4780dc0128795f7
Summary: Currently 'sysinfo' isn't being captured and determinized this might be a source of some divergencies in heap & stack. This diff with handle 'sysinfo' with hardcoded reasonable values. Follow up diffs with further enhance this
Reviewed By: rrnewton
Differential Revision: D39546772
fbshipit-source-id: a5a49e882a0fea4512bf991d257b0f8072f7f792
Summary:
Add bundlr-sdk to rust 3p crates.
Also needed some new fixups for a couple deps, and a custom fork of bundlr to use derive_builder 0.9 which is pinned in 2 deps we use, and fixed a missing out of scope trait bug in bundlr sdk.
Reviewed By: zhuomingfb0
Differential Revision: D37962056
fbshipit-source-id: 878048840d66dffcf558351614c45f9beef2f626
Summary:
## v0.6.5
- Renamed `with-serde` feature to just `serde`. The `with-serde` feature will
be removed in the next major release.
- Implemented `Serialize` and `Deserialize` for `SysnoSet`.
## v0.6.4
- Implemented `Default`, `BitOr`, and `BitOrAssign` for `SysnoSet`.
## v0.6.3
- Added features to expose the syscall tables of other architectures besides
the target architecture. There is one feature per architecture and have the
same name. For example, if the target architecture is `x86-64` and we also
want the syscall table for `x86`, the `x86` feature can be enabled. Then,
`syscalls::x86::Sysno` will be exposed.
- Added the `all` feature, which enables the syscall tables for all
architectures.
- Added the `full` feature, which enables all current and future features for
the crate.
- Added man page links for all syscalls. Since these are generated, some links
may be broken.
Reviewed By: johnhurt
Differential Revision: D37871066
fbshipit-source-id: 4aa4674d0dcf1168d989a34062befa3b07456d68
Summary: This makes merge conflicts much easier to handle.
Reviewed By: johnhurt
Differential Revision: D37564000
fbshipit-source-id: a7f1a2711ffbdbb23c93e2f479f47d0368a2dad9
Summary:
From the changelog:
- Added `SysnoSet` for constructing sets of syscalls. It uses a bitset under
the hood and provides constant-time lookup and insertion of `Sysno`s.
- Fixed `Sysno::len()` returning the wrong value for architectures with large
syscall offsets.
- Deprecated `Sysno::len()`. Use `Sysno::table_size()` instead. This will be
removed in the next major version.
Differential Revision: D37556871
fbshipit-source-id: a287f2146a0776e6f0459a08b43a1d5a92bb6176
Summary: The OSS license linter doesn't like the word "its".
Reviewed By: johnhurt
Differential Revision: D36856385
fbshipit-source-id: 909037d96de8976f08004497d28b77838f8c6870
Summary:
Changelog:
* Removed `build.rs` and switched to Rust's inline assembly syntax. This should enable better codegen, including the ability to have syscalls get inlined.
* **Breaking**: Architectures besides `arm`, `x86`, and `x86-64` now require nightly.
* **Breaking**: Removed top-level `SYS_` constants. Just use the `Sysno` enum instead.
Reviewed By: johnhurt
Differential Revision: D36606892
fbshipit-source-id: 9d20addfec65fa712b25d9449ec6e414187565ca
Summary:
See https://github.com/jasonwhite/syscalls/blob/master/CHANGELOG.md
The biggest change here is that the type of syscall registers and return values was changed from `u64` to `usize` (to support 32-bit architectures).
Reviewed By: zertosh
Differential Revision: D36157822
fbshipit-source-id: d8776b6809dd00df93b147ee34deb37df61a2675
Summary:
Add NanosleepFamily of syscalls, namely `nanosleep` and `clock_nanosleep`.
`nanosleep` can be transformed into `clock_nanosleep` by using clockid `CLOCK_REALTIME` and flags 0 (i.e., *not* `TIMER_ABSTIME`).
Reviewed By: johnhurt
Differential Revision: D35577747
fbshipit-source-id: 5925b083b4a49cdbfdff11117156d6366947d706
Summary: Expose the child TID arg passed to clone family syscalls. For fork and vfork this will be 0 as child TID is not an arg, for clone and clone3 this is read from the args.
Reviewed By: jasonwhite
Differential Revision: D35370069
fbshipit-source-id: 32821152adaadd17c66f334f286f5410fabd4b97
Summary:
This is called when creating a slave from a master pty and returns a file descriptor.
Usage example:
```
async fn handle_ioctl<G: Guest<Self>>(
&self,
guest: &mut G,
syscall: Ioctl,
) -> Result<i64, Errno> {
use reverie::syscalls::ioctl;
match syscall.request() {
ioctl::Request::TIOCGPTPEER(flags) => {
let fd = guest.inject(syscall).await?;
// Do something with the flags and fd ...
Ok(fd)
}
_ => Ok(guest.inject(syscall).await?)
}
}
```
Reviewed By: wangbj, igorsugak
Differential Revision: D33961825
fbshipit-source-id: 0e6d4a0ed984a4b96b2501095dd44a978030788e
Summary: Adds support for the `clone3` syscall, which is now used by `pthread_create`. This also introduces `CloneFamily`, which abstracts `fork`, `vfork`, `clone`, and `clone3`.
Reviewed By: johnhurt
Differential Revision: D33865362
fbshipit-source-id: 8b91225c63ff6a8aa9c283877a30f58aa4cd9bb2
Summary: This hasn't been necessary for quite a while now.
Reviewed By: wangbj
Differential Revision: D33411662
fbshipit-source-id: e6f88834521809b59323aa9d14796ff31571e7b6