]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/pipe.cpp
Use size_t for sizes in I/O classes
[libs/core.git] / source / io / pipe.cpp
index 444f8c72a3c3bcc986935f698c3d4b62e61b1a37..01bf20aaea32c056b33e2213dafdd1d0515c3f1e 100644 (file)
@@ -47,7 +47,14 @@ void Pipe::set_block(bool b)
        sys_set_blocking(write_handle, b);
 }
 
-unsigned Pipe::do_write(const char *buf, unsigned size)
+void Pipe::set_inherit(bool i)
+{
+       adjust_mode(mode, M_INHERIT, i);
+       sys_set_inherit(read_handle, i);
+       sys_set_inherit(write_handle, i);
+}
+
+size_t Pipe::do_write(const char *buf, size_t size)
 {
        if(size==0)
                return 0;
@@ -55,12 +62,12 @@ unsigned Pipe::do_write(const char *buf, unsigned size)
        return sys_write(write_handle, buf, size);
 }
 
-unsigned Pipe::do_read(char *buf, unsigned size)
+size_t Pipe::do_read(char *buf, size_t size)
 {
        if(size==0)
                return 0;
 
-       unsigned ret = reader.read(buf, size);
+       size_t ret = reader.read(buf, size);
        if(ret==0)
                set_eof();