🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #1585

Re: Unix error handling

#1585
From: lance.norskog
Date: Mon, 10 Sep 1990 23:27
26 lines
1309 bytes
Setjmp() and longjmp() are the basis of UNIX process-switching, and they've
been in the kernel since Version 6 (1976?) and probably since the original
PDP-11 assembler implementation.  This pair are:
	void setjmp(jump buf)
	void longjmp(jump buf)

The user-library pair have been around for probably as long:
	int  setjmp(jump buf)
	void longmmp(jump buf, return val)

	switch (setjmp(jumpbuf)) {
		case 0: original
		case 1: abort
		default: panic, can't happen
	}

    abort:
	longjmp(jumpbuf, 1);

Setjmp() in the user library returns 0 for the setup call, and the
longjmp-supplied value when it comes back from a longjmp().
The kernel pair lacks this functionality.

Of course, better languages let you save off multiple running stacks
and resume them...
Technical Details
Message-ID: <1448@greek.csd.mot.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!usc!snorkelwacker!apple!motcsd!lance
References: <1990Aug31.190751.12522@dg-rtp.dg.com> <tim.652548167@Xsys>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!usc!snorkelwacker!apple!motcsd!lance
From: lance@motcsd.csd.mot.com (lance.norskog)
Newsgroups: comp.lang.misc,comp.unix.internals
Subject: Re: Unix error handling
Summary: Older than that, bucko!
Message-ID: <1448@greek.csd.mot.com>
Date: 10 Sep 90 23:27:17 GMT
References: <1990Aug31.190751.12522@dg-rtp.dg.com> <tim.652548167@Xsys>
Followup-To: comp.lang.misc
Distribution: usa
Organization: Motorola CSD, Cupertino CA
Lines: 26