crontab (UNIX system V)

jab at uokvax.UUCP jab at uokvax.UUCP
Thu Sep 27 12:05:00 AEST 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



More information about the Comp.lang.c mailing list