Rich,
Take a look at this excerpt from the telnetd I use:
getpty(char *line)
{
int p;
#ifdef HAVE_DEVPTS_FS
p = open("/dev/ptmx", 2);
if (p > 0) {
grantpt(p);
unlockpt(p);
strcpy(line, ptsname(p));
return(p);
}
#else
I had to define the HAVE_DEVPTS_FS by hand before it would work.