mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
sockfs: FIONREAD ioctl
This commit is contained in:
+13
-2
@@ -134,9 +134,20 @@ int sockfs_ioctl(vnode_t *node, unsigned long request, void *arg, int *result) {
|
||||
|
||||
free(dev);
|
||||
return e;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
case FIONREAD:
|
||||
{
|
||||
socket_t *socket = SOCKFS_SOCKET_FROM_NODE(node);
|
||||
int *count = arg;
|
||||
if (socket->ops->datacount == NULL)
|
||||
return ENOTTY;
|
||||
|
||||
*count = socket->ops->datacount(socket);
|
||||
printf("count %d\n", *count);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return ENOTTY;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user