🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2212

I_halt()

#2212
From: Ronald BODKIN
Date: Thu, 22 Nov 1990 07:30
26 lines
1238 bytes
In article <8839:Nov2100:33:3990@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>> main(argc,argv) {
>> 	int I_halt();
>> 	if (I_halt(argv[0])) {
>> 		while(1);
>> 	} else {
>> 		exit(0);
>> 	}
>> }

>We are all aware that it is impossible for a fixed algorithm *within*
>machine M to solve the halting problem for machine M (provided that M is
>not utterly trivial). But the solution takes advantage of a new machine
>*outside* M...
	This is true, and was similar to my "serious answer" to the
question.  For a humourous(?) one:
int I_halt()
{
	int my_pid();
	FILE *fp;
	fp=fopen("/script", "w");
	fprintf(fp, "sleep 50\nkill -9 %d\n", my_pid());
	system("sh /script &");
	return 1;
}
/* flames about details to /dev/null */
Technical Details
Message-ID: <59@homer.cs.mcgill.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!quiche!homer!utility
References: <156@garth.UUCP> <1990Nov20.213454.10879@craycos.com> <8839:Nov2100:33:3990@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!quiche!homer!utility
From: utility@quiche.cs.mcgill.ca (Ronald BODKIN)
Newsgroups: comp.lang.misc
Subject: I_halt()
Message-ID: <59@homer.cs.mcgill.ca>
Date: 22 Nov 90 07:30:29 GMT
References: <156@garth.UUCP> <1990Nov20.213454.10879@craycos.com> <8839:Nov2100:33:3990@kramden.acf.nyu.edu>
Organization: SOCS - Mcgill University, Montreal, Canada
Lines: 26