Add some doc

This commit is contained in:
Baptiste Wicht 2016-08-16 21:47:00 +02:00
parent 802d340a50
commit 7c479250e8

View File

@ -42,11 +42,45 @@ int64_t mounts(char* buffer, size_t size);
int64_t mount(partition_type type, size_t mp_fd, size_t dev_fd);
int64_t mount(partition_type type, const char* mount_point, const char* device);
//Used only inside kernel as a easy way to read a complete file
/*!
* \brief Directly read a file into a std::string buffer
*
* This is only used directly by the kernel as an easy way to read a complete
* file. This is not safe to be exposed from user space calls.
*
* \param file The file to read
* \param content The std::string to fill with the file contents
*
* \return An error code if something went wrong, 0 otherwise
*/
int64_t direct_read(const path& file, std::string& content);
//Use only inside the kernel for FS to access devices
/*!
* \brief Directly read a file or a device
*
* This is meant to be used by file system drivers.
*
* \param file Path to the file (or device)
* \param buffer The output buffer
* \param count The number of bytes to read
* \param offset The offset where to start reading
*
* \return An error code if something went wrong, 0 otherwise
*/
int64_t direct_read(const path& file, char* buffer, size_t count, size_t offset = 0);
/*!
* \brief Directly write a file or a device
*
* This is meant to be used by file system drivers.
*
* \param file Path to the file (or device)
* \param buffer The input buffer
* \param count The number of bytes to write
* \param offset The offset where to start writing
*
* \return An error code if something went wrong, 0 otherwise
*/
int64_t direct_write(const path& file, const char* buffer, size_t count, size_t offset = 0);
} //end of namespace vfs