[uClibc] openpty failure due to major/minor missmatch?

Maillists maillists at gmx.ch
Mon Aug 22 08:00:03 UTC 2005


Hi,

I am still struggling with the pty devices on my system.
I try to open a pty device with openpty() and get ENOTTY returned. After 
following the the code in openpty() I found that somewhen in ptsname() 
the struct stat st gets filled by the fstat() function call and the 
st.st_rdev field checked against the MASTER_P macros (in ptsname.c).
What I get in st.st_rdev is 1282 which I suppose is major: 1282 /256 = 5 
minor: 1282%256 = 2 which would be /dev/ptmx.
According to  linux/Documenation/devices.txt major 5 and minor 2 for 
/dev/ptmx is ok. On the other hand the pty masters should have major 128 
to 135 and the slaves 136 to 143, according to devices.txt and also 
telling from the MASTER_P macro in ptsname.c.

Should I get a pty master with major 128 minor x when calling getpt() or 
should I get a pty master with major 5 minor 2 and the check MASTER_P in 
ptsname is incomplete?

remark: I still have both pty systems running on my target: /dev/ptmx 
and /dev/pty/m[0-255]. Maybe this is no good either?

Would appreciate any comments on that.

Roman



More information about the uClibc mailing list