about summary refs log tree commit diff
path: root/src/libstd/os
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-4612/+0
2020-07-09libstd/libcore: fix various typosAndy Russell-2/+2
2020-06-23Remove unused crate imports in 2018 edition cratesyuqio-2/+0
2020-06-03Hexagon libstd: fix typo for c_ulonglongBrian Cain-1/+1
2020-04-14Add illumos triplePatrick Mooney-0/+200
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-03-19add basic support of OsStrExt for HermitCoreStefan Lankes-1/+1
this patch increases the compatibility to other operating systems
2020-03-06fix various typosMatthias Krüger-1/+1
2020-01-01Add support for RISC-V 64-bit GNU/Linuxmsizanoen1-3/+10
2019-11-29Format libstd/os with rustfmtDavid Tolnay-433/+657
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/os *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/os -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/os outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-06rename cfg(rustdoc) into cfg(doc)Guillaume Gomez-1/+1
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-401/+0
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-32/+16
2019-08-08Rollup merge of #63327 - lzutao:fix-as_raw_stat-dep-msg, r=Mark-SimulacrumMazdak Farrokhzad-3/+4
doc: Reword deprecation message of MetadataExt::as_raw_stat Closes #62711 r? @Mark-Simulacrum
2019-08-06redox: convert to target_family unixJeremy Soller-0/+457
2019-08-06doc: Reword deprecation message of MetadataExt::as_raw_statLzu Tao-3/+4
2019-07-25Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petrochenkovMazdak Farrokhzad-16/+32
rustdoc: make #[doc(include)] relative to the containing file This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros. Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380 Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239 cc #44732 This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
2019-07-23stage0 -> bootstrapJonas Schievink-32/+32
2019-07-23Make #[doc(include)] paths behave like other pathsJonas Schievink-16/+32
This makes them relative to the containing file instead of the crate root
2019-07-22add support for hexagon-unknown-linux-muslBrian Cain-0/+58
2019-07-16Add supporting for vxWorksBaoshan Pang-1/+107
r? @alexcrichton
2019-06-10std: Remove internal definitions of `cfg_if!` macroAlex Crichton-1/+1
This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
2019-05-13Remove bitrig support from rustMarcel Hellwig-216/+0
2019-05-03Categorize WASI as an "OS" rather than as an "environment".Dan Gohman-1/+1
This distinction is fairly abstract, but in practice, the main advantage here is that LLVM's triple code considers WASI to be an OS, so this makes rustc agree with that.
2019-04-22Remove double trailing newlinesvarkor-9/+0
2019-03-29Add a new wasm32-unknown-wasi targetAlex Crichton-0/+7
This commit adds a new wasm32-based target distributed through rustup, supported in the standard library, and implemented in the compiler. The `wasm32-unknown-wasi` target is intended to be a WebAssembly target which matches the [WASI proposal recently announced.][LINK]. In summary the WASI target is an effort to define a standard set of syscalls for WebAssembly modules, allowing WebAssembly modules to not only be portable across architectures but also be portable across environments implementing this standard set of system calls. The wasi target in libstd is still somewhat bare bones. This PR does not fill out the filesystem, networking, threads, etc. Instead it only provides the most basic of integration with the wasi syscalls, enabling features like: * `Instant::now` and `SystemTime::now` work * `env::args` is hooked up * `env::vars` will look up environment variables * `println!` will print to standard out * `process::{exit, abort}` should be hooked up appropriately None of these APIs can work natively on the `wasm32-unknown-unknown` target, but with the assumption of the WASI set of syscalls we're able to provide implementations of these syscalls that engines can implement. Currently the primary engine implementing wasi is [wasmtime], but more will surely emerge! In terms of future development of libstd, I think this is something we'll probably want to discuss. The purpose of the WASI target is to provide a standardized set of syscalls, but it's *also* to provide a standard C sysroot for compiling C/C++ programs. This means it's intended that functions like `read` and `write` are implemented for this target with a relatively standard definition and implementation. It's unclear, therefore, how we want to expose file descriptors and how we'll want to implement system primitives. For example should `std::fs::File` have a libc-based file descriptor underneath it? The raw wasi file descriptor? We'll see! Currently these details are all intentionally hidden and things we can change over time. A `WasiFd` sample struct was added to the standard library as part of this commit, but it's not currently used. It shows how all the wasi syscalls could be ergonomically bound in Rust, and they offer a possible implementation of primitives like `std::fs::File` if we bind wasi file descriptors exactly. Apart from the standard library, there's also the matter of how this target is integrated with respect to its C standard library. The reference sysroot, for example, provides managment of standard unix file descriptors and also standard APIs like `open` (as opposed to the relative `openat` inspiration for the wasi ssycalls). Currently the standard library relies on the C sysroot symbols for operations such as environment management, process exit, and `read`/`write` of stdio fds. We want these operations in Rust to be interoperable with C if they're used in the same process. Put another way, if Rust and C are linked into the same WebAssembly binary they should work together, but that requires that the same C standard library is used. We also, however, want the `wasm32-unknown-wasi` target to be usable-by-default with the Rust compiler without requiring a separate toolchain to get downloaded and configured. With that in mind, there's two modes of operation for the `wasm32-unknown-wasi` target: 1. By default the C standard library is statically provided inside of `liblibc.rlib` distributed as part of the sysroot. This means that you can `rustc foo.wasm --target wasm32-unknown-unknown` and you're good to go, a fully workable wasi binary pops out. This is incompatible with linking in C code, however, which may be compiled against a different sysroot than the Rust code was previously compiled against. In this mode the default of `rust-lld` is used to link binaries. 2. For linking with C code, the `-C target-feature=-crt-static` flag needs to be passed. This takes inspiration from the musl target for this flag, but the idea is that you're no longer using the provided static C runtime, but rather one will be provided externally. This flag is intended to also get coupled with an external `clang` compiler configured with its own sysroot. Therefore you'll typically use this flag with `-C linker=/path/to/clang-script-wrapper`. Using this mode the Rust code will continue to reference standard C symbols, but the definition will be pulled in by the linker configured. Alright so that's all the current state of this PR. I suspect we'll definitely want to discuss this before landing of course! This PR is coupled with libc changes as well which I'll be posting shortly. [LINK]: [wasmtime]:
2019-03-05SGX target: Expose thread id function in os moduleJethro Beekman-0/+5
2019-02-28libstd => 2018Taiki Endo-119/+93
2019-02-06Rollup merge of #58182 - jethrogb:jb/sgx-bytebuffer-len-0, r=joshtriplettkennytm-1/+1
SGX target: handle empty user buffers correctly Also, expose correct items in `os::fortanix_sgx::usercalls::alloc` * [read_alloc documentation](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.read_alloc) * [Clarified ByteBuffer documentation](https://github.com/fortanix/rust-sgx/pull/94/files#diff-ca843ad9e25cacd63a80579c0f7efa56) r? @joshtriplett
2019-02-05Expose correct items in `os::fortanix_sgx::usercalls::alloc`Jethro Beekman-1/+1
2019-02-01Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`Jethro Beekman-16/+1
Fixes https://github.com/fortanix/rust-sgx/issues/88
2019-01-23Add os::fortanix_sgx::ffi moduleJethro Beekman-1/+1
2018-12-27Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplettbors-0/+2
Add `io` and `arch` modules to `std::os::fortanix_sgx` This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target. ### io `io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`. ### arch `arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.
2018-12-25Remove licensesMark Rousskov-450/+0
2018-12-25Add `io` and `arch` modules to `std::os::fortanix_sgx`Jethro Beekman-0/+2
2018-12-20Add `std::os::fortanix_sgx` moduleJethro Beekman-0/+68
2018-12-19Show platform-specific modules in `std::os` when building those platformsJethro Beekman-17/+16
2018-12-09Add FreeBSD unsigned char platforms to std::os::rawmyfreeweb-0/+8
Reference: https://www.freebsd.org/cgi/man.cgi?query=arch&apropos=0&sektion=7
2018-11-22Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearerariasuni-6/+12
2018-09-14Move std::os::raw::c_void into libcore and re-export in libstdIsaac Woods-35/+2
2018-09-01Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomezkennytm-1/+1
set cfg(rustdoc) when rustdoc is running on a crate When using `#[doc(cfg)]` to document platform-specific items, it's a little cumbersome to get all the platforms' items to appear all at once. For example, the standard library adds `--cfg dox` to rustdoc's command line whenever it builds docs, and the documentation for `#![feature(doc_cfg)]` suggests using a Cargo feature to approximate the same thing. This is a little awkward, because you always need to remember to set `--features dox` whenever you build documentation. This PR proposes making rustdoc set `#[cfg(rustdoc)]` whenever it runs on a crate, to provide an officially-sanctioned version of this that is set automatically. This way, there's a standardized way to declare that a certain version of an item is specifically when building docs. To try to prevent the spread of this feature from happening too quickly, this PR also restricts the use of this flag to whenever `#![feature(doc_cfg)]` is active. I'm sure there are other uses for this, but right now i'm tying it to this feature. (If it makes more sense to give this its own feature, i can easily do that.)
2018-08-31use cfg(rustdoc) instead of cfg(dox) in std and friendsQuietMisdreavus-1/+1
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-1/+1
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-07Add aarch64-unknown-netbsd targetJonathan A. Kollasch-2/+4
2018-08-06NetBSD: fix signedess of charJonathan A. Kollasch-0/+4
2018-07-30Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and ↵Colin Finck-0/+433
port libstd to it. As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible. It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development). Together with the patches to "liblibc" and "llvm", this enables HermitCore applications to be written in Rust.
2018-04-14Add doc links to `std::os` extension traitsDylan MacKenzie-13/+39
Add documentation links to the original type for various OS-specific extension traits and normalize the language for introducing such traits. Also, remove some outdated comments around the extension trait definitions.
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-119/+119
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-02-06fix docs linkQuietMisdreavus-1/+1
2018-01-29Reworded to avoid fuzziness, mention ! in c_void docs.Clar Charr-13/+23
2018-01-29Revisions suggested in commentsClar Charr-6/+4