Skip to content

Commit

Permalink
compat/mingw: stubs for getpgid() and tcgetpgrp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Apr 15, 2015
1 parent 85cb890 commit 9a9a41d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 9a9a41d

Please sign in to comment.