add test for errno

This commit is contained in:
Paul Sajna
2018-03-07 18:36:18 -08:00
parent 89a9e01676
commit 93ddcca294
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
extern int errno;
+1
View File
@@ -29,6 +29,7 @@ use core::fmt;
use types::*;
#[thread_local]
#[no_mangle]
pub static mut errno: c_int = 0;
pub unsafe fn c_str(s: *const c_char) -> &'static [u8] {
+8
View File
@@ -0,0 +1,8 @@
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
int main(int argc, char** argv) {
chdir("nonexistent");
printf("errno: %d\n", errno);
}