]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/base.h
Implement controls for file descriptor inheritance
[libs/core.git] / source / io / base.h
index c58be90f7ebd039504e261105e53dc7329a1ac13..a6a8827c6d4c28ee981806c4284af063b96de8dd 100644 (file)
@@ -12,9 +12,6 @@ namespace IO {
 
 /**
 Common interface for all I/O objects.
-
-A derived class must call set_events(P_NONE) before it is destroyed to avoid
-leaving stale pointers in an EventDispatcher.
 */
 class Base
 {
@@ -60,7 +57,13 @@ public:
        was done.
 
        Blocking is enabled by default. */
-       virtual void set_block(bool) { }
+       virtual void set_block(bool) = 0;
+
+       /** Sets inheritance mode.  When inheritance is enabled, the file descriptor
+       will persist through Process::execute.
+
+       Inheritance is disabled by default. */
+       virtual void set_inherit(bool) = 0;
 
        /** Returns the current mode flags. */
        Mode get_mode() const { return mode; }
@@ -108,7 +111,7 @@ public:
 
        /** Returns the system-level handle for the object.  Used by Console to
        perform redirections. */
-       virtual const Handle &get_handle(Mode);
+       virtual const Handle &get_handle(Mode) = 0;
 };
 
 } // namespace IO