Starting A Process

This is a discussion on Starting A Process within the Linux Programming forums, part of the Platform Specific Boards category; 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 ...

  1. #1
    Nor
    Nor is offline
    h ֆhr 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,185
    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
    Nor
    Nor is offline
    h ֆhr 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,185
    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
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,273
    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, 11:05 AM
  2. Replies: 3
    Last Post: 10-15-2008, 10: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, 02:43 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 08:53 AM

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