#include <linux/sched.h>
Hello People,
I am trying to include #include <linux/sched.h> and access a function in my program.But I end up having an error. This is the following code... #include<stdio.h> #include<sys/stat.h> #include<stdlib.h> #include <linux/sched.h> #include <unistd.h> void execname() { struct task_struct *my; my = find_task_by_vpid(getpid()); printf("%s",my->comm); } int main() { execname(); } this is the error:Test.c:8: error: ‘find_task_by_vpid’ was not declared in this scope |
try find_pid_ns (thread_pid, 0)
|
Hello Sir,
That didn't help as well.This is what I wanted to do.. "Create a system call called quad that takes a process ID, retrieves its task_struct, and quadruples its current timeslice. Return the new timeslice on success, and a negative number on failure." Thank You. |
I think this function is for the kernel space _ONLY_. See function "sched_setscheduler" and friends.
|
I am new to linux programming,can you explain what is kernel space _ONLY_ and how may i use it?
Thanks a lot... |
Quote:
The major work there is in implementing a system call. Have a look at this. |
All times are GMT -5. The time now is 03:03 AM. |