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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: pgpFVz4C16Wdc.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]