diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 20:29:01 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 20:29:01 -0600 |
commit | ba8f3ddba03ab93158c93f77ef98137e1dd6e8e9 (patch) | |
tree | 6a502f012e52d6186dccd05c659e7cddd3c4b73f /lib9p/include | |
parent | 48ec9be1eba930b06050262a1a651d794c31bc11 (diff) |
lib9p: add O_* flags
Diffstat (limited to 'lib9p/include')
-rw-r--r-- | lib9p/include/lib9p/_types.h | 20 |
1 files changed, 17 insertions, 3 deletions
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 { |