Index: util/file/fd_io.h |
diff --git a/util/file/fd_io.h b/util/file/fd_io.h |
index 909e0d92e5896acd75d82770ba9c56fdf3583f43..37ad6f1cb2405945d647936532345f3a4b15c5a3 100644 |
--- a/util/file/fd_io.h |
+++ b/util/file/fd_io.h |
@@ -30,6 +30,7 @@ namespace crashpad { |
//! have been read into \a buffer. |
//! |
//! \sa WriteFD |
+//! \sa LoggingReadFD |
//! \sa CheckedReadFD |
//! \sa CheckedReadFDAtEOF |
ssize_t ReadFD(int fd, void* buffer, size_t size); |
@@ -45,17 +46,44 @@ ssize_t ReadFD(int fd, void* buffer, size_t size); |
//! been written to \a fd. |
//! |
//! \sa ReadFD |
+//! \sa LoggingWriteFD |
//! \sa CheckedWriteFD |
ssize_t WriteFD(int fd, const void* buffer, size_t size); |
//! \brief Wraps ReadFD(), ensuring that exactly \a size bytes are read. |
//! |
+//! \return `true` on success. If \a size is out of the range of possible |
+//! `read()` return values, if the underlying ReadFD() fails, or if other |
+//! than \a size bytes were read, this function logs a message and returns |
+//! `false`. |
+//! |
+//! \sa LoggingWriteFD |
+//! \sa ReadFD |
+//! \sa CheckedReadFD |
+//! \sa CheckedReadFDAtEOF |
+bool LoggingReadFD(int fd, void* buffer, size_t size); |
+ |
+//! \brief Wraps WriteFD(), ensuring that exactly \a size bytes are written. |
+//! |
+//! \return `true` on success. If \a size is out of the range of possible |
+//! `write()` return values, if the underlying WriteFD() fails, or if other |
+//! than \a size bytes were written, this function logs a message and |
+//! returns `false`. |
+//! |
+//! \sa LoggingReadFD |
+//! \sa WriteFD |
+//! \sa CheckedWriteFD |
+bool LoggingWriteFD(int fd, const void* buffer, size_t size); |
+ |
+//! \brief Wraps ReadFD(), ensuring that exactly \a size bytes are read. |
+//! |
//! If \a size is out of the range of possible `read()` return values, if the |
//! underlying ReadFD() fails, or if other than \a size bytes were read, this |
//! function causes execution to terminate without returning. |
//! |
//! \sa CheckedWriteFD |
//! \sa ReadFD |
+//! \sa LoggingReadFD |
//! \sa CheckedReadFDAtEOF |
void CheckedReadFD(int fd, void* buffer, size_t size); |
@@ -67,6 +95,7 @@ void CheckedReadFD(int fd, void* buffer, size_t size); |
//! |
//! \sa CheckedReadFD |
//! \sa WriteFD |
+//! \sa LoggingWriteFD |
void CheckedWriteFD(int fd, const void* buffer, size_t size); |
//! \brief Wraps ReadFD(), ensuring that it indicates end-of-file. |
@@ -85,6 +114,12 @@ void CheckedReadFDAtEOF(int fd); |
//! `false` is returned. |
bool LoggingCloseFD(int fd); |
+//! \brief Wraps `close()`, ensuring that it succeeds. |
+//! |
+//! If `close()` fails, this function causes execution to terminate without |
+//! returning. |
+void CheckedCloseFD(int fd); |
+ |
} // namespace crashpad |
#endif // CRASHPAD_UTIL_FILE_FD_IO_H_ |