Commit graph

37 commits

Author SHA1 Message Date
Jason White
b7bf8c32bd Add alias for Newfstatat syscall
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
2022-11-03 12:53:11 -07:00
David Tolnay
a3ed18f93a Update libc to 0.2.137
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
2022-11-01 02:16:19 -07:00
Jason White
ada1e3c542 Get tests building under aarch64
Reviewed By: VladimirMakaev

Differential Revision: D40701839

fbshipit-source-id: e60053c7d21696e7f7dd120420b896dee3d65ba7
2022-10-27 10:56:09 -07:00
Vladimir Makaev
03cbd6044d update hermetic_infra/** files with correct license header - 1/x
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
2022-10-26 12:18:14 -07:00
Jason White
adc75712a7 Add FICLONE and FICLONERANGE ioctls
Reviewed By: igorsugak

Differential Revision: D40521846

fbshipit-source-id: 25ec8d85ee0fc3c4df07637c9623505460a6670b
2022-10-19 13:37:38 -07:00
Nofel Yaseen
79de15c108 Enable aarch64 build
Summary: Get reverie-syscalls building on aarch64

Reviewed By: jasonwhite

Differential Revision: D40323777

fbshipit-source-id: bc7a326dc06deb2247a4b2a8f784b05745e961b7
2022-10-17 12:28:12 -07:00
Sargun Dhillon
fa682caf9b Update Rust libc crate to 0.2.135
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
2022-10-13 18:51:18 -07:00
Jason White
c4bd924994 Propagate typed_syscall!{} attributes
Differential Revision: D40329620

fbshipit-source-id: 5088249785601329aee6609c4873d991bdaf38f3
2022-10-13 10:15:47 -07:00
Jason White
b973b4ad42 Propagate syscall_list!{} attributes
Differential Revision: D40323825

fbshipit-source-id: 78deea76931058ed8eeb44250a0168ef400fee8a
2022-10-12 16:34:18 -07:00
Jason White
38a3818c48 third-party/rust: Update syscalls v0.6.6 -> v0.6.7
Reviewed By: rrnewton

Differential Revision: D40312880

fbshipit-source-id: b6386d3821507787e7d76c86c1f63c265be86319
2022-10-12 14:29:02 -07:00
Sophia Sun
aadb1865e7 Update nix crate from 0.23 to 0.25
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
2022-10-03 15:31:17 -07:00
Vladimir Makayev
de2fea408e Handle 'sysinfo' system call deterministically: use static values
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
2022-09-18 18:49:13 -07:00
Andres Suarez
0f60462d16 Update libc-0.2.125 to libc-0.2.132
Reviewed By: dtolnay

Differential Revision: D39578353

fbshipit-source-id: 800721931e82485678e8ecf997afcc6711f6d4cf
2022-09-16 20:06:28 -07:00
Michael Bolin
c013909676 pin libc crate to 0.2.125
Reviewed By: ImanolBarba

Differential Revision: D39433159

fbshipit-source-id: 4442651a0874ebc6724796206db02c20e455a1c0
2022-09-12 09:55:50 -07:00
Jason White
357e7cac79 third-party/rust: Update syscalls crate v0.6.5 -> v0.6.6
Summary:
Updates the `syscalls` crate.

Changelog:
 - Added aarch64 support.

Reviewed By: psaab

Differential Revision: D38730424

fbshipit-source-id: fa7e0f65401a11c669058c5ffe280cce605ca017
2022-08-17 01:21:44 -07:00
Stiopa Koltsov
e53c5ef362 Apply rustfmt
Reviewed By: zertosh

Differential Revision: D38485027

fbshipit-source-id: 0f5e5b743e002045c95aca427b76e969d6bce347
2022-08-06 08:21:44 -07:00
Kaustav Haldar
00f0643ae1 Add bundlr-sdk to rust 3p crates
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
2022-07-22 07:22:52 -07:00
Jason White
f5c1175aa9 third-party/rust: Update syscalls 0.6.2 -> 0.6.5
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
2022-07-15 12:52:06 -07:00
Jason White
6813d9a7b2 rustfmt with imports_granularity=Item
Summary: This makes merge conflicts much easier to handle.

Reviewed By: johnhurt

Differential Revision: D37564000

fbshipit-source-id: a7f1a2711ffbdbb23c93e2f479f47d0368a2dad9
2022-06-30 14:56:20 -07:00
Jason White
d34189fda6 third-party/rust: Update syscalls crate 0.6.1 -> 0.6.2
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
2022-06-30 11:59:56 -07:00
Jason White
674fbb2af5 third-party/rust: Update syscalls 0.6.0 -> 0.6.1
Reviewed By: johnhurt

Differential Revision: D37051530

fbshipit-source-id: e21fc86f98c5f55817ba6f412d7271b3da63d7bb
2022-06-09 18:12:21 -07:00
Jason White
20c7020868 Appease the copyright linter
Summary: The OSS license linter doesn't like the word "its".

Reviewed By: johnhurt

Differential Revision: D36856385

fbshipit-source-id: 909037d96de8976f08004497d28b77838f8c6870
2022-06-02 11:51:06 -07:00
Jason White
d16ca7d7c0 Change Facebook -> Meta Platforms in Cargo.toml files
Reviewed By: johnhurt

Differential Revision: D36727976

fbshipit-source-id: 0449545ee3fb2faf4febcdec0be1d5940af5e937
2022-05-27 10:20:35 -07:00
Jason White
1bbfa8a5a2 Update copyright headers
Reviewed By: johnhurt

Differential Revision: D36727878

fbshipit-source-id: 2529052f6a81fb5a177ccdba51b7e0051577c148
2022-05-27 09:51:26 -07:00
Jason White
011e521c08 third-party/rust: Update syscalls crate 0.5 -> 0.6
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
2022-05-24 09:29:52 -07:00
Jason White
1e5ed86ae1 Prepare for syscalls crate update
Reviewed By: johnhurt

Differential Revision: D36607034

fbshipit-source-id: f50f6a21ef9c3febf6bb8fcf4a8f0b30514e6e61
2022-05-24 06:43:45 -07:00
Jason White
f507b56319 third-party/rust: Update syscalls crate to v0.5.0
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
2022-05-05 13:15:19 -07:00
Will Hughes
c2df9c5b8c Add NanosleepFamily
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
2022-04-12 12:36:22 -07:00
Huapeng Zhou
f38f5c1cbc rust: update serde_json to 1.0.79 and serde to 1.0.136
Summary:
Needed to import [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor).

(Note: this ignores all push blocking failures!)

Reviewed By: dtolnay

Differential Revision: D34433589

fbshipit-source-id: f92ea3ba640d19f170513b558f3d5208790bab67
2022-04-10 23:39:55 -07:00
Will Hughes
675073a631 Read child TID from clone family syscalls
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
2022-04-05 01:23:00 -07:00
Huapeng Zhou
7213f65761 rust: update libc from 0.2.117 to 0.2.121
Summary: Needed to import cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/Cargo.toml#L25.

Reviewed By: dtolnay

Differential Revision: D35052728

fbshipit-source-id: bdd60925501c446ee6d429fad6e95d6593ff2544
2022-03-23 10:00:47 -07:00
Javier Honduvilla Coto
36515611d2 Bump nix crate from 0.22 => 0.23
Summary:
Updating to be able to use  `pwritev` and `preadv`.

- Followed [the documentation on how to update crates](https://www.internalfb.com/intern/wiki/Rust-at-facebook/Managing_fbsource_third-party_with_Reindeer/).
- These are all the changes between our current version and the updated one: https://github.com/nix-rust/nix/compare/v0.22.0..v0.23.1. See `CHANGELOG.md` for the most significant changes in this version.

Let me know if I missed anything, this is my first crate upgrade!

Reviewed By: jsgf

Differential Revision: D34820818

fbshipit-source-id: 89f59a759bf042112e7d48612a345a8164dc7176
2022-03-22 09:26:52 -07:00
Jason White
75e875fe28 Implement local memory access
Reviewed By: johnhurt

Differential Revision: D34676792

fbshipit-source-id: 77f28c90d535ca3c50b05542e558053d1263937d
2022-03-07 13:11:06 -08:00
Jason White
eed2eba46a Add support for TIOCGPTPEER ioctl
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
2022-02-02 17:47:21 -08:00
Jason White
371f84d4d4 Add clone3 syscall support
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
2022-01-31 15:54:19 -08:00
Jason White
256fc33dd5 Remove extern crate usage
Summary: This hasn't been necessary for quite a while now.

Reviewed By: wangbj

Differential Revision: D33411662

fbshipit-source-id: e6f88834521809b59323aa9d14796ff31571e7b6
2022-01-04 18:14:12 -08:00
facebook-github-bot
15d2f61411 Initial commit
fbshipit-source-id: c440d991296c92bdc5e109a11d269049e8840e94
2021-12-29 16:14:27 -08:00