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

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

 



ill rephrase the ques.
what im trying to do is executing an app using execve sys call and then i want to acknowledge the kernel whether the execve was succ or not(using udp).
but as we know that the execve overlays its image on the user process and on succ it returns nothing ,so in times when the call is succ how do i acknowledge my kernel about it?

also i want to send the kernel an acknowledgment when the execution of the app terminates(finished) .Howto?

if not through acknowledgements then by monitoring any kernel variables or signals or thru any other way ,can the kernel know about the app termination.

On Sat, Aug 29, 2009 at 10:10 AM, krushnaal pai <krisonearth@xxxxxxxxx> wrote:
what im trying to do is executing an app from a user mode handwritten app using execve sys call and then i want to ack the kernel whether the execve was succ or not.
but as we know that the execve overlays its image on the user process ,so in times when the call is succ my kernel doesnt know about it.
is there any other way to do so?


On Sat, Aug 29, 2009 at 3:31 AM, Matthias Kaehlcke <matthias@xxxxxxxxxxxx> wrote:
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                  `-



[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