Skip to content

Commit

Permalink
[#61993] Support fifo-related ioctls
Browse files Browse the repository at this point in the history
  • Loading branch information
GPlaczek committed Sep 16, 2024
1 parent 366db8f commit 1841ae4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c_lib/wasi_ext_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
#define WGETRH _IO(2, 1)
#define WGETRB _IO(2, 2)

// FIFO does not have a major, 0 is a placeholder, it might potentially conflict
// with memory device driver
#define FIFOSKERNW _IOW(0, 0, 4)
#define FIFOSKERNR _IOW(0, 1, 4)
#define FIFOSCLOSERM _IOW(0, 2, 4)

// Extended fs_fdflags
#define WASI_EXT_FDFLAG_CTRL_BIT ((__wasi_fdflags_t)0x0020)
#define WASI_EXT_FDFLAG_MASK ((__wasi_fdflags_t)0xffc0)
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pub const WGETGS: c_ulong = 2147746304;
pub const WGETRH: c_ulong = 513;
pub const WGETRB: c_ulong = 514;

pub const FIFOSKERNW: c_ulong = 1074003968;
pub const FIFOSKERNR: c_ulong = 1074003969;
pub const FIFOSCLOSERM: c_ulong = 1074003970;

pub use wasi::SIGNAL_KILL;

type ExitCode = i32;
Expand Down

0 comments on commit 1841ae4

Please sign in to comment.