git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat/mingw: stubs for getpgid() and tcgetpgrp()

From
Luke Mewburn <luke@mewburn.net>
Date
Apr 17, 2015, 01:25 UTC
Message-ID
<20150417012541.GI23475@mewburn.net>
In-Reply-To
<552EAE0A.3040208@kdbg.org>
On Wed, Apr 15, 2015 at 08:29:30PM +0200, Johannes Sixt wrote:
  | Windows does not have process groups. It is, therefore, the simplest
  | to pretend that each process is in its own process group.
  | 
  |  [...]
  | 
  | diff --git a/compat/mingw.h b/compat/mingw.h
  | index 7b523cf..a552026 100644
  | @@ -118,6 +116,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(); }

This appears to be similar to the approach that tcsh uses too; return the current process ID for the process group ID. See https://github.com/tcsh-org/tcsh/blob/master/win32/ntport.h for tcsh's implementation of getpgrp() (a variation of getpgid()) and tcgetpgrp().

regards, Luke.

Previous: Johannes SchindelinNext: Luke Mewburn
Message 17 of 20 in “reduce progress updates in background”
  1. reduce progress updates in backgroundLuke Mewburn, Apr 13, 2015
  2. Nicolas PitreApr 13, 2015
  3. Luke MewburnApr 13, 2015
  4. Nicolas PitreApr 13, 2015
  5. reduce progress updates in backgroundLuke Mewburn, Apr 14, 2015
  6. Nicolas PitreApr 14, 2015
  7. compat/mingw: stubs for getpgid() and tcgetpgrp()Johannes Sixt, Apr 15, 2015
  8. Junio C HamanoApr 15, 2015
  9. Johannes SixtApr 15, 2015
  10. Johannes SchindelinApr 16, 2015
  11. Junio C HamanoApr 16, 2015
  12. Erik Faye-LundApr 15, 2015
  13. Johannes SchindelinApr 16, 2015
  14. rupert thurnerApr 23, 2015
  15. rupert thurnerApr 24, 2015
  16. Johannes SchindelinApr 24, 2015
  17. Luke MewburnApr 17, 2015
  18. Luke MewburnApr 14, 2015
  19. brian m. carlsonApr 14, 2015
  20. Johannes SchindelinApr 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.