1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

Kernel: Add comment block about File, taking some from Device.

This commit is contained in:
Andreas Kling 2019-06-02 09:23:37 +02:00
parent e24f18dd83
commit 8454d3e184
2 changed files with 27 additions and 24 deletions

View file

@ -9,30 +9,6 @@
// There are two main subclasses:
// - BlockDevice (random access)
// - CharacterDevice (sequential)
//
// The most important functions in Device are:
//
// class_name()
// - Used in the /proc filesystem to identify the type of Device.
//
// read() and write()
// - Implement reading and writing.
// - Return the number of bytes read/written, OR a negative error code.
//
// can_read() and can_write()
//
// - Used to implement blocking I/O, and the select() and poll() syscalls.
// - Return true if read() or write() would succeed, respectively.
// - Note that can_read() should return true in EOF conditions,
// and a subsequent call to read() should return 0.
//
// ioctl()
//
// - Optional. If unimplemented, ioctl() on the device will fail with -ENOTTY.
// - Can be overridden in subclasses to implement arbitrary functionality.
// - Subclasses should take care to validate incoming addresses before dereferencing.
//
#include <Kernel/File.h>
#include <Kernel/UnixTypes.h>