Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!sol.ctr.columbia.edu!ucselx!petunia!csuchico.edu!warlock From: warlock@ecst.csuchico.edu (John Kennedy) Newsgroups: news.software.b Subject: Re: NNTP 1.5.10 / Cnews 15-Dec-1990 / Stupid UNIX exec Summary: inews exec() Keywords: exec execlp execvp CTIX ENOEXEC Message-ID: <1991Feb01.183943.9025@ecst.csuchico.edu> Date: 1 Feb 91 18:39:43 GMT References: <1991Jan30.062800.15853@ecst.csuchico.edu> <1991Jan31.023944.19068@blilly.UUCP> Sender: news@ecst.csuchico.edu (USENET) Organization: California State University, Chico Lines: 25 In article <1991Jan31.023944.19068@blilly.UUCP> Bruce Lilly writes: > >I also ran into this, but I don't recall exactly how I solved it. I'll >just note in passing that one possible solution is contained in the >exec(2) man page -- two members of the exec family will work with scripts >(Hint: read the description of the ENOEXEC error return). Maybe it's a suble RTFM, maybe it's not. (-: In any case, one of the things execle() *does* do is pass the environment, which is not one of the standard things that the new process inherits from the process that called execle(). NNTP makes a small exercise in copying it's environment, and I'll just assume they did it for a reason and try not to get too far out to pasture. (-:{ For reference: The exec(2) call "... transforms the calling process into a new process ... constructed from an ordinary, executable file ... [that] consists of a header [see a.out(4)], a text segment, and a data segment." Shell scripts don't meet the a.out header requirement, but under the possible errors that can be returned, it kind of goes back on itself. Under ENOEXEC, it says: "The exec is not an execlp or execvp, and the new process file has ... an invalid magic number in it's header." -- Warlock, AKA +-----------------------------------------------+ John Kennedy | internet: warlock@ecst.csuchico.edu | CSU Chico +-----------------------------------------------+ KC6RCK IBM, You BM, We All BM for IBM!