Commit graph

10404 commits

Author SHA1 Message Date
Jorge Aparicio
ba07a1b58d std: make compilation of libpanic_unwind optional via a Cargo feature
with this feature disabled, you can (Cargo) compile std with
"panic=abort"

rustbuild will build std with this feature enabled, to maintain the
status quo

fixes #37252
2016-11-23 21:49:54 -05:00
Theodore DeRego
5c1c48532f Separated fuchsia-specific process stuff into 'process_fuchsia.rs' and refactored out some now-duplicated code into a 'process_common.rs' 2016-11-23 13:58:13 -08:00
Jeremy Soller
6733074c84 Allow setting nonblock on sockets 2016-11-23 14:22:39 -07:00
Guillaume Gomez
559141c827 Add missing examples to SocketAddrV6 2016-11-23 17:14:41 +01:00
Jeremy Soller
4a0bc71bb7 Add File set_permissions 2016-11-23 08:24:49 -07:00
Jeremy Soller
b3c91dfb6a Merge branch 'master' into redox 2016-11-23 08:21:15 -07:00
Guillaume Gomez
a5049f7bba Add ::1 example in IPv6 to IPv4 conversion 2016-11-23 12:24:04 +01:00
Guillaume Gomez
cfc7fce2f0 Rollup merge of #37925 - jtdowney:env-args-doc-links, r=steveklabnik
Add some internal docs links for Args/ArgsOs

In many places the docs link to other sections and I noticed it was lacking here. Not sure if there is a standard for if inter-linking is appropriate.
2016-11-23 12:18:10 +01:00
Guillaume Gomez
881115c896 Rollup merge of #37913 - GuillaumeGomez:socket-v4, r=frewsxcv
Add missing examples for SocketAddrV4

r? @steveklabnik

cc @frewsxcv
2016-11-23 12:18:10 +01:00
Theodore DeRego
ae09957040 Whoops :| s/update/unwrap/ 2016-11-22 16:18:02 -08:00
Theodore DeRego
fae86b92de Cleaned up and appeased the linter 2016-11-22 16:08:48 -08:00
Theodore DeRego
5c23f2e3c8 Fuchsia support for std::process via liblaunchpad. 2016-11-22 12:12:46 -08:00
Steven Allen
1aaca5f290 Add a method for setting permissions directly on an open file.
On unix like systems, the underlying file corresponding to any given path may
change at any time. This function makes it possible to set the permissions of
the a file corresponding to a `File` object even if its path changes.
2016-11-22 08:42:28 -08:00
Guillaume Gomez
1a91fc62d3 Add missing examples for Ipv6Addr 2016-11-22 16:49:01 +01:00
John Downey
9170ddf1e4 Add some internal docs links for Args/ArgsOs 2016-11-21 16:12:14 -06:00
bors
7b3eeea22c Auto merge of #37677 - jsen-:master, r=alexcrichton
libstd: support creation of anonymous pipe on WinXP/2K3

`PIPE_REJECT_REMOTE_CLIENTS` flag is not supported on Windows < VISTA, and every invocation of `anon_pipe` including attempts to pipe `std::process::Child`'s stdio fails.
This PR should work around this issue by performing a runtime check of windows version and conditionally omitting this flag on "XP and friends".

