Permalink
Browse files

Add README.

  • Loading branch information...
bnoordhuis committed Jan 29, 2012
1 parent 3828e2f commit f357230d546bd6c23b407316cdfadf550a3cc350
Showing with 33 additions and 0 deletions.
  1. +33 −0 README.md
View
@@ -0,0 +1,33 @@
+## rust-errno
+
+This module lets you inspect the value of `errno`, the magic thread-local value
+that glibc and other libraries use to signal errors.
+
+You probably don't need it unless you're dealing with C functions directly, for
+example because you're writing Rust bindings to an existing C library.
+
+### how to build
+
+```
+rustc --lib errno.rs
+```
+
+### how to use
+
+```rust
+use errno;
+use std;
+
+import strerror = errno::strerror;
+import errno = errno::errno;
+
+fn main() {
+ std::io::file_reader("/does/not/exist");
+ std::io::println(strerror(errno())); // prints "No such file or directory"
+}
+```
+
+### known bugs
+
+Currently only works on Linux. Requires glibc 2.3.4 or better. Support for OS X
+and Solaris may be added in the future.

0 comments on commit f357230

Please sign in to comment.