#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include <errno.h>
#include <sys/wait.h>

int
main(int argc, char *argv[])
{
    int status;

    if (wait(&status) == -1) {
        printf("status after a failed wait() = %d\n", WEXITSTATUS(status));
        printf("ECHILD=%s\n", strerror(ECHILD));
        err(EXIT_FAILURE, "wait");
    }

    exit(EXIT_SUCCESS);
}
