diff --git a/ChangeLog b/ChangeLog index 5e60f6c87..884d1a636 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ 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 @@ -761,4 +763,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2872 2003/08/02 13:28:38 dtucker Exp $ +$Id: ChangeLog,v 1.2873 2003/08/02 13:31:42 dtucker Exp $ diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index cdc63c24d..64de6945c 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -25,7 +25,7 @@ #include "includes.h" #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.13 2003/05/18 14:13:39 djm Exp $"); +RCSID("$Id: bsd-misc.c,v 1.14 2003/08/02 13:31:42 dtucker Exp $"); /* * NB. duplicate __progname in case it is an alias for argv[0] @@ -167,3 +167,16 @@ int nanosleep(const struct timespec *req, struct timespec *rem) #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 */ + diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 00e508cfc..03a1f3af0 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: bsd-misc.h,v 1.8 2003/05/18 14:13:39 djm Exp $ */ +/* $Id: bsd-misc.h,v 1.9 2003/08/02 13:31:42 dtucker Exp $ */ #ifndef _BSD_MISC_H #define _BSD_MISC_H @@ -89,4 +89,8 @@ struct timespec { int nanosleep(const struct timespec *, struct timespec *); #endif +#ifndef HAVE_TCGETPGRP +pid_t tcgetpgrp(int); +#endif /* HAVE_TCGETPGRP */ + #endif /* _BSD_MISC_H */