summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--openbsd-compat/bsd-misc.c15
-rw-r--r--openbsd-compat/bsd-misc.h6
3 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e60f6c87..884d1a636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@
23 replace 4 clause BSD licensed progressmeter code with a replacement 23 replace 4 clause BSD licensed progressmeter code with a replacement
24 from Nils Nordman and myself; ok deraadt@ 24 from Nils Nordman and myself; ok deraadt@
25 (copied from OpenBSD an re-applied portable changes) 25 (copied from OpenBSD an re-applied portable changes)
26 - (dtucker) [openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
27 Add a tcgetpgrp function.
26 28
2720030730 2920030730
28 - (djm) [auth-pam.c] Don't use crappy APIs like sprintf. Thanks bal 30 - (djm) [auth-pam.c] Don't use crappy APIs like sprintf. Thanks bal
@@ -761,4 +763,4 @@
761 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 763 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
762 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 764 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
763 765
764$Id: ChangeLog,v 1.2872 2003/08/02 13:28:38 dtucker Exp $ 766$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 @@
25#include "includes.h" 25#include "includes.h"
26#include "xmalloc.h" 26#include "xmalloc.h"
27 27
28RCSID("$Id: bsd-misc.c,v 1.13 2003/05/18 14:13:39 djm Exp $"); 28RCSID("$Id: bsd-misc.c,v 1.14 2003/08/02 13:31:42 dtucker Exp $");
29 29
30/* 30/*
31 * NB. duplicate __progname in case it is an alias for argv[0] 31 * 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)
167 167
168#endif 168#endif
169 169
170#ifndef HAVE_TCGETPGRP
171pid_t
172tcgetpgrp(int fd)
173{
174 int result, ctty_pgrp;
175
176 if (ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) == -1)
177 return(-1);
178 else
179 return(ctty_pgrp);
180}
181#endif /* HAVE_TCGETPGRP */
182
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 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25/* $Id: bsd-misc.h,v 1.8 2003/05/18 14:13:39 djm Exp $ */ 25/* $Id: bsd-misc.h,v 1.9 2003/08/02 13:31:42 dtucker Exp $ */
26 26
27#ifndef _BSD_MISC_H 27#ifndef _BSD_MISC_H
28#define _BSD_MISC_H 28#define _BSD_MISC_H
@@ -89,4 +89,8 @@ struct timespec {
89int nanosleep(const struct timespec *, struct timespec *); 89int nanosleep(const struct timespec *, struct timespec *);
90#endif 90#endif
91 91
92#ifndef HAVE_TCGETPGRP
93pid_t tcgetpgrp(int);
94#endif /* HAVE_TCGETPGRP */
95
92#endif /* _BSD_MISC_H */ 96#endif /* _BSD_MISC_H */