aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-16 13:20:56 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-16 13:20:56 +0000
commit3718832a1542f7bf786a1678741b8566ad3a35c6 (patch)
treeac5851de53237fb3a0c77c9cead27acd279897f0 /include/libbb.h
parent1e18f1bab3400246129756a35bb5752ba98f4c90 (diff)
downloadbusybox-3718832a1542f7bf786a1678741b8566ad3a35c6.tar.gz
*: more readable handling of pipe fds. No code changes.
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 3175c8e7f..f505cc718 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -294,10 +294,15 @@ int xopen(const char *pathname, int flags);
int xopen3(const char *pathname, int flags, int mode);
int open_or_warn(const char *pathname, int flags);
int open3_or_warn(const char *pathname, int flags, int mode);
-void xpipe(int filedes[2]);
off_t xlseek(int fd, off_t offset, int whence);
off_t fdlength(int fd);
+void xpipe(int filedes[2]);
+/* In this form code with pipes is much more readable */
+struct fd_pair { int rd; int wr; };
+#define piped_pair(pair) pipe(&((pair).rd))
+#define xpiped_pair(pair) xpipe(&((pair).rd))
+
/* Useful for having small structure members/global variables */
typedef int8_t socktype_t;
typedef int8_t family_t;