execve

This is a discussion on execve within the C Programming forums, part of the General Programming Boards category; int execve(const char *pathname, char *const argv[], char *const envp []); i know what to pass for the first two ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    50

    execve

    int execve(const char *pathname, char *const argv[], char *const envp []);

    i know what to pass for the first two parameters, but for envp i don't know what to pass.

    Please help me.

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    In that case, you should probably use "execv".

  4. #4
    Registered User
    Join Date
    Apr 2010
    Posts
    50
    what's the use of passing an environment array?

  5. #5
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,656
    What if the program you were calling required a specific directory to be present in the path, but you didn't want to add that to the global path for the user running the program? What if the program you were calling required the presence of an environment variable in much the same way?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. execve() Command help
    By Toonzaka22 in forum C Programming
    Replies: 6
    Last Post: 09-22-2009, 08:02 PM
  2. execve() and the compiler
    By kizyle502 in forum C Programming
    Replies: 4
    Last Post: 09-10-2009, 11:07 PM
  3. execv or execve?
    By jcafaro10 in forum C Programming
    Replies: 6
    Last Post: 04-12-2009, 12:18 PM
  4. Trouble with execve
    By Nositi in forum C Programming
    Replies: 14
    Last Post: 02-04-2008, 10:41 AM
  5. problems with fork() and execve()
    By kristy in forum C Programming
    Replies: 4
    Last Post: 12-21-2003, 08:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21