Add process group leader option
authorAlexey Spiridonov <lesha@fb.com>
Tue, 12 Aug 2014 19:24:40 +0000 (12:24 -0700)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 15:58:28 +0000 (07:58 -0800)
commit8a5fcb4f368ca65e0e55ee6efa530403a0903adf
treec1a6a40fe9172a7ca2e9acb280081582156a941d
parent136dd179602836cef909daece84b427a2ad46c54
Add process group leader option

Summary: Now a subprocess can be reliably made a group leader -- good for job control.

Test Plan:
unit test, checked that the pgid test worked in bash, too (only OKAY_XXX is printed)

==> XXX.sh <==
#!/bin/sh
test $(cut -d ' ' -f 5 /proc/$$/stat) == $$ && echo OKAY_XXX
./YYY.sh

==> YYY.sh <==
#!/bin/sh
test $(cut -d ' ' -f 5 /proc/$$/stat) == $$ && echo OKAY_YYY
./ZZZ.sh

==> ZZZ.sh <==
#!/bin/sh
test $(cut -d ' ' -f 5 /proc/$$/stat) == $$ && echo OKAY_ZZZ

Reviewed By: simpkins@fb.com

Subscribers: net-systems@, njormrod, folly-diffs@, simpkins

FB internal diff: D1492526

Signature: t1:1492526:1416528620:3cf98b1c1e334a7d551b2c2f3e76b1c70f07ad7c
folly/Subprocess.cpp
folly/Subprocess.h
folly/test/SubprocessTest.cpp