/* Returns a refcounted instance of the pid struct for the process group controlling the tty.  */
struct pid* tty_get_pgrp(struct tty_struct *tty)
/* Returns a refcounted instance of the pid struct for the process group controlling the tty.  */
struct pid* tty_get_pgrp(struct tty_struct *tty)
{
	unsigned long flags;
	struct pid *pgrp;
	spin_lock_irqsave(&tty->ctrl_lock, flags);
	pgrp = get_pid(tty->pgrp);
	spin_unlock_irqrestore(&tty->ctrl_lock, flags);
	return pgrp;
}