From 51d8f69fb152ae5a47151c2f132fd4263ec3d144 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 14 Mar 2020 17:52:06 +0100 Subject: lib: Return number of written bytes on flow_write This is more in line with the write() system call and prepares for partial writes. Partial writes are disabled by default (and not yet implemented). Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/fccntl.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include/ouroboros/fccntl.h') diff --git a/include/ouroboros/fccntl.h b/include/ouroboros/fccntl.h index fac90134..965e281d 100644 --- a/include/ouroboros/fccntl.h +++ b/include/ouroboros/fccntl.h @@ -28,19 +28,20 @@ #include /* Flow flags, same values as fcntl.h */ -#define FLOWFRDONLY 00000000 /* Read-only flow */ -#define FLOWFWRONLY 00000001 /* Write-only flow */ -#define FLOWFRDWR 00000002 /* Read-write flow */ -#define FLOWFACCMODE 00000003 /* Access mask */ +#define FLOWFRDONLY 00000000 /* Read-only flow */ +#define FLOWFWRONLY 00000001 /* Write-only flow */ +#define FLOWFRDWR 00000002 /* Read-write flow */ +#define FLOWFACCMODE 00000003 /* Access mask */ -#define FLOWFDOWN 00000004 /* Flow is down */ +#define FLOWFDOWN 00000004 /* Flow is down */ -#define FLOWFRNOBLOCK 00001000 /* Non-blocking read */ -#define FLOWFWNOBLOCK 00002000 /* Non-blocking write */ +#define FLOWFRNOBLOCK 00001000 /* Non-blocking read */ +#define FLOWFWNOBLOCK 00002000 /* Non-blocking write */ #define FLOWFNONBLOCK (FLOWFRNOBLOCK | FLOWFWNOBLOCK) -#define FLOWFRNOPART 00004000 /* Disable partial reads */ +#define FLOWFRNOPART 00010000 /* Disable partial reads */ +#define FLOWFWNOPART 00020000 /* Disable partial writes */ -#define FLOWFDEFAULT FLOWFRDWR +#define FLOWFDEFAULT (FLOWFRDWR | FLOWFWNOPART) #define FLOWFINVALID (FLOWFWRONLY | FLOWFRDWR) -- cgit v1.2.3