diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-01-13 15:54:46 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-01-13 15:54:46 -0500 |
commit | e766015d60c927aae03b8e43d956c6976c16b2ba (patch) | |
tree | 796b0ab4c94d3cf5e8c12b4d263e054eb04f6bcd /src/bfstd.h | |
parent | e9588c49d5539ded993f720fc6855d6fa878c997 (diff) | |
download | bfs-e766015d60c927aae03b8e43d956c6976c16b2ba.tar.xz |
ioq: Use the negative errno convention
Diffstat (limited to 'src/bfstd.h')
-rw-r--r-- | src/bfstd.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bfstd.h b/src/bfstd.h index 8953b9b..d160c88 100644 --- a/src/bfstd.h +++ b/src/bfstd.h @@ -63,6 +63,16 @@ bool error_is_like(int error, int category); */ bool errno_is_like(int category); +/** + * Apply the "negative errno" convention. + * + * @param ret + * The return value of the attempted operation. + * @return + * ret, if non-negative, otherwise -errno. + */ +int try(int ret); + #include <fcntl.h> #ifndef O_EXEC |