about summary refs log tree commit diff
path: root/src/libnative/io/pipe_win32.rs
AgeCommit message (Collapse)AuthorLines
2014-08-23Complete renaming of win32 to windowsVadim Chugunov-713/+0
2014-08-07windows: Fix INVALID_HANDLE_VALUEPeter Atashian-5/+5
Made INVALID_HANDLE_VALUE actually a HANDLE. Removed all useless casts during INVALID_HANDLE_VALUE comparisons. Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-04stabilize atomics (now atomic)Aaron Turon-9/+9
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
2014-08-01Fix misspelled comments.Joseph Crail-1/+1
2014-07-24libsyntax: Remove `~self` and `mut ~self` from the language.Patrick Walton-1/+2
This eliminates the last vestige of the `~` syntax. Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut ~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with the self-type parameter as specified in the implementation. Closes #13885. [breaking-change]
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-07-03Fix spelling errors.Joseph Crail-1/+1
2014-06-28Rename all raw pointers as necessaryAlex Crichton-2/+2
2014-06-15Register new snapshotsAlex Crichton-6/+6
2014-06-10Fix more misspelled comments and strings.Joseph Crail-1/+1
2014-06-09std: Remove the as_utf16_p functionsAlex Crichton-64/+62
These functions are all much better expressed via RAII using the to_utf16() method on strings. This refactoring also takes this opportunity to properly handle when filenames aren't valid unicode when passed through to the windows I/O layer by properly returning I/O errors. All previous users of the `as_utf16_p` or `as_utf16_mut_p` functions will need to convert their code to using `foo.to_utf16().append_one(0)` to get a null-terminated utf16 string. [breaking-change]
2014-06-06libs: Fix miscellaneous fallout of librustrtAlex Crichton-13/+24
2014-05-21auto merge of #14301 : alexcrichton/rust/remove-unsafe-arc, r=brsonbors-13/+13
This type can be built with `Arc<Unsafe<T>>` now that liballoc exists.
2014-05-21std,green: Mark some queue types as NoShareAlex Crichton-8/+8
2014-05-20core: Stabilize the mem moduleAlex Crichton-4/+4
Excluding the functions inherited from the cast module last week (with marked stability levels), these functions received the following treatment. * size_of - this method has become #[stable] * nonzero_size_of/nonzero_size_of_val - these methods have been removed * min_align_of - this method is now #[stable] * pref_align_of - this method has been renamed without the `pref_` prefix, and it is the "default alignment" now. This decision is in line with what clang does (see url linked in comment on function). This function is now #[stable]. * init - renamed to zeroed and marked #[stable] * uninit - marked #[stable] * move_val_init - renamed to overwrite and marked #[stable] * {from,to}_{be,le}{16,32,64} - all functions marked #[stable] * swap/replace/drop - marked #[stable] * size_of_val/min_align_of_val/align_of_val - these functions are marked #[unstable], but will continue to exist in some form. Concerns have been raised about their `_val` prefix. [breaking-change]
2014-05-19native: Remove UnsafeArc in favor of just ArcAlex Crichton-5/+5
2014-05-07native: Implement timeouts for windows pipesAlex Crichton-19/+69
This is the last remaining networkig object to implement timeouts for. This takes advantage of the CancelIo function and the already existing asynchronous I/O functionality of pipes.
2014-05-07std: Add close_{read,write}() methods to I/OAlex Crichton-30/+145
Two new methods were added to TcpStream and UnixStream: fn close_read(&mut self) -> IoResult<()>; fn close_write(&mut self) -> IoResult<()>; These two methods map to shutdown()'s behavior (the system call on unix), closing the reading or writing half of a duplex stream. These methods are primarily added to allow waking up a pending read in another task. By closing the reading half of a connection, all pending readers will be woken up and will return with EndOfFile. The close_write() method was added for symmetry with close_read(), and I imagine that it will be quite useful at some point. Implementation-wise, librustuv got the short end of the stick this time. The native versions just delegate to the shutdown() syscall (easy). The uv versions can leverage uv_shutdown() for tcp/unix streams, but only for closing the writing half. Closing the reading half is done through some careful dancing to wake up a pending reader. As usual, windows likes to be different from unix. The windows implementation uses shutdown() for sockets, but shutdown() is not available for named pipes. Instead, CancelIoEx was used with same fancy synchronization to make sure everyone knows what's up. cc #11165
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-6/+8
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-3/+3
2014-04-24std: Add timeouts to unix connect/acceptAlex Crichton-6/+50
This adds support for connecting to a unix socket with a timeout (a named pipe on windows), and accepting a connection with a timeout. The goal is to bring unix pipes/named sockets back in line with TCP support for timeouts. Similarly to the TCP sockets, all methods are marked #[experimental] due to uncertainty about the type of the timeout argument. This internally involved a good bit of refactoring to share as much code as possible between TCP servers and pipe servers, but the core implementation did not change drastically as part of this commit. cc #13523
2014-04-04Fix fallout from std::libc separationCorey Richardson-1/+1
2014-03-31native: Switch field privacy as necessaryAlex Crichton-7/+7
2014-03-27doc: Update the tutorial about bounds for traitsAlex Crichton-6/+6
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-1/+1
Issue #1457
2014-02-20Mass rename if_ok! to try!Alex Crichton-3/+3
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-16Implement named pipes for windows, touch up unixAlex Crichton-0/+492
* Implementation of pipe_win32 filled out for libnative * Reorganize pipes to be clone-able * Fix a few file descriptor leaks on error * Factor out some common code into shared functions * Make use of the if_ok!() macro for less indentation Closes #11201