chunk: Add helper function to create a chunk from data read from a file descriptor

This commit is contained in:
Tobias Brunner
2013-10-23 17:20:39 +02:00
parent b08292a520
commit 46cded2627
2 changed files with 40 additions and 0 deletions
+8
View File
@@ -99,6 +99,14 @@ void chunk_split(chunk_t chunk, const char *mode, ...);
*/
bool chunk_write(chunk_t chunk, char *path, char *label, mode_t mask, bool force);
/**
* Store data read from FD into a chunk
*
* @param fd file descriptor to read from
* @return chunk or chunk_empty on failure
*/
chunk_t chunk_from_fd(int fd);
/**
* Convert a chunk of data to hex encoding.
*