diff --git a/src/io/FileDescriptor.cxx b/src/io/FileDescriptor.cxx index 08b457831..5d0dd17f2 100644 --- a/src/io/FileDescriptor.cxx +++ b/src/io/FileDescriptor.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 Max Kellermann + * Copyright 2012-2020 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -289,7 +290,7 @@ FileDescriptor::GetSize() const noexcept } void -FileDescriptor::FullRead(void *_buffer, size_t length) +FileDescriptor::FullRead(void *_buffer, std::size_t length) { auto buffer = (uint8_t *)_buffer; @@ -307,7 +308,7 @@ FileDescriptor::FullRead(void *_buffer, size_t length) } void -FileDescriptor::FullWrite(const void *_buffer, size_t length) +FileDescriptor::FullWrite(const void *_buffer, std::size_t length) { auto buffer = (const uint8_t *)_buffer; diff --git a/src/io/FileDescriptor.hxx b/src/io/FileDescriptor.hxx index 3b33081bf..c180bf7f4 100644 --- a/src/io/FileDescriptor.hxx +++ b/src/io/FileDescriptor.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 Max Kellermann + * Copyright 2012-2020 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,7 @@ #include "util/Compiler.h" +#include #include #include @@ -229,7 +230,7 @@ public: gcc_pure off_t GetSize() const noexcept; - ssize_t Read(void *buffer, size_t length) noexcept { + ssize_t Read(void *buffer, std::size_t length) noexcept { return ::read(fd, buffer, length); } @@ -237,9 +238,9 @@ public: * Read until all of the given buffer has been filled. Throws * on error. */ - void FullRead(void *buffer, size_t length); + void FullRead(void *buffer, std::size_t length); - ssize_t Write(const void *buffer, size_t length) noexcept { + ssize_t Write(const void *buffer, std::size_t length) noexcept { return ::write(fd, buffer, length); }