All pastes #209585 Raw Edit

Anonymous

public text v1 · immutable
#209585 ·published 2006-10-19 07:24 UTC
rendered paste body
if (pid != 0) {

				/* Parent */

				if (and) {

					if (pid == -1)
						/* For mange prossesser */

						printf("Error: Max processes\n");

					else {

						printf("returned child PID=%d\n", pid);
						if (alive(pid)) addProcess(pid, param);

					}

				} else {

					#ifdef DEBUG
						fprintf(stderr, "\tForeldre sovner...\n");
					#endif

					n = wait(&status);

					#ifdef DEBUG
						fprintf(stderr, "\tForeldre våkner...\n");
					#endif
				}

			} else {

				/* Child */

				#ifdef DEBUG
					fprintf(stderr, "\tBarn overtar...\n");
				#endif

				execve(sti, param, environ);

				printf("ifish: %s: command not found\n", param[0]);
				#ifdef DEBUG
					fprintf(stderr, "\tBarn termineres...\n");
				#endif
				exit(0);
			}