Probably because your new process started by execve() doesn't have the required permission to access the Internet. As said before in other forums, the system/kernel controls what each process does, according to permission granted by the user at installation time (plus eventually userid/group for system processes).
A new process spawn with fork()/execve() probably isn't recognized and is given a minimal set of permissions. Note: this is just conjecture, but the most likely explanation I can think of. Generally speaking, it's really not a good idea to use fork()/exec() from applications. Also keep in mind that the system can also choose to remove such processes immediately if it wants/needs to. On Sun, Sep 13, 2009 at 11:56 PM, CodePupil <[email protected]> wrote: > > Hi All, > > I'm facing strange problem in resolving remote hostname. > I have an application which needs to resolve some remote hostname in > order to connect to it, and If I start this application using execve() > call, the application doesn't resolve hostname, gethostbyname() > returns NULL. If I execute the application directly, it's able to > resolve the host name but if it's executed using execve() call, it > doesn't. > Same approach is working fine on Linux machine but on Android platform > it's not able to work. > > On Linux: > execve() -----> application() ------> Works > app() -----> Works > > On Android: > execve() -----> application() ------> Doesn't works -------> ??? > app() -----> Works > > _______________________________________________________________________________ > > Could anybody please throw some light on the matter ? > > Thanks! > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
