diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 13 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 3ef373f56..0cff2e423 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -247,3 +247,16 @@ int isblank(int c) | |||
247 | return (c == ' ' || c == '\t'); | 247 | return (c == ' ' || c == '\t'); |
248 | } | 248 | } |
249 | #endif | 249 | #endif |
250 | |||
251 | #ifndef HAVE_GETPGID | ||
252 | pid_t | ||
253 | getpgid(pid_t pid) | ||
254 | { | ||
255 | #ifdef HAVE_GETPGRP | ||
256 | if (pid == 0) | ||
257 | return getpgrp(); | ||
258 | #endif | ||
259 | errno = ESRCH; | ||
260 | return -1; | ||
261 | } | ||
262 | #endif | ||
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index eac5217ca..de8367386 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: bsd-misc.h,v 1.21 2012/07/03 22:50:10 dtucker Exp $ */ | 1 | /* $Id: bsd-misc.h,v 1.22 2013/02/15 00:41:36 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> | 4 | * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> |
@@ -102,4 +102,8 @@ mysig_t mysignal(int sig, mysig_t act); | |||
102 | int isblank(int); | 102 | int isblank(int); |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | #ifndef HAVE_GETPGID | ||
106 | pid_t getpgid(pid_t); | ||
107 | #endif | ||
108 | |||
105 | #endif /* _BSD_MISC_H */ | 109 | #endif /* _BSD_MISC_H */ |