bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof (void*) indicates the total
bytes that the pages can accomadate. The arrangement of the arguments onto
the pages is as shown in the figure.
pagesThe above info is w.r.t 2.4.21 kernel.
------------------------- ---
| sizeof (void*) | ^
|-----------------------| |
| argv[0] | |
|-----------------------| 31
| argv[1] | |
|-----------------------| |
| argv[2] | |
|=======================| ---
| argv[3] | ^
|-----------------------| |
| argv[4] | |
|-----------------------| 30
| | | |
|-----------------------| |
| | | |
|=======================| ---
| | |
| | |
| | |
| | |
| | |
| | |
|=======================| ---
| | ^
| | |
| | |
| | 0
| | |
| | |
------------------------ ---
Anybody please correct me if i am wrong.
regards
prashant.
On 6/5/06, Dang <linuxdang@xxxxxxxxx> wrote:
Hi,I have a requirement of reading command line arguments passed while invoking a binary, inside load_elf_binary(). I tried to read kernel 2.4 code but i am confused how data is stored inside the pages (linux_bprm)Can anybody point to some document / tutorial or if possible brief me about how it is done?Regards,Dang
--
S Prashant
email:- prashant@xxxxxxxxxxxxx
SolidCore Techsoft Systems India(Pvt)Ltd
A-16, Mohan Co-operative Industrial Estate,
Mathura Road,
New Delhi, 11 00 44
Phone:91 11 51678443