]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/serial.cpp
Implement controls for file descriptor inheritance
[libs/core.git] / source / io / serial.cpp
index 2b3458a3eb0ea293563a522f6519ef8467ed76dd..09a9768023bad9e1fa00be0d398ac45a6933442c 100644 (file)
@@ -46,6 +46,12 @@ void Serial::set_block(bool b)
        sys_set_blocking(handle, b);
 }
 
        sys_set_blocking(handle, b);
 }
 
+void Serial::set_inherit(bool i)
+{
+       adjust_mode(mode, M_INHERIT, i);
+       sys_set_inherit(handle, i);
+}
+
 void Serial::set_baud_rate(unsigned rate)
 {
        DeviceState state;
 void Serial::set_baud_rate(unsigned rate)
 {
        DeviceState state;
@@ -120,5 +126,11 @@ unsigned Serial::do_read(char *buf, unsigned size)
        return ret;
 }
 
        return ret;
 }
 
+const Handle &Serial::get_handle(Mode m)
+{
+       check_access(m);
+       return handle;
+}
+
 } // namespace IO
 } // namespace Msp
 } // namespace IO
 } // namespace Msp