summaryrefslogtreecommitdiffstats
path: root/lib/Utils/xfuncs.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-26 15:42:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-26 15:42:27 +0100
commitffb51df395d5e0427ef00a6cff1f93a63eaa65e5 (patch)
treeeebbf404c2c7602f2f88b3e68f04d244f5511193 /lib/Utils/xfuncs.cpp
parent65869764558afc330f9ba0227032d49b9b676e27 (diff)
downloadabrt-ffb51df395d5e0427ef00a6cff1f93a63eaa65e5.tar.gz
abrt-ffb51df395d5e0427ef00a6cff1f93a63eaa65e5.tar.xz
abrt-ffb51df395d5e0427ef00a6cff1f93a63eaa65e5.zip
add bits of infrastructure needed for xmlprc code.
This does not affect existing code in any way. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/xfuncs.cpp')
-rw-r--r--lib/Utils/xfuncs.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index d256c19..9c8b0f1 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -5,6 +5,22 @@
*/
#include "abrtlib.h"
+/* Turn on nonblocking I/O on a fd */
+int ndelay_on(int fd)
+{
+ return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
+}
+
+int ndelay_off(int fd)
+{
+ return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK);
+}
+
+int close_on_exec_on(int fd)
+{
+ return fcntl(fd, F_SETFD, FD_CLOEXEC);
+}
+
// Die if we can't allocate size bytes of memory.
void* xmalloc(size_t size)
{