GNU libc has the <pty.h> header and the openpty function on both Linux and Hurd. Programs should use that.