This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <termios.h> | |
#include <string.h> | |
int main(void) | |
{ | |
struct termios tty_attr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_operations = partial_struct("file_operations") | |
null_fops = file_operations(null_fops) | |
from kernel_ffi import callback | |
def my_read_null(file, buf, count, ppos): | |
pos = p64(ppos) | |
b = "who said /dev/null must be empty?\n"[pos:] | |
l = min(len(b), count) | |
memcpy(buf, b, l) | |
p64(ppos, pos + l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int my_global_int = 5; | |
int mul_by_global(int y) | |
{ | |
return y * my_global_int; | |
} |
NewerOlder