Skip to content

Commit ac7201b

Browse files
committed
Auto merge of #1070 - redox-os:relibc, r=alexcrichton
Add additional Redox OS functions This adds `chown`, `fchown`, `setenv`, and `unsetenv` to the `redox` module, and reorders the functions by name
2 parents 1844a77 + 919dd7c commit ac7201b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/redox/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,19 @@ pub const SIGPWR: ::c_int = 30;
118118
pub const SIGSYS: ::c_int = 31;
119119

120120
extern {
121+
pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
122+
pub fn close(fd: ::c_int) -> ::c_int;
123+
pub fn fchown(fd: ::c_int, uid: ::uid_t, gid: ::gid_t) -> ::c_int;
124+
pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
121125
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
122126
pub fn getpid() -> pid_t;
123127
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
124-
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
125-
-> ::ssize_t;
128+
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
129+
pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int)
130+
-> ::c_int;
131+
pub fn unsetenv(name: *const c_char) -> ::c_int;
126132
pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t)
127133
-> ::ssize_t;
128-
pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
129-
pub fn close(fd: ::c_int) -> ::c_int;
130134
}
131135

132136
#[link(name = "c")]

0 commit comments

Comments
 (0)