Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.development > #18661

Re: flexible linux ELF

From Paul Edwards <mutazilah@gmail.com>
Newsgroups alt.os.development
Subject Re: flexible linux ELF
Date 2024-02-19 10:44 +0800
Organization A noiseless patient Spider
Message-ID <uqufam$1m1bf$1@dont-email.me> (permalink)
References <0s5AN.229393$yEgf.165499@fx09.iad> <up912h$jq9n$1@dont-email.me> <uqosgp$2ro7$1@dont-email.me> <170826630467.10994.5656282851204178133@media.vsta.org>

Show all headers | View raw


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/<PID>/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 <abc>
arg 2 is <d e f>
arg 3 is <ghi>
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.

Back to alt.os.development | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-01-30 04:16 +0800
  Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-17 07:52 +0800
    Re: flexible linux ELF scott@slp53.sl.home (Scott Lurndal) - 2024-02-17 16:49 +0000
      Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-18 11:19 +0800
        Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-18 17:48 +0800
    Re: flexible linux ELF Andy Valencia <vandys@vsta.org> - 2024-02-18 06:25 -0800
      Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-19 10:44 +0800

csiph-web