X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Funix%2Fhandle.cpp;h=cbffa48e62a7354522a8d9efb8fcafe8f8c36c60;hp=cb3ce4cae54c16aae8ceb83194044aac98aca94c;hb=ea8bf8f588310b0d7fd3297d74907602705bba1d;hpb=beb12b1ec35ca49512b00668b23caaead1ce8671 diff --git a/source/io/unix/handle.cpp b/source/io/unix/handle.cpp index cb3ce4c..cbffa48 100644 --- a/source/io/unix/handle.cpp +++ b/source/io/unix/handle.cpp @@ -14,6 +14,12 @@ void sys_set_blocking(Handle &handle, bool b) fcntl(*handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK)); } +void sys_set_inherit(Handle &handle, bool i) +{ + int flags = fcntl(*handle, F_GETFD); + fcntl(*handle, F_SETFD, (flags&~O_CLOEXEC)|(i?O_CLOEXEC:0)); +} + unsigned sys_read(Handle &handle, char *buf, unsigned size) { int ret = read(*handle, buf, size);