devman: isseekable()

This commit is contained in:
Matheus
2022-09-24 14:54:26 -03:00
parent ad768d0392
commit 1599890ce9
6 changed files with 38 additions and 6 deletions
+10
View File
@@ -56,6 +56,16 @@ int devman_isatty(int dev){
}
int devman_isseekable(int dev, size_t* max){
if(major(dev) > highestmajor)
return ENOTTY;
return majorcalls[major(dev)]->isseekable(minor(dev), max);
}
void devman_init(){
devfs_init();
+6 -1
View File
@@ -17,8 +17,13 @@ static int isatty(int minor){
return ENOTTY;
}
static int isseekable(int minor, size_t* max){
*max = ~(size_t)0;
return 0;
}
static devcalls calls = {
read, write, isatty
read, write, isatty, isseekable
};
void fulldev_init(){
+6 -1
View File
@@ -16,8 +16,13 @@ static int isatty(int minor){
return ENOTTY;
}
static int isseekable(int minor, size_t* max){
*max = ~(size_t)0;
return 0;
}
static devcalls calls = {
read, write, isatty
read, write, isatty, isseekable
};
void nulldev_init(){
+6 -1
View File
@@ -17,8 +17,13 @@ static int isatty(int minor){
return ENOTTY;
}
static int isseekable(int minor, size_t* max){
*max = ~(size_t)0;
return 0;
}
static devcalls calls = {
read, write, isatty
read, write, isatty, isseekable
};
void zerodev_init(){