This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Why is chmod in libgfortran implemented as fork/exec?
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, fxcoudert at gcc dot gnu dot org, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Tue, 8 Jul 2008 09:38:31 +0200
- Subject: Re: Why is chmod in libgfortran implemented as fork/exec?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Vr6tBjEQBhqcU/tE49ZVX0PRQyb71l5g8SoBeuMgBTo=; b=kJ5sj22CMcIbiQIRNl+GvZx4HDvFm5/90KNo4IhvEEYAbUIgv1D9t2q/RyfatdE189 mPsjB48uIF6Fqyiva9g3/zklR5uDTg4QNc5IO00Th9+9fDeNNFMgYVP4yMjcukBXFs3H JxHRO8UPJCFrtv1fdLkTL/TJnXYqeNi1lzaUI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=q5U+9/f+Q5UFVUrd2PgklZefZdej4eRXjNRLhLeVjnhHYtFemdB9GnAzD16OEaUC7p h1sFxO8xxSHGnKB3KzjU9vlnBCTMK3yIQb1jLa84NmaUFNm7H7yHIy1Twe/gUyG1GBAK gAE+8lItciPsHQmcRrE/N30oZxk6pV4jSAnsY=
- References: <6dc9ffc80807071344j5f9ff7l62766669744fc429@mail.gmail.com> <de8d50360807071354h16cca29cp82037afadd9997ac@mail.gmail.com>
On Mon, Jul 07, 2008 at 01:54:49PM -0700, Andrew Pinski wrote:
>On Mon, Jul 7, 2008 at 1:44 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Hi,
>>
>> It may be a dump question. Why does libgfortran implement chmod intrinsic
>> with fork/exec? Why can't it call chmod () directly?
>
>Most likely because it has to parse the mode which is harder than
>doing a fork/exec :).
yes, but not all that hard nor too big :)
http://www.busybox.net/cgi-bin/viewcvs.cgi/*checkout*/trunk/busybox/libbb/parse_mode.c?content-type=text%2Fplain
text data bss dec hex filename
480 0 0 480 1e0 libbb/parse_mode.o