summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fileno_unlocked.c
blob: a34906867481265a42f11811a65a0c3c3558249a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <__stdio.h>
#include <errno.h>
#include <stdio.h>

int fileno_unlocked(FILE *stream)
{
	if (stream->fd < 0) {
		errno = EBADF;
		return -1;
	}

	return stream->fd;
}