General
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with launching pseudo terminal..

shirish11
Advisor

Problem with launching pseudo terminal..

Getting errors while executing the attached program
ERRORs:-

first got this device busy
second got this Cannot get the slave name

O/S-> HP-UX 11.23 (on IA platform)

same program executed with another OS its working fine..
2 REPLIES
Steven Schweda
Honored Contributor

Re: Problem with launching pseudo terminal..

> first got this device busy

Well, duh.

> if ((fdm = open("/dev/ptmx", O_RDWR)) < 0){
> printf("device busy");
> return(-1);
> }

With code this lame, _any_ problem opening
that file will lead to a "device busy"
message. (Interesting placement of "\n",
too.)

man open
man errno

> second got this Cannot get the slave name

"second" after you did what?

> [...] with another OS it[']s working fine..

_Which_ "another OS"?

Other than the horrible message format, it
seems to work on my system:

dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license

dyi # cc -o 363230 363230.c
"363230.c", line 42: warning #2940-D: missing return statement at end of
non-void function "ptym_open"
}
^

dyi # ./363230
starting
slave names = /dev/pts/1

enddyi #


You might start with:
ls -l /dev/ptmx
shirish11
Advisor

Re: Problem with launching pseudo terminal..

Thanks