diff options
author | Rob Landley <rob@landley.net> | 2016-09-04 17:26:34 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-09-04 17:26:34 -0500 |
commit | 299d43879d70de33f84eafab78fcd78d7befd827 (patch) | |
tree | 6294a1bf61e21553ac827d3ae31229d6ab1aaac1 /lib/lib.h | |
parent | 0c8a66ea44eae5eec4d0398a1f2a6d93a54b0fb0 (diff) | |
download | toybox-299d43879d70de33f84eafab78fcd78d7befd827.tar.gz |
Add openro() and WARN_ONLY flag so xopen() and friends can warn without exiting.
Diffstat (limited to 'lib/lib.h')
-rw-r--r-- | lib/lib.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -102,6 +102,11 @@ struct dirtree *dirtree_read(char *path, int (*callback)(struct dirtree *node)); void show_help(FILE *out); +// Tell xopen and friends to print warnings but return -1 as necessary +// The largest O_BLAH flag so far is arch/alpha's O_PATH at 0x800000 so +// plenty of headroom. +#define WARN_ONLY (1<<31) + // xwrap.c void xstrncpy(char *dest, char *src, size_t size); void xstrncat(char *dest, char *src, size_t size); @@ -132,6 +137,7 @@ int xcreate(char *path, int flags, int mode); int xopen(char *path, int flags); int xcreate_stdio(char *path, int flags, int mode); int xopen_stdio(char *path, int flags); +int openro(char *path, int flags); int xopenro(char *path); void xpipe(int *pp); void xclose(int fd); |