From ba8f3ddba03ab93158c93f77ef98137e1dd6e8e9 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 2 Oct 2024 20:29:01 -0600 Subject: lib9p: add O_* flags --- lib9p/include/lib9p/_types.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib9p/include') diff --git a/lib9p/include/lib9p/_types.h b/lib9p/include/lib9p/_types.h index 8f9595e..d853cf3 100644 --- a/lib9p/include/lib9p/_types.h +++ b/lib9p/include/lib9p/_types.h @@ -30,6 +30,20 @@ typedef uint8_t lib9p_qt_t; #define _LIB9P_QT_UNUSED_0 ((lib9p_qt_t)(1<<0)) #define LIB9P_QT_FILE ((lib9p_qt_t)(0)) +typedef uint8_t lib9p_o_t; +#define _LIB9P_O_UNUSED_7 ((lib9p_o_t)(1<<7)) +#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) +#define _LIB9P_O_UNUSED_5 ((lib9p_o_t)(1<<5)) +#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) +#define _LIB9P_O_UNUSED_3 ((lib9p_o_t)(1<<3)) +#define _LIB9P_O_UNUSED_2 ((lib9p_o_t)(1<<2)) +#define _LIB9P_O_rwx_1 ((lib9p_o_t)(1<<1)) +#define _LIB9P_O_rwx_0 ((lib9p_o_t)(1<<0)) +#define LIB9P_O_READ ((lib9p_o_t)(0)) +#define LIB9P_O_WRITE ((lib9p_o_t)(1)) +#define LIB9P_O_RDWR ((lib9p_o_t)(2)) +#define LIB9P_O_EXEC ((lib9p_o_t)(3)) + struct lib9p_d { uint32_t len; uint8_t *dat; @@ -161,8 +175,8 @@ struct lib9p_msg_Rwalk { }; struct lib9p_msg_Topen { - uint32_t fid; - uint8_t mode; + uint32_t fid; + lib9p_o_t mode; }; struct lib9p_msg_Ropen { @@ -174,7 +188,7 @@ struct lib9p_msg_Tcreate { uint32_t fid; struct lib9p_s name; uint32_t perm; - uint8_t mode; + lib9p_o_t mode; }; struct lib9p_msg_Rcreate { -- cgit v1.2.3-2-g168b