Skip to content

Commit 9a9a41d

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 85cb890 commit 9a9a41d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compat/mingw.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ static inline unsigned int alarm(unsigned int seconds)
9898
{ return 0; }
9999
static inline int fsync(int fd)
100100
{ return _commit(fd); }
101-
static inline pid_t getppid(void)
102-
{ return 1; }
103101
static inline void sync(void)
104102
{}
105103
static inline uid_t getuid(void)
@@ -121,6 +119,12 @@ static inline int sigaddset(sigset_t *set, int signum)
121119
#define SIG_UNBLOCK 0
122120
static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
123121
{ 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(); }
124128

125129
/*
126130
* simple adaptors

0 commit comments

Comments
 (0)