Created
October 26, 2010 01:15
-
-
Save erickt/646130 to your computer and use it in GitHub Desktop.
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
function __task_file_handle_filp:long(task:long, fd:long) %{ /* pure */ | |
struct task_struct *p = (struct task_struct *)((long)THIS->task); | |
struct files_struct *files; | |
struct file *filp; | |
rcu_read_lock(); | |
if ((files = kread(&p->files))) { | |
if ((filp = fcheck_files(files, THIS->fd))) { | |
THIS->__retvalue = (long)filp; | |
} | |
} | |
CATCH_DEREF_FAULT(); | |
rcu_read_unlock(); | |
%} |
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
function startswith:long (haystack:string, needle:string) | |
%{ | |
THIS->__retvalue = strstr(THIS->haystack, THIS->needle) == THIS->haystack; | |
%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment