On Wed, Aug 09, 2017 at 01:16:19PM -0400, DJ Delorie wrote:
> "Dmitry V. Levin" <l...@altlinux.org> writes:
> > Why should we pretend that execve/execveat don't return if they actually
> > do return?
> 
> If execve() succeeds, the calling image no longer exists... what does it
> return *to* ?

It's returned to the new image and is available in the same register as on
exiting other syscalls.

> The man page even says:
> 
>   "execve() does not return on success,"
> 
> Hence the philosophical question - does the user *expect* to see "= 0"
> in the trace when execve succeeds, or not?

This "= 0" has been printed all these years, so it's quite logical to
suppose that the user expects to see "= 0" and might be quite surprised
to see something else like "= 11" instead.

> Where in any of the traced
> programs is that "= 0" available for inspection?

It's in the register.  On x86_64 it's %rax, on s390 it's %r2, etc.


-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to