summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2015-04-15 20:29:30 +0200
committerJunio C Hamano <gitster@pobox.com>2015-04-15 11:50:34 -0700
commit9a9a41db83052b674b89c084e4ac8c1458f7b11e (patch)
treeace6b94c35487e107ed340a8f83b76da19490b51
parent85cb8906f0e9b5639230fe247d5d916db8806777 (diff)
downloadgit-9a9a41db83052b674b89c084e4ac8c1458f7b11e.tar.gz
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>
-rw-r--r--compat/mingw.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 5e499cfb71..98c5e44294 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -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