summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/com32/lib/sys/screensize.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syslinux-4.02/com32/lib/sys/screensize.c')
-rw-r--r--contrib/syslinux-4.02/com32/lib/sys/screensize.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/lib/sys/screensize.c b/contrib/syslinux-4.02/com32/lib/sys/screensize.c
new file mode 100644
index 0000000..340227c
--- /dev/null
+++ b/contrib/syslinux-4.02/com32/lib/sys/screensize.c
@@ -0,0 +1,23 @@
+#include <unistd.h>
+#include <errno.h>
+#include "file.h"
+
+int getscreensize(int fd, int *rows, int *cols)
+{
+ struct file_info *fp = &__file_info[fd];
+
+ if (fd >= NFILES || !fp->iop) {
+ errno = EBADF;
+ return -1;
+ }
+
+ *rows = fp->o.rows;
+ *cols = fp->o.cols;
+
+ if (!rows || !cols) {
+ errno = ENOTTY;
+ return -1;
+ }
+
+ return 0;
+}