[BACK]Return to waitpid.c CVS log [TXT][DIR] Up to [local] / ircnowd / src / portab

File: [local] / ircnowd / src / portab / waitpid.c (download)

Revision 1.1, Thu May 16 11:07:06 2024 UTC (4 months ago) by tomglok
Branch point for: MAIN

Initial revision

/*
 * ngIRCd -- The Next Generation IRC Daemon
 */

#include "portab.h"

/**
 * @file
 * waitpid() implementation. Public domain.
 * Written by Steven D. Blackford for the NeXT system.
 */

#ifndef HAVE_WAITPID

#include <string.h>
#include <stdlib.h>
#include <sys/types.h>

GLOBAL int
waitpid(pid, stat_loc, options)
int pid, *stat_loc, options;
{
	for (;;) {
		int wpid = wait(stat_loc);
		if (wpid == pid || wpid == -1)
			return wpid;
	}
}

#endif