X throws errors when calling forkpty. (C ++)

When my program falls into this line:

pid_t nPid = forkpty( &m_nMasterFD, NULL, NULL, NULL );

Outputs the following:

X Error: BadIDChoice (invalid resource ID chosen for this connection) 14
  Extension:    148 (RENDER)
  Minor opcode: 17 (RenderCreateGlyphSet)
  Resource id:  0x3600002
<unknown>: Fatal IO error 4 (Interrupted system call) on X server :0.0.

And ends. As you can see, I'm trying to run pty to run files, but it does not work.

Also, is there a way forkpty()in the class? (I tried in both directions, but didn't work.)

I am programming in QT C ++ on Ubuntu 9.10.

EDIT: Here is a link to a question with code that finally worked for me.

+3
source share
1 answer

forkpty() . filedescriptors, X . , , , forkpty, openpty(), fork(), filedescriptors , logintty/()

+1

Source: https://habr.com/ru/post/1730698/


All Articles