compat/mingw: stubs for getpgid() and tcgetpgrp()
authorJohannes Sixt <j6t@kdbg.org>
Wed, 15 Apr 2015 18:29:30 +0000 (20:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Apr 2015 18:50:34 +0000 (11:50 -0700)
Windows does not have process groups. It is, therefore, the simplest
to pretend that each process is in its own process group.

While here, move the getppid() stub from its old location (between
two sync related functions) next to the two new functions.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.h
index 5e499cfb71a00ea81013c1ed21e9a5e9dc9e2544..98c5e44294cd1f41d5b177b8d4be5219066c2dcd 100644 (file)
@@ -98,8 +98,6 @@ static inline unsigned int alarm(unsigned int seconds)
 { return 0; }
 static inline int fsync(int fd)
 { return _commit(fd); }
-static inline pid_t getppid(void)
-{ return 1; }
 static inline void sync(void)
 {}
 static inline uid_t getuid(void)
@@ -121,6 +119,12 @@ static inline int sigaddset(sigset_t *set, int signum)
 #define SIG_UNBLOCK 0
 static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
 { return 0; }
+static inline pid_t getppid(void)
+{ return 1; }
+static inline pid_t getpgid(pid_t pid)
+{ return pid == 0 ? getpid() : pid; }
+static inline pid_t tcgetpgrp(int fd)
+{ return getpid(); }
 
 /*
  * simple adaptors