From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 18 21:43:34 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F2A216A420 for ; Sat, 18 Feb 2006 21:43:34 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA29343D46 for ; Sat, 18 Feb 2006 21:43:33 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (dk0omz7jk8xldi5s@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id k1ILhWn1037450; Sat, 18 Feb 2006 13:43:32 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id k1ILhUNu037449; Sat, 18 Feb 2006 13:43:30 -0800 (PST) (envelope-from jmg) Date: Sat, 18 Feb 2006 13:43:30 -0800 From: John-Mark Gurney To: Divacky Roman Message-ID: <20060218214329.GF69162@funkthat.com> Mail-Followup-To: Divacky Roman , hackers@freebsd.org References: <20060218171718.GA73133@stud.fit.vutbr.cz> <20060218172152.GB11874@britannica.bec.de> <20060218173908.GA73913@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060218173908.GA73913@stud.fit.vutbr.cz> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: hackers@freebsd.org Subject: Re: different behaviour on fbsd and linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 21:43:34 -0000 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... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."