home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,127 of 4,255   
   Paul Edwards to Andy Valencia   
   Re: flexible linux ELF   
   19 Feb 24 10:44:38   
   
   From: mutazilah@gmail.com   
      
   On 18/02/24 22:25, Andy Valencia wrote:   
   > scott@slp53.sl.home (Scott Lurndal) writes:   
   >>> you can use the getpid() syscall to get the process ID, then open and   
   >>> read /proc//cmdline   
   >> But no linux code uses it to substitute for the argc and argv   
   >> arguments to main.   
   >   
   > Right off the bat, I'm curious how you handle embedded spaces   
   > in arguments?   
   >   
   > $ mycommand arg1 "arg2 with extras" arg3   
   >   
   > This context appears lost if you look at cmdline?   
      
   I just tried it ...   
      
   root@kerravon2-pc:/home/kerravon/w2kshare# ./lintest.exe abc "d e f" ghi   
   welcome to pdptest3   
   main function is at 08048294   
   allocating 10 bytes   
   m1 is 0804FFB0   
   allocating 20 bytes   
   m2 is 08050000   
   stack is around FFA5115C   
   printing arguments   
   argc = 4   
   arg 0 is <./lintest.exe>   
   arg 1 is    
   arg 2 is    
   arg 3 is    
   root@kerravon2-pc:/home/kerravon/w2kshare#   
      
   ... works fine already.   
      
   If it didn't, I would have reused the code I already   
   use for MSDOS.   
      
   BFN. Paul.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca