All pastes #409445 Raw Edit

grantpt failure

public c v1 · immutable
#409445 ·published 2007-03-25 18:27 UTC
rendered paste body
#include <stdio.h>#include <unistd.h>#include <errno.h>#include <fcntl.h>intmain(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");    }}