[squeak-dev] Changing process exit status

Eliot Miranda eliot.miranda at gmail.com
Tue May 14 01:20:48 UTC 2013


On Sun, May 12, 2013 at 2:36 PM, David T. Lewis <lewis at mail.msen.com> wrote:

> On Sun, May 12, 2013 at 10:18:51PM +0200, Levente Uzonyi wrote:
> > On Sun, 12 May 2013, Frank Shearar wrote:
> >
> > >http://build.squeak.org/job/ReleaseSqueakTrunk/239/console shows the
> > >CommandLineToolSet correctly bailing a release because
> > >ReleaseBuilderFor4dot5 no longer exists. Note the build's green light.
> > >What I'd like is a means of quitting the image _with an error_.
> > >
> > >How do I do that?
> >
> > CogVM has support for it - not sure about the interpreter, but there's
> > definitely no support code on the image-side. The way it works is that
> you
> > can add an argument to primitive 113. E.g.:
>
> This feature is not in the interpreter VM. It requires an update from the
> oscog platforms sources to the trunk platforms sources in Subversion, and
> that has not yet been done.
>
> FWIW, if you are compiling your own VM (Cog or interpreter) it is easy to
> add a primitive to do the same thing:
>
> InterpreterPrimitives>>primitiveQuitWithStatus
>         "Exit the VM immediately, returning an exit value"
>         <export: true>
>         self exit: (self stackIntegerValue: 0).
>         ^self primitiveFail
>

Um, not in Cog.  In the Cog VM it must exit through ioExitWithErrorCode to
avoid breaking various services.  In the Interpreeter VM I suspect
ioExitWithErrorCode needs to be added also because using exit will
circumvent the code in ioExit.


>
> Then add this to the image:
>
> SmalltalkImage>>forceExitWithStatus: statusInteger
>         "Smalltalk forceExitWithStatus: 7"
>         <primitive: 'primitiveQuitWithStatus'>
>         self primitiveFailed
>
> Dave
>
> >
> > quitPrimitive: exitCode
> >       "Primitive. Exit to another operating system on the host machine,
> if
> >       one
> >       exists. All state changes in the object space since the last
> >       snapshot are lost.
> >       Essential. See Object documentation whatIsAPrimitive."
> >
> >       <primitive: 113>
> >       self primitiveFailed
> >
> >
> > Levente
> >
> > >
> > >frank
> > >
> > >
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130513/2a13605c/attachment.htm


More information about the Squeak-dev mailing list