aboutsummaryrefslogtreecommitdiff
path: root/win32/ioctl.c
blob: 73ceeedeca289a78ef03df0878f79fdaa158f111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "libbb.h"

int ioctl(int fd UNUSED_PARAM, int code, ...)
{
	va_list ap;
	void *arg;
	int ret = -1;

	va_start(ap, code);

	switch (code) {
	case TIOCGWINSZ:
		arg = va_arg(ap, void *);
		ret = winansi_get_terminal_width_height((struct winsize *)arg);
		break;
	default:
		ret = -1;
		errno = EINVAL;
		break;
	}

	va_end(ap);
	return ret;
}