Adding upstream version 3.50~pre5.
[syslinux-debian/hramrach.git] / com32 / lib / sys / screensize.c
blob5a0d5aeb71b75448d1a733935e04045cf93b6b94
1 #include <unistd.h>
2 #include <errno.h>
3 #include "file.h"
5 int getscreensize(int fd, int *rows, int *cols)
7 struct file_info *fp = &__file_info[fd];
9 if ( fd >= NFILES || !fp->iop ) {
10 errno = EBADF;
11 return -1;
14 *rows = fp->o.rows;
15 *cols = fp->o.cols;
17 if (!rows || !cols) {
18 errno = ENOTTY;
19 return -1;
22 return 0;