about summary refs log tree commit diff
path: root/src/libstd/sys/windows/os.rs
AgeCommit message (Collapse)AuthorLines
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-2/+2
2019-02-28libstd => 2018Taiki Endo-16/+16
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12Bump to 1.33.0Alex Crichton-1/+1
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-2/+2
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
2017-10-06Add current_pid functionThayne McCombs-0/+4
Fixes #44971
2017-05-11Add testJethro Beekman-0/+14
2017-05-03Windows io::Error: also format NTSTATUS error codesJethro Beekman-3/+21
2016-10-02Move platform-specific arg handling to sys::argsBrian Anderson-56/+0
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-1/+0
2016-07-26DoubleEndedIterator for ArgsSebastian Thiel-10/+17
The number of arguments given to a process is always known, which makes implementing DoubleEndedIterator possible. That way, the Iterator::rev() method becomes usable, among others. Signed-off-by: Sebastian Thiel <byronimo@gmail.com> Tidy for DoubleEndedIterator I chose to not create a new feature for it, even though technically, this makes me lie about the original availability of the implementation. Verify with @alexchrichton Setup feature flag for new std::env::Args iterators Add test for Args reverse iterator It's somewhat depending on the input of the test program, but made in such a way that should be somewhat flexible to changes to the way it is called. Deduplicate windows ArgsOS code for DEI DEI = DoubleEndedIterator Move env::args().rev() test to run-pass It must be controlling it's arguments for full isolation. Remove superfluous feature name Assert all arguments returned by env::args().rev() Let's be very sure it works as we expect, why take chances. Fix rval of os_string_from_ptr A trait cannot be returned, but only the corresponding object. Deref pointers to actually operate on the argument Put unsafe to correct location
2016-03-22try! -> ?Jorge Aparicio-4/+4
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-02-11Fix usage of GetUserProfileDirectoryW in env::home_dirPeter Atashian-2/+2
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-2/+2
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-21Auto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichtonbors-4/+6
On Windows: Previously these paths were silently truncated at these NUL characters, now they fail with `ErrorKind::InvalidInput`.
2015-11-21Also check for NULs in environment variablesTobias Bucher-4/+6
This check is necessary, because the underlying API only reads strings until the first NUL.
2015-11-19Re-unignore environment test on MinGWTobias Bucher-1/+1
2015-11-19Ignore malformed environment variables on Windows tooTobias Bucher-15/+24
Leading equals symbols are treated as part of the variable name, if there is no other equality symbol or none at all, the environment string is ignored.
2015-11-09std: Migrate to the new libcAlex Crichton-54/+31
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-10-26std: Slightly more robust env var handlingAlex Crichton-24/+24
As discovered in #29298, `env::set_var("", "")` will panic, but it turns out that it *also* deadlocks on Unix systems. This happens because if a panic happens while holding the environment lock, we then go try to read RUST_BACKTRACE, grabbing the environment lock, causing a deadlock. Specifically, the changes made here are: * The environment lock is pushed into `std::sys` instead of `std::env`. This also only puts it in the Unix implementation, not Windows where the functions are already threadsafe. * The `std::sys` implementation now returns `io::Result` so panics are explicitly at the `std::env` level. The panic messages have also been improved in these situations.
2015-08-25Auto merge of #27995 - nagisa:windows-error-message, r=alexcrichtonbors-3/+2
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx: > If the function succeeds, the return value is the number of TCHARs stored in the output buffer, > excluding the terminating null character. _**Completely untested**_… since I have no Windows machine or anything of a sort to test this on. r? @aturon
2015-08-25Do not recalculate string length in error_stringSimonas Kazlauskas-3/+2
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx: > If the function succeeds, the return value is the number of TCHARs stored in the output buffer, > excluding the terminating null character.
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-9/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-07Trim trailing newline from FormatMessageWdiaphore-3/+7
2015-06-11Changed patch wordingJoshua Landau-3/+5
2015-06-11Comment for #26196.Joshua Landau-0/+3
Fixes #26196. Alternatively we could explicitly check and complain (eg. panic), but I don't see the value-add.
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-1/+1
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14std: Remove old_io/old_path/rand modulesAlex Crichton-27/+5
This commit entirely removes the old I/O, path, and rand modules. All functionality has been deprecated and unstable for quite some time now!
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-1/+1
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-1/+1
2015-03-31rollup merge of #23907: alexcrichton/impl-exitAlex Crichton-0/+4
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011 Closes #23914
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-6/+7
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-6/+7
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31std: Add a process::exit functionAlex Crichton-0/+4
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011
2015-03-26std: Stabilize parts of std::os::platform::ioAlex Crichton-2/+2
This commit stabilizes the platform-specific `io` modules, specifically around the traits having to do with the raw representation of each object on each platform. Specifically, the following material was stabilized: * `AsRaw{Fd,Socket,Handle}` * `RawFd` (renamed from `Fd`) * `RawHandle` (renamed from `Handle`) * `RawSocket` (renamed from `Socket`) * `AsRaw{Fd,Socket,Handle}` implementations * `std::os::{unix, windows}::io` The following material was added as `#[unstable]`: * `FromRaw{Fd,Socket,Handle}` * Implementations for various primitives There are a number of future improvements that are possible to make to this module, but this should cover a good bit of functionality desired from these modules for now. Some specific future additions may include: * `IntoRawXXX` traits to consume the raw representation and cancel the auto-destructor. * `Fd`, `Socket`, and `Handle` abstractions that behave like Rust objects and have nice methods for various syscalls. At this time though, these are considered backwards-compatible extensions and will not be stabilized at this time. This commit is a breaking change due to the addition of `Raw` in from of the type aliases in each of the platform-specific modules. [breaking-change]
2015-03-25Bug fixesNick Cameron-1/+1
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-4/+1
2015-03-15std: Stabilize portions of `std::os::$platform`Alex Crichton-1/+2
This commit starts to organize the `std::os::$platform` modules and in the process stabilizes some of the functionality contained within. The organization of these modules will reflect the organization of the standard library itself with extension traits for primitives in the same corresponding module. The OS-specific modules will grow more functionality over time including concrete types that are not extending functionality of other structures, and these will either go into the closest module in `std::os::$platform` or they will grow a new module in the hierarchy. The following items are now stable: * `os::{unix, windows}` * `unix::ffi` * `unix::ffi::OsStrExt` * `unix::ffi::OsStrExt::{from_bytes, as_bytes, to_cstring}` * `unix::ffi::OsString` * `unix::ffi::OsStringExt::{from_vec, into_vec}` * `unix::process` * `unix::process::CommandExt` * `unix::process::CommandExt::{uid, gid}` * `unix::process::ExitStatusExt` * `unix::process::ExitStatusExt::signal` * `unix::prelude` * `windows::ffi` * `windows::ffi::OsStringExt` * `windows::ffi::OsStringExt::from_wide` * `windows::ffi::OsStrExt` * `windows::ffi::OsStrExt::encode_wide` * `windows::prelude` The following items remain unstable: * `unix::io` * `unix::io::{Fd, AsRawFd}` * `unix::fs::{PermissionsExt, OpenOptionsExt}` * `windows::io` * `windows::io::{Handle, AsRawHandle}` * `windows::io::{Socket, AsRawSocket}` * `windows::fs` * `windows::fs::OpenOptionsExt` Due to the reorgnization of the platform extension modules, this commit is a breaking change. Most imports can be fixed by adding the relevant libstd module in the `use` path (such as `ffi` or `fs`). [breaking-change]
2015-03-13Fallout of std::old_io deprecationAlex Crichton-3/+5
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-2/+2
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-02-24std: Move std::env to the new I/O APIsAlex Crichton-17/+19
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-5/+5
2015-02-17fix windowsManish Goregaokar-2/+2
2015-02-16Implement ExactSizeIterator for Args and ArgsOsSimonas Kazlauskas-0/+4
Fixes #22343
2015-02-10Auto merge of #21936 - alexcrichton:fsv2, r=aturonbors-1/+1
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-09std: Add a new `fs` moduleAlex Crichton-1/+1
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-05Replace usage of slice::from_raw_buf with slice::from_raw_partsMikhail Zabaluev-2/+2
New functions, slice::from_raw_parts and slice::from_raw_parts_mut, are added to implement the lifetime convention as agreed in RFC PR #556. The functions slice::from_raw_buf and slice::from_raw_mut_buf are left deprecated for the time being.