Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

File descriptor -2 error after trying to write [closed]

$
0
0

I am trying to write a file with sys_write() from inside the kernel but every time the file descriptor value is -2.I have tried many different paths for the file but every single one of them failed.Any idea why that happens?

fd = sys_open( "test.txt" , 0, O_RDWR | O_CREAT);sys_write(fd, "test\n", strlen("test\n"));

Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>