kernel: usercopy functions

This commit is contained in:
Matheus
2024-06-09 19:31:26 -03:00
parent 429f56aced
commit 50b4b45d00
53 changed files with 712 additions and 260 deletions
+3 -4
View File
@@ -3,6 +3,7 @@
#include <spinlock.h>
#include <logging.h>
#include <kernel/alloc.h>
#include <kernel/usercopy.h>
#define PTY_BUFFER 4096
#define PTY_MAX 1024
@@ -198,12 +199,10 @@ static int ioctl(int minor, unsigned long request, void *_arg, int *result) {
switch (request) {
case TIOCGPTN: {
int *arg = _arg;
*arg = pty->minor;
break;
return USERCOPY_POSSIBLY_TO_USER(_arg, &pty->minor, sizeof(int));
}
default:
return tty_ioctl(pty->tty, request, _arg, result);
return tty_ioctl(pty->tty, request, _arg, result);
}
return 0;