Re: how to check whether execve is successful or not?

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

 



El Sat, Aug 29, 2009 at 12:40:18AM +0530 krushnaal pai ha dit:

>    i tried to printf the return values of error codes but that wont work bcoz
>    the elf does run successfully(no errors)
>    As execve doesnt return anything on a successful execve sys call,is there
>    a way to check whether it was successful or not.
>    neglect the fact that i can see the elf running

as the calls of the exec() family substitute the current executable
when executed with success, you can only check the failure case from
the program calling exec(). if exec() returns at all it returns with
exit status -1, otherwise it has been executed with success and the
'new' program is running.

-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

        They that can give up essential liberty to obtain a little
           temporary safety deserve neither liberty nor safety
                         (Benjamin Franklin)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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