diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-09-16 16:29:08 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-09-16 16:29:08 -0700 |
commit | e1513d5d07e0b78316414731c550d3248d09bd19 (patch) | |
tree | 37158094bb4987617860efdb1a47767cc7c397e0 | |
parent | 299884750e87e05c9d804e7f0fbcb08e02b37a8d (diff) | |
download | syslinux-e1513d5d07e0b78316414731c550d3248d09bd19.tar.gz syslinux-e1513d5d07e0b78316414731c550d3248d09bd19.tar.xz syslinux-e1513d5d07e0b78316414731c550d3248d09bd19.zip |
Add file missing from previous commitsyslinux-3.30-pre10
-rw-r--r-- | com32/lib/sys/screensize.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/com32/lib/sys/screensize.c b/com32/lib/sys/screensize.c new file mode 100644 index 00000000..5a0d5aeb --- /dev/null +++ b/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; +} |