Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Nov 1998 08:14:35 -0800 (PST)
From:      David Wolfskill <dhw@whistle.com>
To:        hackers@FreeBSD.ORG, kpielorz@tdx.co.uk
Subject:   Re: Getting PID of parent pipe?
Message-ID:  <199811241614.IAA08037@pau-amma.whistle.com>
In-Reply-To: <36555721.8E3D2CDF@tdx.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Fri, 20 Nov 1998 11:48:49 +0000
>From: Karl Pielorz <kpielorz@tdx.co.uk>

>Is there an 'easy' way of getting the PID of a parent process feeding a
>command's stdin?

>e.g.

>cat something | foo | bar

>I need to get the PID of foo while running as bar...

If "bar" is something you can control/modify, it would seem that
getppid() would be an appropriate tool.

david
-- 
David Wolfskill		UNIX System Administrator
dhw@whistle.com		voice: (650) 577-7158	pager: (650) 371-4621

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811241614.IAA08037>