Date: Sun, 19 Feb 2006 11:54:38 +0100 From: Divacky Roman <xdivac02@stud.fit.vutbr.cz> To: hackers@freebsd.org Subject: Re: different behaviour on fbsd and linux Message-ID: <20060219105438.GA12265@stud.fit.vutbr.cz> In-Reply-To: <20060218214329.GF69162@funkthat.com> References: <20060218171718.GA73133@stud.fit.vutbr.cz> <20060218172152.GB11874@britannica.bec.de> <20060218173908.GA73913@stud.fit.vutbr.cz> <20060218214329.GF69162@funkthat.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 18, 2006 at 01:43:30PM -0800, John-Mark Gurney wrote: > Divacky Roman wrote this message on Sat, Feb 18, 2006 at 18:39 +0100: > > 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. > > > > > > ah.. thnx.. the man page should be updated with "he > > first argument, by convention, should point to the file name associated > > with the file being executed." > > > > s/should/must then > > Nope.. it need not be the same.. in cases like this: > execl("/usr/bin/gzip", "gunzip", NULL); > > will give you gunzip behavior because the gzip binary looks at argv[0] > and changes it's behavior based upon what it finds.. look at crunchgen > for the ability to combine different programs into one binary... ok.. but I'd appreciate info that it cannot be NULL ;(
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060219105438.GA12265>