Thread: Starting A Process

  1. #1
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299

    Starting A Process

    I've been string to learn linux programming this weekend.
    I've picked a bad place to start http://www.overthewire.org/
    I've had a hard time finding different ways to start a process.
    What I really need is a way to start a process and be able to pass it the 'int argc, char *argv[]'
    values.

    can this be done with execl() ?
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    And you didn't do man execl because why?
    The const char *arg0 and subsequent ellipses in the execl(), execlp(),
    and execle() functions can be thought of as arg0, arg1, ..., argn.
    Together they describe a list of one or more pointers to null-terminated
    strings that represent the argument list available to the executed pro-
    gram. The first argument, by convention, should point to the file name
    associated with the file being executed. The list of arguments must be
    terminated by a NULL pointer.
    Edit: And if you had read further down the page and wanted to literally pass argv, rather than a bunch of args:
    The execv(), execvp(), and execvP() functions provide an array of point-
    ers to null-terminated strings that represent the argument list available
    to the new program. The first argument, by convention, should point to
    the file name associated with the file being executed. The array of
    pointers must be terminated by a NULL pointer.

  3. #3
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    Code:
    bt vortex # man execl
    No manual entry for execl
    sorry i'm running a livecd and the man files are incomplete. Thx for the post. I got what i needed from your reply.
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    What makes you think I didn't type "man execl" into the little box in the top right-hand corner of my browser?

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by tabstop View Post
    What makes you think I didn't type "man execl" into the little box in the top right-hand corner of my browser?
    Bad mood today?

    Perhaps the problem is not knowing what the function is called in the first place. How would you know what to search for?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  3. Starting a process with no disk file present
    By tomngi in forum Windows Programming
    Replies: 12
    Last Post: 02-05-2008, 01:20 PM
  4. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM