repo.or.cz
/
syslinux-debian
/
hramrach.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Adding upstream version 6.02~pre8+dfsg.
[syslinux-debian/hramrach.git]
/
com32
/
lib
/
sys
/
screensize.c
blob
bcd4496c05a8b07dfd9271fab6c0cbf6cc1f7e04
1
#include <unistd.h>
2
#include <errno.h>
3
#include
"file.h"
4
5
int
getscreensize
(
int
fd
,
int
*
rows
,
int
*
cols
)
6
{
7
struct
file_info
*
fp
= &
__file_info
[
fd
];
8
9
if
(
fd
>=
NFILES
|| !
fp
->
iop
) {
10
errno
=
EBADF
;
11
return
-
1
;
12
}
13
14
*
rows
=
fp
->
o
.
rows
;
15
*
cols
=
fp
->
o
.
cols
;
16
17
if
(!*
rows
|| !*
cols
) {
18
errno
=
ENOTTY
;
19
return
-
1
;
20
}
21
22
return
0
;
23
}