summary refs log tree commit diff
path: root/src/libstd/libc.rs
AgeCommit message (Collapse)AuthorLines
2013-12-31auto merge of #11186 : alexcrichton/rust/native-udp, r=brsonbors-1/+90
I personally do not have huge amounts of experience in this area, so there's likely a thing or two wrong around the edges. I tried to just copy what libuv is doing as closely as possible with a few tweaks in a few places, but all of the `std::io::net::udp` tests are now run in both native and green settings so the published functionality is all being tested.
2013-12-31Implement native UDP I/OAlex Crichton-1/+90
2013-12-30Convert some C functions to rust functionsAlex Crichton-8/+102
Right now on linux, an empty executable with LTO still depends on librt becaues of the clock_gettime function in rust_builtin.o, but this commit moves this dependency into a rust function which is subject to elimination via LTO. At the same time, this also drops libstd's dependency on librt on unices that are not OSX because the library is only used by extra::time (and now the dependency is listed in that module instead).
2013-12-27Implement native TCP I/OAlex Crichton-0/+308
2013-11-24std::libc: Simplify win32/win64 type definitionsklutzy-164/+30
2013-11-24std::libc: Remove TCHAR typesklutzy-20/+17
2013-11-19Implement more native file I/OAlex Crichton-7/+188
This implements a fair amount of the unimpl() functionality in io::native relating to filesystem operations. I've also modified all io::fs tests to run in both a native and uv environment (so everything is actually tested). There are a two bits of remaining functionality which I was unable to get working: * change_file_times on windows * lstat on windows I think that change_file_times may just need a better interface, but lstat has a large implementation in libuv which I didn't want to tackle trying to copy.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-6/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-10Register new snapshotsAlex Crichton-110/+1
2013-11-05fix alignment of pthread_attr_tDaniel Micay-8/+8
Closes #10300
2013-11-05Move implementation for threads to RustDirkjan Bussink-7/+56
This binds to the appropriate pthreads_* and Windows specific functions and calls them from Rust. This allows for removal of the C++ support code for threads. Fixes #10162
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-1/+6
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-10-20Fix unicode errors on Windows in path_is_dir, path_exists, getcwd and ↵LEE Wondong-4/+10
rust_localtime. This make these functions use wchar_t version of APIs, instead of char version.
2013-10-14Removing ccdeclSteve Klabnik-25/+25
as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872
2013-10-14Remove unused abi attributes.Steve Klabnik-51/+25
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-10-14std::libc: rustdoc indicates reexports nowScott Lawrence-3/+2
2013-10-08rm useless fast_ffi attributesDaniel Micay-14/+0
this is no longer used by the compiler
2013-09-25errfunc ptr is nullable, so use Option as part of interface to glob (#7752).Felix S. Klock II-1/+2
2013-09-25#7752: use fcnptr for glob errfunc.Felix S. Klock II-2/+1
2013-09-18fix compilation errors of mips targetJyun-Yan You-26/+139
2013-08-26std: Add Win64 supportklutzy-0/+106
Some extern blobs are duplicated without "stdcall" abi, since Win64 does not use any calling convention. (Giving any abi to them causes llvm producing wrong bytecode.)
2013-08-26std: Add Win64 typesklutzy-0/+166
2013-08-21auto merge of #8602 : sanxiyn/rust/sysconf, r=graydonbors-224/+214
Linux and Android share the kernel, but not the C library, so sysconf constants are different. For example, _SC_PAGESIZE is 30 on Linux, but 39 on Android. This patch * splits sysconf constants to sysconf module * merges non-MIPS and MIPS sysconf constants (they are same) * adds Android sysconf constants This patch also lets mmap tests to pass on Android.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+2
2013-08-14Add sysconf names for AndroidSeo Sanghyeon-224/+214
2013-08-04std and rustc: explicitly pass c strings to c functionsErick Tryzelaar-2/+2
When strings lose their trailing null, this pattern will become dangerous: let foo = "bar"; let foo_ptr: *u8 = &foo[0]; Instead we should use c_strs to handle this correctly.
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-452/+371
2013-08-01Add a boatload of Linux x86/x86-64/arm errnosCorey Richardson-0/+107
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-372/+446
Place `pub` or `priv` on individual items instead.
2013-07-10Document std::libc::c_void.Kevin Mehall-0/+7
2013-07-09os: introduce cross-platform MemoryMap bindingsFedor Indutny-4/+5
Basically, one may just do: MemoryMap::new(16, ~[ MapExecutable, MapReadable, MapWritable ]) And executable+readable+writable chunk of at least 16 bytes size will be allocated and freed with the result of `MemoryMap::new`.
2013-07-08libc: add errno valuesFedor Indutny-0/+281
2013-07-08libc: VirtualAlloc and FileMapping bindingsFedor Indutny-4/+132
2013-07-08libc: add _SC_* consts for non-mips linux tooFedor Indutny-0/+57
They was previously missing
2013-07-08libc: fix MAP_ANON value on linuxFedor Indutny-4/+4
2013-07-03auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmrbors-0/+1
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-0/+1
2013-06-30global_heap: inline malloc_raw and add realloc_rawDaniel Micay-1/+1
2013-06-27std: unused import fix for androidYoung-il Choi-1/+0
2013-06-25Deny common lints by default for lib{std,extra}Alex Crichton-1/+1
2013-06-24libc: (u)int => c_(u)int for constsFedor Indutny-749/+784
2013-06-24libc: add POSIX-compatible sysconf constsFedor Indutny-0/+254
Because its part of POSIX. Values are taken from FreeBSD, linux and OSX header files.
2013-06-24libc: support functions from sys/mman.hFedor Indutny-2/+269
Because its part of POSIX. Values are taken from FreeBSD, linux and OSX header files.
2013-06-20auto merge of #7128 : yichoi/rust/fix_sometc, r=brsonbors-1/+49
- Fix stat struct for Android (found by SEGV at run-pass/stat.rs) - Adjust some test cases to rpass for Android - Modify some script to rpass for Android
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-2/+2
2013-06-17std: fix stat struct of android (SEGV error from run-pass/stat.rs on android)Young-il Choi-1/+49
2013-06-16Update doc references to new names for std, extra, and std::libcRalph Bodenner-2/+2
2013-06-06libc: omit memcpy, memmove and memsetDaniel Micay-13/+4
LLVM provides these functions as intrinsics, and will generate calls to libc when appropriate. They are exposed in the `ptr` module as `copy_nonoverlapping_memory`, `copy_memory` and `set_memory`.
2013-05-30Require documentation by default for libstdAlex Crichton-0/+1
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+2054
This only changes the directory names; it does not change the "real" metadata names.