mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 22:18:21 +00:00
devman: isseekable()
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user