Skip to content

Commit 60bf6d7

Browse files
committed
Auto merge of #3145 - coolreader18:redox-locale, r=JohnTitor
Add LC_ constants for redox (and truncate() is now supported) From `relibc/include/bits/locale.h` and `relibc/src/header/unistd/mod.rs`
2 parents ad894ac + 3a7dc42 commit 60bf6d7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/unix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ extern "C" {
10481048

10491049
pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
10501050

1051+
pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
10511052
pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
10521053

10531054
pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
@@ -1447,7 +1448,6 @@ cfg_if! {
14471448
if #[cfg(not(target_os = "redox"))] {
14481449
extern {
14491450
pub fn getsid(pid: pid_t) -> pid_t;
1450-
pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
14511451
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
14521452
link_name = "pause$UNIX2003")]
14531453
pub fn pause() -> ::c_int;

src/unix/redox/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,15 @@ pub const O_SYMLINK: ::c_int = 0x4000_0000;
459459
// FIXME: Fix negative values missing from includes
460460
pub const O_NOFOLLOW: ::c_int = -0x8000_0000;
461461

462+
// locale.h
463+
pub const LC_ALL: ::c_int = 0;
464+
pub const LC_COLLATE: ::c_int = 1;
465+
pub const LC_CTYPE: ::c_int = 2;
466+
pub const LC_MESSAGES: ::c_int = 3;
467+
pub const LC_MONETARY: ::c_int = 4;
468+
pub const LC_NUMERIC: ::c_int = 5;
469+
pub const LC_TIME: ::c_int = 6;
470+
462471
// netdb.h
463472
pub const AI_PASSIVE: ::c_int = 0x0001;
464473
pub const AI_CANONNAME: ::c_int = 0x0002;
@@ -502,6 +511,7 @@ pub const IP_MULTICAST_TTL: ::c_int = 33;
502511
pub const IP_MULTICAST_LOOP: ::c_int = 34;
503512
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
504513
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
514+
pub const IPPROTO_RAW: ::c_int = 255;
505515
// }
506516

507517
// netinet/tcp.h

0 commit comments

Comments
 (0)