View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Mar 25, 2007 12:51 pm 
Offline
Joined: Tue Jul 25, 2006 12:47 am
Posts: 2
Location: Toronto, Canada
This is quite obscure. The following test program fails on my KnoppMyth R5E50 installation. It works on Debian sid, Fedora Core 6, and Ubuntu 6.06. It is an extract from a program that has worked on many systems for 15 years.

Any idea why it would fail? I think that this is a KnoppMyth bug.

The failure message is:
Code:
could not grantpt: 2 No such file or directory

An strace of the code shows:
Code:
stat64("/dev/pts/0", 0xbfec3cb4)        = -1 ENOENT (No such file or directory)

Here is the C test program:
Code:
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>

int
main(int argc, char **argv)
{
    int ptyfd = open("/dev/ptmx", O_RDWR);

    if (ptyfd < 0) {
        printf("could not open /dev/ptmx: %d %s\n", errno, strerror(errno));
    } else if (grantpt(ptyfd) <0) {
        printf("could not grantpt: %d %s\n", errno, strerror(errno));
    } else {
        printf("success\n");
    }
}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 25, 2007 3:05 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Most likely due to a change in the 2.6 kernel. http://www.ussg.iu.edu/hypermail/linux/kernel/0311.2/0502.html


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 25, 2007 5:00 pm 
Offline
Joined: Tue Jul 25, 2006 12:47 am
Posts: 2
Location: Toronto, Canada
tjc wrote:
Most likely due to a change in the 2.6 kernel. http://www.ussg.iu.edu/hypermail/linux/kernel/0311.2/0502.html
Well spotted.

On my KnoppMyth, mount does not report /dev as a mount point. It is neither in mtab nor in fstab. Its inode number is neither 1 nor 2. But it sure seems to be mounted. I can get grantpt working by issuing the following command:
Code:
mount -t devpts devpts /dev/pts

Does this mean that there are two bugs?
    (1) not mounting /dev/pts at the right time, and
    (2) mounting /dev in a way that confuses mount.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 25, 2007 9:57 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Why don't you just add that entry to /etc/fstab?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu