Re: How arguments are stored on pages linux_bprm (Kernel 2.4)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The arguments are copied onto the bprm.pages using the copy_strings api.
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.

		                                    pages 
------------------------- ---
| sizeof (void*) | ^
|-----------------------| |
| argv[0] | |
|-----------------------| 31
| argv[1] | |
|-----------------------| |
| argv[2] | |
|=======================| ---
| argv[3] | ^
|-----------------------| |
| argv[4] | |
|-----------------------| 30
| | | |
|-----------------------| |
| | | |
|=======================| ---
| | |
| | |
| | |
| | |
| | |
| | |
|=======================| ---
| | ^
| | |
| | |
| | 0
| | |
| | |
------------------------ ---


The above info is w.r.t 2.4.21 kernel.
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

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux