summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/pclose.c
blob: daae5bf56c0ffa2d6fb3b11abc6d6de651739ed8 (plain)
1
2
3
4
5
6
7
8
9
10
#include <io.h>
#include <stdio.h>
#include <sys/wait.h>

int pclose(FILE *stream)
{
	int stat;
	fclose(stream);
	return (waitpid(stream->pid, &stat, 0) < 0) ? -1 : stat;
}