compat/mingw: stubs for getpgid() and tcgetpgrp()
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>
Johannes Sixt committed
Apr 15, 2015 at 20:29 UTC
9a9a41db83052b674b89c084e4ac8c1458f7b11e
1 file changed
+6
-2
compat/mingw.h
+6
-2
@@ -98,8 +98,6 @@ static inline unsigned int alarm(unsigned int seconds)
98
{ return 0; }
99
static inline int fsync(int fd)
100
{ return _commit(fd); }
101
-static inline pid_t getppid(void)
102
-{ return 1; }
101
static inline void sync(void)
102
{}
103
static inline uid_t getuid(void)
@@ -121,6 +119,12 @@ static inline int sigaddset(sigset_t *set, int signum)
119
#define SIG_UNBLOCK 0
120
static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
121
{ return 0; }
122
+static inline pid_t getppid(void)
123
+{ return 1; }
124
+static inline pid_t getpgid(pid_t pid)
125
+{ return pid == 0 ? getpid() : pid; }
126
+static inline pid_t tcgetpgrp(int fd)
127
+{ return getpid(); }
128
129
/*
130
* simple adaptors