DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦5f4692c89⟧ TextFile

    Length: 326 (0x146)
    Types: TextFile
    Notes: UNIX file
    Names: »system.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »unimenu/src/menu/system.c« 

TextFile

/*
 * @(#)system.c	1.2 15:38:46 4/6/85
 * a version of the stdio system function
 */

system(str)
char	*str;
{
int	i;
int	pid;

	if ( (pid = fork()) )
	{
		if ( pid < 0 )
			return (-1);	/* fork failed */

		while ( (i = wait(0)) != pid && i != -1)
		;
	}
	else
	{
		execl("/bin/sh", "sh", "-c", str, 0);
		_exit(-1);
	}
}