fgetfdflags
error = fgetfdflags(p->p_fd, fd, &tmp);
int fgetfdflags(struct filedesc *fdp, int fd, int *flagsp);