linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Dube <mujo@dubix.org>
To: Prasanta Sadhukhan <Prasanta.Sadhukhan@Sun.COM>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: execv fails with EFAULT
Date: Wed, 7 Mar 2007 09:20:17 -0500	[thread overview]
Message-ID: <20070307142017.GB22868@dubix.org> (raw)
In-Reply-To: <45EEA7F8.5080908@sun.com>

On Wed, Mar 07, 2007 at 05:24:32PM +0530, Prasanta Sadhukhan wrote:
>    if(execv("/bin/ls", "-l") == -1)
>
hi

from man execv:

int execv(const char *path, char *const argv[]);

see the second argument here is an array of strings, not a string

so you cant just pass a string, you need to pass an array of pointers and it must be terminated by a NULL pointer

-M

      parent reply	other threads:[~2007-03-07 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 11:54 execv fails with EFAULT Prasanta Sadhukhan
2007-03-07 12:46 ` Steve Graegert
2007-03-07 13:14   ` Prasanta Sadhukhan
2007-03-07 13:50     ` Steve Graegert
2007-03-07 16:58     ` Glynn Clements
2007-03-07 14:20 ` Mathieu Dube [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070307142017.GB22868@dubix.org \
    --to=mujo@dubix.org \
    --cc=Prasanta.Sadhukhan@Sun.COM \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).