Add a tcgetpgrp function.
replace 4 clause BSD licensed progressmeter code with a replacement
from Nils Nordman and myself; ok deraadt@
(copied from OpenBSD an re-applied portable changes)
+ - (dtucker) [openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
+ Add a tcgetpgrp function.
20030730
- (djm) [auth-pam.c] Don't use crappy APIs like sprintf. Thanks bal
#endif
+#ifndef HAVE_TCGETPGRP
+pid_t
+tcgetpgrp(int fd)
+{
+ int result, ctty_pgrp;
+
+ if (ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) == -1)
+ return(-1);
+ else
+ return(ctty_pgrp);
+}
+#endif /* HAVE_TCGETPGRP */
+
int nanosleep(const struct timespec *, struct timespec *);
#endif
+#ifndef HAVE_TCGETPGRP
+pid_t tcgetpgrp(int);
+#endif /* HAVE_TCGETPGRP */
+
#endif /* _BSD_MISC_H */