usr.bin/mail/cmd2.c
/*
 * Interactively dump core on "core"
 */
Interactively dump core on "core"
Interactively dump core on " core "
int
core()
{
	int pid;
	extern union wait wait_status;
	switch (pid = vfork()) {
	case -1:
		perror("fork");
		return(1);
	case 0:
		abort();
		_exit(1);
	}
	printf("Okie dokie");
	fflush(stdout);
	wait_child(pid);
	if (wait_status.w_coredump)
		printf(" -- Core dumped.\n");
	else
		printf(" -- Can't dump core.\n");
	return 0;
}
int core ( ) { int pid ; extern union wait wait_status ; switch ( pid = vfork ( ) ) { case -1 : perror ( " " ) ; return ( 1 ) ; case 0 : abort ( ) ; _exit ( 1 ) ; } printf ( " " ) ; fflush ( stdout ) ; wait_child ( pid ) ; if ( wait_status . w_coredump ) printf ( " \n " ) ; else printf ( " \n " ) ; return 0 ; }
Interactively dump core on "core"
Interactively dump core on " core "