Data structure in system call/user program
From: terry (terry_at_no_spam.terry.com)
Date: 08/28/04
- Next message: William Payne: "Can I make this Makefile work?"
- Previous message: Lothar Scholz: "Splitting AVI Progress Animation into multiple gif's"
- Next in thread: mjt: "Re: Data structure in system call/user program"
- Reply: mjt: "Re: Data structure in system call/user program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Aug 2004 17:48:37 +0800
Hi all
I am doing an academic assignment which requires me to copy some data
from *(current->mm) into an user program through the system call
memorymap(struct mm_struct *mymap).
As part of the assignemnt, i am supposed to create both the user program
(which tests the system call) and the system call itself.
After some thinking, I believe that I have a few options:
1) declaring "mm_struct mymap" in user program and then pass it into
the system call. However, this pose a problem because many compilation
errors occur when I try including "sched.c" into my user program .c file.
2) defining my own structure of mm_struct (with only the required data)
in both user program sourcecode and system call sourcecode. But this
give me another compilation error "redefinition of 'struct mm_struct'"
when I try to compile the sourcecode for my system call.
3) defining my own structure of mm_struct (with only the required data)
in ONLY the user program sourcecode and pass it into the system call. I
haven't try this yet, but this doesn't feel right as the system call
function will be confused by the different versions mm_struct (the one
defined by me and the built in one in sched.h) that it trys to process.
What else can I try? Is there anyway to use the built-in mm_struct in
the program sourcecode? or anyway to pass my own-defined mm_struct to
the system call?
Thank you in advance...
- Next message: William Payne: "Can I make this Makefile work?"
- Previous message: Lothar Scholz: "Splitting AVI Progress Animation into multiple gif's"
- Next in thread: mjt: "Re: Data structure in system call/user program"
- Reply: mjt: "Re: Data structure in system call/user program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|