ITEM: K1281L
strconf and ioctl problems.
Question:
When you use the ioctl command in a 'C' program it gives you a
return value of 1 and dbx reveals it is error 22 as an invalid
argument.
The testcase follows:
.................................................................
\#include \
\#include \
\#include \
\#include \
\#include \
\#include \
\#include \
\#include \
main(int argc,char *argv[], char *envp[]) {
int fd,ret;
char *t;
t = ttyname(0);
printf("device name: %s0,t);
if ((fd = open(t,O_RDWR)) \< 0)
exit(-1);
ret = ioctl(fd, I_LIST, 0);
printf("return code from ioctl = %d, errno = %d0, ret, errno);
close(fd); }
......................................................................
Answer:
The problem is being caused by the ioctl you are trying to perform.
It is an ioctl for a streams based i/o stream, which the tty subsystem
in AIX 3.2.x is not. Given that, it is perfectly appropriate for
EINVAL to be returned.
HR
CENTER
FONT size=2Support Line: strconf and ioctl problems. ITEM: K1281L
BRDated: September 1994 Category: N/A
BRThis HTML file was generated 99/06/24~13:30:42
BRComments or suggestions?
A href="../../../../feedback.htm"BContact us/B/ABR
/FONT
/CENTER
/BODY
/HTML