Getting the version should be probably moved out of the function `anon_pipe` itself (the OS version does not often change during runtime :) ), but:
 - I didn't find any precedent for this and assuming there's not much overhead (I hope windows does not perform any heuristics to find out it's own version, just fills couple of fields in the struct).
 - the code path is not especially performance sensitive anyway.
2016-11-21 14:37:24 -06:00
Guillaume Gomez
ff433da526 Add missing examples for SocketAddrV4 2016-11-21 14:07:58 +01:00
jsen-
fc5a361c84 support creation of anonymous pipe on WinXP/2K3 2016-11-20 22:13:01 +01:00
Guillaume Gomez
5ca9fa438b Rollup merge of #37880 - GuillaumeGomez:socket-4-doc, r=frewsxcv
Add missing examples in SocketAddr

r? @frewsxcv
2016-11-20 15:00:05 +01:00
Jeremy Soller
ae2029fc62 Merge branch 'master' into redox 2016-11-19 20:31:42 -07:00
bors
7c535c6ec6 Auto merge of #37833 - sfackler:process-abort, r=alexcrichton
Add std::process::abort

This calls libc abort on Unix and fastfail on Windows, first running
cleanups to do things like flush stdout buffers. This matches with libc
abort's behavior, which flushes open files.

r? @alexcrichton
2016-11-19 20:01:52 -06:00
Guillaume Gomez
bf78ef3851 Add missing examples in SocketAddr 2016-11-19 22:22:05 +01:00
Steven Fackler
fc0140d271 Add std::process::abort
This calls libc abort on Unix and fastfail on Windows.
2016-11-17 16:20:08 -08:00
Jeremy Soller
2556400a5d Replace setuid, setgid with setreuid, setregid 2016-11-17 14:15:58 -07:00
Jeremy Soller
f01add1a3b Add signal support, better exec error handling 2016-11-17 10:22:07 -07:00
Guillaume Gomez
976bfc0322 Add examples for Ipv4Addr 2016-11-16 21:13:44 +01:00
Guillaume Gomez
27acb5ca11 Add missing urls and improve internal doc representation 2016-11-16 19:56:01 +01:00
Jeremy Soller
267bc54fbd Use chmod instead of fcntl to change file perms 2016-11-15 17:07:55 -07:00
Jeremy Soller
2e5c821619 Add set_perm 2016-11-15 16:12:30 -07:00
Jeremy Soller
73f24d47de Simple implementation of read2 2016-11-14 20:56:06 -07:00
Jeremy Soller
de68aced95 Add current_exe support 2016-11-14 19:08:48 -07:00
Jeremy Soller
18bf0540bf Fix redox prefix handling 2016-11-14 15:02:18 -07:00
Corey Farwell
af1aa1bccf Update top-level path doc examples to show results. 2016-11-14 15:54:40 -05:00
Jeremy Soller
a0b5dfef2a Add fcntl 2016-11-14 12:15:11 -07:00
Corey Farwell
f53d062d42 Minor rewriting of std::path::Path::push doc example. 2016-11-13 12:58:55 -05:00
Eduard-Mihai Burtescu
75f2c21124 Rollup merge of #37699 - alexcrichton:default-for-duration, r=brson
std: Derive `Default` for `Duration`.

Discussed in #37546 the libs team reached the conclusion that a default zero
duration seems like a reasonable implementation of the `Default` trait.

Closes #37546
2016-11-12 10:38:43 +02:00
Eduard-Mihai Burtescu
8886eccdf7 Rollup merge of #37696 - arthurprs:patch-1, r=alexcrichton
Remove one bounds check from BufReader

Very minor thing. Otherwise the optimizer can't be sure that pos <= cap. Added a paranoid debug_assert to ensure correctness instead.

CC #37573
2016-11-12 10:38:42 +02:00
Eduard-Mihai Burtescu
29195e26d2 Rollup merge of #37527 - Mark-Simulacrum:mpsc-recvtimeouterror-error-impl, r=alexcrichton
Add Error implementation for std::sync::mpsc::RecvTimeoutError.

Fixes https://github.com/rust-lang/rust/issues/37525.
2016-11-12 10:38:37 +02:00
Jeremy Soller
0bb9a95907 Merge branch 'master' into redox 2016-11-10 20:37:34 -07:00
Jeremy Soller
25e1a4a008 Use target_os = redox for cfg 2016-11-10 20:13:14 -07:00
Jeremy Soller
79a8c272fb Fix readdir 2016-11-10 19:58:19 -07:00
Jeremy Soller
a90850995f Fixes for stdio and processes on Redox 2016-11-10 19:33:59 -07:00
Alex Crichton
30502b8205 std: Derive Default for Duration.
Discussed in #37546 the libs team reached the conclusion that a default zero
duration seems like a reasonable implementation of the `Default` trait.

Closes #37546
2016-11-10 16:21:51 -08:00
Arthur Silva
dcd80b80ae Remove one bounds check from BufReader
Otherwise the optimizer can't be sure that pos <= cap. Added a paranoid debug_assert to ensure correctness instead.
2016-11-10 22:26:50 +01:00
Jeremy Soller
ced32a08f3 Fix exec 2016-11-09 20:52:30 -07:00
Tshepang Lekhonkhobe
a9349d723d doc: fix typos 2016-11-10 05:23:41 +02:00
Eduard-Mihai Burtescu
aad4f29f7b Rollup merge of #37622 - ollie27:cstring, r=alexcrichton
Slightly optimise CString

Avoid a reallocation in CString::from and CStr::to_owned.
2016-11-09 20:51:18 +02:00
Eduard-Mihai Burtescu
d712882228 Rollup merge of #37432 - achanda:send_to, r=alexcrichton
Clarify that send_to might panic in certain cases

Closes #34202

r? @alexcrichton
2016-11-09 20:51:16 +02:00
Abhishek Chanda
50bfc23816 Clarify that send_to might return an error in certain cases
Closes #34202
2016-11-09 09:03:33 +00:00
Steve Klabnik
e6b6586667 Rollup merge of #37588 - GuillaumeGomez:missing_io_urls, r=frewsxcv
Add missing urls on io structs

r? @steveklabnik
2016-11-08 16:20:57 -05:00