Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: $Revision: 1.6.2.16 $; site uokvax.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!inuxc!pur-ee!uiucdcs!uokvax!jab
From: jab@uokvax.UUCP
Newsgroups: net.lang.c
Subject: Re: crontab (UNIX system V)
Message-ID: <3000038@uokvax.UUCP>
Date: Wed, 26-Sep-84 22:05:00 EDT
Article-I.D.: uokvax.3000038
Posted: Wed Sep 26 22:05:00 1984
Date-Received: Fri, 28-Sep-84 06:42:24 EDT
References: <784@eisx.UUCP>
Lines: 16
Nf-ID: #R:eisx:-78400:uokvax:3000038:000:510
Nf-From: uokvax!jab    Sep 26 21:05:00 1984

/***** uokvax:net.lang.c / eisx!jlk /  3:57 am  Sep 22, 1984 */

	Can anyone tell me how I can determine from within a C program
whether that program is being executed via the 'cron' or not ?
/* ---------- */

If you're very, very lucky, "cron" is run from "/etc/rc" and as a result,
doesn't have a controlling tty. As a result, "/dev/tty" won't make sense,
so an
	open("/dev/tty", 1)
should fail with some version-specific error. (For example, on the 4.1c system
I'm on, it's ENXIO.)

	Jeff Bowles
	Lisle, IL