diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-02-15 11:41:35 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-02-15 11:41:35 +1100 |
commit | 3c4a24c3e329ccca86629ed694b9756309b00113 (patch) | |
tree | 31d7a56074a06b4f25ab9514824806527313d5f1 /openbsd-compat/bsd-misc.c | |
parent | 4018dc04daa613d0e20df10947b85f154dc5765d (diff) |
- (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
Use getpgrp() if we don't have getpgid() (old BSDs, maybe others).
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 13 |
1 files changed, 13 insertions, 0 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 | ||