about summary refs log tree commit diff
path: root/src/liblibc/lib.rs
AgeCommit message (Collapse)AuthorLines
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
2014-05-07std: Add close_{read,write}() methods to I/OAlex Crichton-1/+5
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-04Implement fallbacks for functions unavailable in older versions of WindowsAlan Williams-11/+4
2014-04-29rustc: Add search paths to dylib load pathsAlex Crichton-1/+1
When a syntax extension is loaded by the compiler, the dylib that is opened may have other dylibs that it depends on. The dynamic linker must be able to find these libraries on the system or else the library will fail to load. Currently, unix gets by with the use of rpaths. This relies on the dylib not moving around too drastically relative to its dependencies. For windows, however, this is no rpath available, and in theory unix should work without rpaths as well. This modifies the compiler to add all -L search directories to the dynamic linker's set of load paths. This is currently managed through environment variables for each platform. Closes #13848
2014-04-24std: Add timeouts to unix connect/acceptAlex Crichton-1/+1
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-19std: Add an experimental connect_timeout functionAlex Crichton-5/+10
This adds a `TcpStream::connect_timeout` function in order to assist opening connections with a timeout (cc #13523). There isn't really much design space for this specific operation (unlike timing out normal blocking reads/writes), so I am fairly confident that this is the correct interface for this function. The function is marked #[experimental] because it takes a u64 timeout argument, and the u64 type is likely to change in the future.
2014-04-16This is a Windows specific fix in libc. According to MSDN, the GUIDiancormac84-2/+2
structure's Data2 and Data3 members expect WORD types instead of DWORD. I discovered this discrepancy while experimenting with some bindings to Microsoft's OLE2 api. The discrepancy was corrupting the contents of the string returned by UuidToString after I used known GUIDs to test the accuracy of the function binding. I didn't add test cases because it would mean adding a dependency to my rather incomplete binding library. However, the fix produces expected string values when tested.
2014-04-16auto merge of #13454 : brson/rust/noglobs, r=alexcrichtonbors-61/+147
Them removes all the glob reexports from liblibc. I did it by removing them all, and then adding back per-platform explicit reexports until everything built again. I realize this isn't the best strategy for determining an API, but this is the lowest-impact change that solves the problem, plus I'm dissatisfied with the design of this library for other reasons and think it needs to be reconsidered from top to bottom (later). Progress on #11870.
2014-04-15Remove usage of private enum variantsAlex Crichton-2/+2
This replaces all uses of private enum variants with a struct that has one private field pointing at a private enum. RFC: 0006-remove-priv
2014-04-15libc: Deglob reexports. #11870Brian Anderson-61/+147
2014-04-10rustc: Don't succeed on shadowed nonexistent importAlex Crichton-1/+1
Previously resolve was checking the "import resolution" for whether an import had succeeded or not, but this was the same structure filled in by a previous import if a name is shadowed. Instead, this alters resolve to consult the local resolve state (as opposed to the shared one) to test whether an import succeeded or not. Closes #13404
2014-04-08Register new snapshotsAlex Crichton-8/+1
2014-04-05rustc: Pass --enable-long-section-names to gccAlex Crichton-0/+7
This was quite a curious bug on windows, and the details can be found in the comment I added to src/librustc/back/link.rs
2014-04-04Fix fallout from std::libc separationCorey Richardson-45/+29
2014-04-04Change how the readdir/opendir hack worksCorey Richardson-10/+6
2014-04-04Remove libc from stdCorey Richardson-0/+4323
These wrappers are bound to a specific libc, and they don't need to be part of libstd.