1343 Commits

Author SHA1 Message Date
openharmony_ci b09f9365ea !2 Add OAT.xml and README.OpenSource
Merge pull request !2 from fangting/master
OpenHarmony-v4.1.4-Release OpenHarmony-v4.1.3-Release OpenHarmony-v4.1.2-Release OpenHarmony-v4.0.4-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2 OpenHarmony-v4.0-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.1-Beta1 OpenHarmony-v4.1-Release OpenHarmony-v4.1.1-Release master-v weekly_20240115-v
2023-04-14 08:10:21 +00:00
fangting 611ee017e3 Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:15:23 +08:00
openharmony_ci ed450fa6ed !1 [rustix]Add GN Build Files and Custom Modifications to Rust Third-party Libraries
Merge pull request !1 from lubinglun/master
2023-04-13 11:34:23 +00:00
lubinglun f422a40f64 Add GN Build Files and Custom Modifications
Issue:https://gitee.com/openharmony/build/issues/I6UFTP
Signed-off-by: lubinglun <lubinglun@huawei.com>
2023-04-12 17:26:56 +08:00
Dan Gohman 3a160ffd91 chore: Release rustix version 0.36.8 github.com/bytecodealliance/rustix/v0.36.8 2023-02-03 14:41:41 -08:00
Dan Gohman 60b2ad8c18 Update to windows-sys 0.45. (#529) 2023-02-03 14:40:21 -08:00
Jordan aa1196b00f add O_DIRECT flag (#527) 2023-02-03 14:40:21 -08:00
Alex Saveau dfbdf3c300 Add method to know when buffer will be refilled (#524)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2023-02-03 14:40:21 -08:00
Dan Gohman 5f3a7598d6 chore: Release rustix version 0.36.7 2023-01-18 11:07:35 -08:00
Dan Gohman cfad01449f Fix compilation on armv7-unknown-freebsd (#518)
* Fix compilation on armv7-unknown-freebsd

Use `time_t::MAX` to avoid depending on the relationship between
`time_t` and `c_long`.

* Silence the deprecation warning about `time_t`.
2023-01-17 12:40:15 -08:00
Dan Gohman fa90377478 Remove FreeBSD 12 from CI. (#517)
FreeBSD 12 has been failing in CI like this:

```
...
[5/5] Extracting curl-7.87.0: .......... done
curl https://sh.rustup.rs -sSf --output rustup.sh
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Exit status: 60
```

The FreeBSD 13 run still works, so switch to just testing on
FreeBSD 13.
2023-01-17 12:40:15 -08:00
Alex Saveau 2bc2229509 Simplify RawDir iteration (#515)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2023-01-17 12:40:15 -08:00
Wilfred Hughes 7fc2e48730 Fix typo in README.md (#516) 2023-01-17 12:40:15 -08:00
Dan Gohman 442220d8ee Sync with io-lifetimes' build.rs changes (#511)
As a counterpart to https://github.com/sunfishcode/io-lifetimes/pull/58,
port the changes from io-lifetimes' build.rs to rustix.
2023-01-17 12:40:15 -08:00
Alex Saveau c9fb537048 Add mount syscall (#494)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2023-01-17 12:40:15 -08:00
Alex Saveau dfcc45d79e Fix Fuchsia target (#504)
* Fix Fuchsia target

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Update main.yml

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2023-01-17 12:40:15 -08:00
Alex Saveau 8ba48ca279 Fix docs typo (#498) 2023-01-17 12:40:15 -08:00
Dan Gohman 3548e93dfa chore: Release rustix version 0.36.6 2022-12-26 21:03:56 -08:00
Dan Gohman 54d04c9bc8 Support preadv2 and pwritev2 on all non-glibc Linux ABIs. (#489)
Use `libc::syscall` on ABIs where libc doesn't have bindings for
`preadv2` and `pwritev2`.
2022-12-26 20:56:54 -08:00
Alex Saveau 0b844fc778 Fix another UB in raw dir (#474)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-12-13 10:40:42 -08:00
Dan Gohman 5225e27a1f Add From impls for SocketAddrAny. (#482)
This allows more convenient construction of `SocketAddrAny` values.
2022-12-13 10:27:53 -08:00
Dan Gohman 1f2532f93d Add doc aliases for seek, tell, and chownat. (#481)
* Add doc aliases for `seek`, `tell`, and `chownat`.

* Add a mention of `socket_with` in `socket`'s documentation.

* Fix a broken doc comment link.
2022-12-13 10:27:34 -08:00
Dan Gohman 3502eb064b Fix the custom definition of Timespec to implement Copy. (#484) 2022-12-13 10:25:25 -08:00
Dan Gohman 5c23ff6773 Pin CI to Ubuntu 20.04 until #483 is sorted out. 2022-12-13 08:46:14 -08:00
Dan Gohman adfe93d115 Add --features=all-apis to the Cirrus CI config.
This enables testing for all the API modules, such as fs, net, process,
and all the rest.
2022-12-05 13:38:44 -08:00
Alan Somers 282dffc589 Future-proof for FreeBSD 12 (#469)
FreeBSD 12 changes the dirent structure, among other things.  libc
currently binds a FreeBSD 11 ABI, but that will change some day.  Tweak
rustix's dirent initialization code to work with either FreeBSD 11 or
12.
2022-12-03 09:36:21 -08:00
Dan Gohman 4e2599b729 Run the tests on Rust 1.48, and check compilation of tests and examples on more targets (#465)
* Fix the tests to run on 1.48.

This puts the benchmarks behind a `criterion` cfg, so add
`--cfg=criterion` to RUSTFLAGS when running cargo bench.

An MSRV of 1.48 enables us to support users such as async-io, which also
has an MSRV of 1.48.

* Add a rust-version field.

This prints a warning under Rust 1.48, but only when rustix is the
top-level build; when rustix is a dependency, it doesn't warn, so this
seems ok.
2022-12-01 11:42:09 -08:00
Dan Gohman 815104341c Don't check the errno value from isatty. (#468)
We don't actually do anything different for different errno values,
other than panic on unknown ones, and that isn't that isn't adding
much value compared to the cost of being an extra surprise when
porting to new OS's.

Fixes #467.
2022-12-01 11:03:27 -08:00
John Nunley 849d1832e5 Deduplicate the "context" set of structures (#466)
* Deduplicate the "context" set of structures
2022-11-30 08:10:50 -08:00
Alex Saveau 2aff00c77e Fix UB due to misaligned RawDir pointer (#464)
* Fix UB due to misaligned RawDir pointer

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add alignment and stack tests to RawDir

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-29 17:05:39 -08:00
Dan Gohman 60b84026d7 Make the "param" module depend on the "fs" module.
In some configurations, the param module needs to open /proc/self/auxv,
and it needs the fs API to do that, so make the param module depend on
the fs module.

Also, disable the init_from_proc_self_auxv code on mustang, which
doesn't need it.
2022-11-28 12:36:15 -08:00
Dan Gohman d85c50603b Enable rustix::termios::isatty on wasm32-wasi. 2022-11-28 08:58:36 -08:00
Dan Gohman ef9a77313a Tidy up uses. 2022-11-28 08:58:36 -08:00
Dan Gohman 8fca74091c Tidy up cfgs. 2022-11-28 08:58:36 -08:00
Dan Gohman f6f44b7b05 Implement unshare. (#461)
Fixes #452.
2022-11-28 08:52:24 -08:00
Alex Saveau b5c2ea7127 Add zero-compromise directory iteration (#457)
* Add zero-compromise directory iteration

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Address review feedback

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Vastly simplify file_name calculation and remove pointer manipulation BS, yielding a 2x instruction count reduction

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Implement docs changes I mentioned

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix debug impl

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Support libc backend

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Clarify portability of fixed-sized buffers

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Turns out from_ptr is faster, oh well

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Make cookie a u64

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix cfgs

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-23 15:42:07 -08:00
Dan Gohman 2aa66b2435 chore: Release rustix version 0.36.3 2022-11-22 10:39:10 -08:00
Dan Gohman 28d40939ca Minor formatting cleanups. (#459) 2022-11-21 11:18:59 -08:00
Dan Gohman c7146a721e Fix compilation with --no-default-features. (#454)
Move `fcntl_getfd`, `fcntl_setfd`, and `fcntl_dupfd_cloexec` out of
the `fs` module and into the `io` module, since they're not specific
to files, directories or memfd. This allows them to be used with the
"fs" feature is not enabled.

Also, add public aliases for then in `fs`, for compatibility, and to
have a place where all `fcntl` function are present.

And add a CI check for --no-default-features with no API features.

Fixes #453.
2022-11-21 10:56:46 -08:00
Dan Gohman d6164939a7 Fix a few clippy lints. (#458)
Fix a few minor clippy lints, and add clippy overrides for warnings that
we can't easily fix due to our MSRV, or due to our support of multiple targets.
2022-11-21 08:30:40 -08:00
Alex Saveau 74c56f3e70 Fix clippy lint (#455)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-21 06:51:33 -08:00
Dan Gohman fefe0652d7 chore: Release rustix version 0.36.2 2022-11-18 08:26:52 -08:00
Dan Gohman 8b5196283a Fix test compilation when "threads" or "procfs" aren't enabled. 2022-11-18 08:19:32 -08:00
Dan Gohman 2fc4f1be16 Disable the internal fs module when the "fs" feature isn't enabled. (#449)
Rustix no longer has anything in the tree that needs the `fs` module
when the public "fs" feature isn't enabled, so make the `fd` module
conditional on `cfg(feature = "fs")`.
2022-11-16 12:19:50 -08:00
Alex Saveau 663a74364a Use stdlib with_c_str implementation (#448) 2022-11-16 12:19:21 -08:00
Dan Gohman 2a2ef7e1c8 Remove the uid/gid checks from the procfs code entirely. (#450)
As a followup to #444, remove the uid/gid checks from the procfs code
entirely. Procfs files can have their owner changed to root:root under
`PR_SET_DUMPABLE`, and root can be remapped to nobody by user
namespaces.

This check wasn't guarding against a known problem, and it's complex
to make sure it doesn't spuriously fail under any vald configuration,
so just remove it.
2022-11-15 16:21:16 -08:00
Dan Gohman 19af9c3943 Update to actions/cache@v3. 2022-11-15 14:17:13 -08:00
Dan Gohman 962ec8ab9a Change the procfs code to be tolerate of files being owned by root:root. (#444)
When a process is marked as non-dumpable, Linux changes the permissions
of the files under /proc/<pid> as owned by root:root. Relax the procfs
code, including removing use of `O_NOATIME`, so that it works on files
owned by `root:root`.

Fixes #441.
2022-11-15 10:32:38 -08:00
niluxv 701cd6392c Fix compilation on macos without std (#442) 2022-11-14 06:28:37 -08:00
Dan Gohman b116f6d749 Temporarily disable the async-std, tokio, mio, and socket2 impls. (#443)
Temporarily disable io-lifetimes impls for third-party crates which don't
yet have have trait impls for the I/O safety traits.
2022-11-14 06:27:26 -08:00