about summary refs log tree commit diff
path: root/src/liblibc
AgeCommit message (Collapse)AuthorLines
2014-09-04auto merge of #16982 : jbcrail/rust/comment-and-string-corrections, ↵bors-1/+1
r=alexcrichton I corrected spelling and capitalization errors in comments and strings.
2014-09-03Fix spelling errors and capitalization.Joseph Crail-1/+1
2014-09-03Fix some non-FFI-safe types in externsKeegan McAllister-1/+1
2014-09-02Fix MIPS targetJyun-Yan You-0/+6
Add missing liblibc constants
2014-09-01auto merge of #16844 : mrmonday/rust/liblibc-custom-socket, r=alexcrichtonbors-7/+152
These are the additions to liblibc required for raw/custom socket support. I've broken this into a separate pull request due to the upcoming I/O overhaul (was originally part of pull #15741). cc @alexcrichton.
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-2/+2
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-29Modifications to liblibc for raw/custom socket support.Robert Clipsham-7/+152
2014-08-23auto merge of #16693 : vadimcn/rust/rename--win32, r=pcwaltonbors-10/+3
2014-08-23Complete renaming of win32 to windowsVadim Chugunov-10/+3
2014-08-23Fix intptr_t on win64Vadim Chugunov-0/+8
2014-08-20liblibc: don't use int/uint for intptr_t/uintptr_tCorey Richardson-18/+19
int/uint aren't considered FFI safe, replace them with the actual type they represent (i64/u64 or i32/u32). This is a breaking change, but at most a cast to `uint` or `int` needs to be added. [breaking-change]
2014-08-20Add #[repr(C)] to all the things!Corey Richardson-2/+102
2014-08-20librustc: handle repr on structs, require it for ffi, unify with packedCorey Richardson-0/+1
As of RFC 18, struct layout is undefined. Opting into a C-compatible struct layout is now down with #[repr(C)]. For consistency, specifying a packed layout is now also down with #[repr(packed)]. Both can be specified. To fix errors caused by this, just add #[repr(C)] to the structs, and change #[packed] to #[repr(packed)] Closes #14309 [breaking-change]
2014-08-19Rename Nullable::Some to Nullable::NotNullSiegeLord-1/+1
2014-08-18snapshots: Register new snapshots.Patrick Walton-34/+0
2014-08-17librustc: Allow trait bounds on structures and enumerations, and checkPatrick Walton-0/+34
them during kind checking. This implements RFC #11. Closes #15759.
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-3/+3
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-12Replace #[cfg(target_os = "win32")] with #[cfg(target_os = "windows")]Vadim Chugunov-7/+14
2014-08-07windows: Fix INVALID_HANDLE_VALUEPeter Atashian-4/+3
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-07windows: Fix several tests on 64-bit.Peter Atashian-12/+9
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-5/+221
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-13auto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmrbors-57/+61
* Don't warn about `#[crate_name]` if `--crate-name` is specified * Don't warn about non camel case identifiers on `#[repr(C)]` structs * Switch `mode` to `mode_t` in libc.
2014-07-11libc: Switch open to use a mode_t on unixAlex Crichton-57/+61
While I'm at it, export O_SYNC with the other flags that are exported. Closes #15582
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-1/+3
2014-07-02Merge remote-tracking branch 'origin/master' into 0.11.0-releaseAlex Crichton-195/+222
Conflicts: src/libstd/lib.rs
2014-06-28Rename all raw pointers as necessaryAlex Crichton-195/+222
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-1/+5
2014-06-24auto merge of #14963 : w3ln4/rust/master, r=alexcrichtonbors-0/+8
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+8
2014-06-18fix signatures of mmap-related functions from libcDaniel Micay-10/+10
2014-06-16fix typo in the libc crateDaniel Micay-2/+2
2014-06-16std: Improve pipe() functionalityAlex Crichton-2/+2
* os::pipe() now returns IoResult<os::Pipe> * os::pipe() is now unsafe because it does not arrange for deallocation of file descriptors * os::Pipe fields are renamed from input to reader and out to write. * PipeStream::pair() has been added. This is a safe method to get a pair of pipes. * Dealing with pipes in native process bindings have been improved to be more robust in the face of failure and intermittent errors. This converts a few fail!() situations to Err situations. Closes #9458 cc #13538 Closes #14724 [breaking-change]
2014-06-12Basic iOS supportValerii Hiora-0/+13
2014-06-10Fix more misspelled comments and strings.Joseph Crail-2/+2
2014-06-06libs: Fix miscellaneous fallout of librustrtAlex Crichton-1/+6
2014-06-04libc: only provide an rlib.Huon Wilson-1/+3
There's absolutely no reason for `libc` to be offered as a dynamic library.
2014-05-30windows: Allow snake_case errors for now.Kevin Butler-1/+2
2014-05-28auto merge of #14477 : alexcrichton/rust/issue-14456, r=brsonbors-2/+7
When spawning a process, stdio file descriptors can be configured to be ignored, which basically means that they'll be closed. Currently this is done by literally closing the file descriptors in the child, but this can have adverse side effects if the child process then opens a new file descriptor, assigning it to a stdio number. To work around the problems of the child, this commit alters the process spawning code to map stdio fds to /dev/null on unix (and a similar equivalent on windows) when they are specified as being ignored. This should allow spawned programs to have more expected behavior when opening new files. Closes #14456
2014-05-27native: Ignore stdio fds with /dev/nullAlex Crichton-2/+7
When spawning a process, stdio file descriptors can be configured to be ignored, which basically means that they'll be closed. Currently this is done by literally closing the file descriptors in the child, but this can have adverse side effects if the child process then opens a new file descriptor, assigning it to a stdio number. To work around the problems of the child, this commit alters the process spawning code to map stdio fds to /dev/null on unix (and a similar equivalent on windows) when they are specified as being ignored. This should allow spawned programs to have more expected behavior when opening new files. Closes #14456
2014-05-28fix MIPS targetJyun-Yan You-0/+46
2014-05-13io: Implement process wait timeoutsAlex Crichton-17/+1
This implements set_timeout() for std::io::Process which will affect wait() operations on the process. This follows the same pattern as the rest of the timeouts emerging in std::io::net. The implementation was super easy for everything except libnative on unix (backwards from usual!), which required a good bit of signal handling. There's a doc comment explaining the strategy in libnative. Internally, this also required refactoring the "helper thread" implementation used by libnative to allow for an extra helper thread (not just the timer). This is a breaking change in terms of the io::Process API. It is now possible for wait() to fail, and subsequently wait_with_output(). These two functions now return IoResult<T> due to the fact that they can time out. Additionally, the wait_with_output() function has moved from taking `&mut self` to taking `self`. If a timeout occurs while waiting with output, the semantics are undesirable in almost all cases if attempting to re-wait on the process. Equivalent functionality can still be achieved by dealing with the output handles manually. [breaking-change] cc #13523
2014-05-13Use Get/FreeEnvironmentStringsW instead of Get/FreeEnvironmentStringsAPhil Ruffwind-3/+3
Changed libstd to use Get/FreeEnvironmentStringsW instead of Get/FreeEnvironmentStringsA to support Unicode environment variables.
2014-05-13Use CreateProcessW instead of CreateProcessAPhil Ruffwind-5/+6
Changed libnative to use CreateProcessW instead of CreateProcessA. In addition, the lpEnvironment parameter now uses Unicode. Added a helper function os::win32::as_mut_utf16_p, which does basically the same thing as os::win32::as_utf16_p except the pointer is mutable.
2014-05-12auto merge of #13919 : thomaslee/rust/thomaslee_proposed_tcpstream_open, ↵bors-0/+11
r=alexcrichton Been meaning to try my hand at something like this for a while, and noticed something similar mentioned as part of #13537. The suggestion on the original ticket is to use `TcpStream::open(&str)` to pass in a host + port string, but seems a little cleaner to pass in host and port separately -- so a signature like `TcpStream::open(&str, u16)`. Also means we can use std::io::net::addrinfo directly instead of using e.g. liburl to parse the host+port pair from a string. One outstanding issue in this PR that I'm not entirely sure how to address: in open_timeout, the timeout_ms will apply for every A record we find associated with a hostname -- probably not the intended behavior, but I didn't want to waste my time on elaborate alternatives until the general idea was a-OKed. :) Anyway, perhaps there are other reasons for us to prefer the original proposed syntax, but thought I'd get some thoughts on this. Maybe there are some solid reasons to prefer using liburl to do this stuff.
2014-05-12Fix field ordering of addrinfo struct on AndroidTom Lee-0/+11
2014-05-12Add the patch number to version strings. Closes #13289Brian Anderson-1/+1
2014-05-12auto merge of #13932 : MrAlert/rust/win-compat, r=brsonbors-11/+4
This addresses #12842 by offering fallback implementations for functions that aren't available. In this case, as Windows XP simply doesn't support symbolic links at all, the fallbacks simply return an error code indicating that the function hasn't been implemented. This should allow programs written in Rust to run under XP while still offering full support for symbolic links under newer versions of Windows with the same binary, but due to LLVM using stderror_s(), which isn't available in msvcrt.dll in XP, rustc itself will not. The fallback implementation is as follows: Calling the function instead calls to a mutable function pointer. This in and of itself would not constitute a performance hit because DLL calls are implemented in a similar manner (see Import Address Table). The function pointer initially points to a thunk which tries to get the address of the associated function and write it back to the function pointer. If it fails to find the function, it instead writes the address to a fallback. As this operation is idempotent, reading and writing the pointer simply needs to be atomic. Subsequent calls to the function should be as fast as any other DLL call, as the pointer will then point directly to either the correct function or a fallback.
2014-05-10Reexport wchar_t, c_scharManish Goregaokar-2/+2