#include <sysexits.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <fetch.h>
#define MINBUFSIZE 4096
{
struct timeval now;
static pid_t pgrp = -1;
int ctty_pgrp;
if (pgrp == -1)
pgrp = getpgrp();
/*
* do not print display (ie return) if we're not foreground process
*/
if (ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) == -1 ||
ctty_pgrp != (int)pgrp)
return;
if (!v_tty || !v_level)