Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Feb 2006 14:13:15 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        stefan@fafoe.narf.at
Cc:        freebsd-hackers@freebsd.org, joerg@britannica.bec.de
Subject:   Re: different behaviour on fbsd and linux
Message-ID:  <20060218.141315.100064292.imp@bsdimp.com>
In-Reply-To: <20060218174216.GC578@wombat.fafoe.narf.at>
References:  <20060218171718.GA73133@stud.fit.vutbr.cz> <20060218172152.GB11874@britannica.bec.de> <20060218174216.GC578@wombat.fafoe.narf.at>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060218174216.GC578@wombat.fafoe.narf.at>
            Stefan Farfeleder <stefan@fafoe.narf.at> writes:
: On Sat, Feb 18, 2006 at 06:21:52PM +0100, joerg@britannica.bec.de wrote:
: > On Sat, Feb 18, 2006 at 06:17:18PM +0100, Divacky Roman wrote:
: > >       execl("/bin/ls", NULL);
: > 
: > This is wrong. You must specify arg0 != NULL (POSIX says so) and you
: > must NULL-terminate the *following* list.
: > 
: > E.g.:
: > 	execl("/bin/ls", "/bin/ls", NULL);
: > is what you want to do.
: 
: execl("/bin/ls", "/bin/ls", (char *)NULL); as NULL might expand to an
: integer 0.

This is one of the times that the difference is important, since
this function is a varadic one, and you must always cast when passing
through varadic args.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060218.141315.100064292.imp>