1 0 stevel /* 2 0 stevel * CDDL HEADER START 3 0 stevel * 4 0 stevel * The contents of this file are subject to the terms of the 5 4774 as145665 * Common Development and Distribution License (the "License"). 6 4774 as145665 * You may not use this file except in compliance with the License. 7 0 stevel * 8 0 stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 0 stevel * or http://www.opensolaris.org/os/licensing. 10 0 stevel * See the License for the specific language governing permissions 11 0 stevel * and limitations under the License. 12 0 stevel * 13 0 stevel * When distributing Covered Code, include this CDDL HEADER in each 14 0 stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 0 stevel * If applicable, add the following below this CDDL HEADER, with the 16 0 stevel * fields enclosed by brackets "[]" replaced with your own identifying 17 0 stevel * information: Portions Copyright [yyyy] [name of copyright owner] 18 0 stevel * 19 0 stevel * CDDL HEADER END 20 0 stevel */ 21 0 stevel /* 22 11115 Nobutomo * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 0 stevel * Use is subject to license terms. 24 0 stevel */ 25 0 stevel 26 0 stevel #ifndef _CRON_H 27 0 stevel #define _CRON_H 28 0 stevel 29 0 stevel /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 30 0 stevel /* All Rights Reserved */ 31 0 stevel 32 0 stevel #ifdef __cplusplus 33 0 stevel extern "C" { 34 0 stevel #endif 35 0 stevel 36 0 stevel #define FALSE 0 37 0 stevel #define TRUE 1 38 0 stevel #define MINUTE 60L 39 0 stevel #define HOUR 60L*60L 40 0 stevel #define DAY 24L*60L*60L 41 0 stevel #define NQUEUE 26 /* number of queues available */ 42 0 stevel #define ATEVENT 0 43 0 stevel #define BATCHEVENT 1 44 0 stevel #define CRONEVENT 2 45 0 stevel 46 0 stevel #define ADD 'a' 47 0 stevel #define DELETE 'd' 48 0 stevel #define AT 'a' 49 0 stevel #define CRON 'c' 50 11115 Nobutomo #define REFRESH 'r' 51 0 stevel 52 0 stevel #define QUE(x) ('a'+(x)) 53 0 stevel #define RCODE(x) (((x)>>8)&0377) 54 0 stevel #define TSTAT(x) ((x)&0377) 55 0 stevel 56 0 stevel #define FLEN 15 57 0 stevel #define LLEN 9 58 0 stevel 59 0 stevel /* 60 0 stevel * structure used for passing messages from the at and crontab commands to cron 61 0 stevel */ 62 0 stevel struct message { 63 0 stevel char etype; 64 0 stevel char action; 65 0 stevel char fname[FLEN]; 66 0 stevel char logname[LLEN]; 67 11115 Nobutomo }; 68 0 stevel 69 0 stevel /* anything below here can be changed */ 70 0 stevel 71 0 stevel #define CRONDIR "/var/spool/cron/crontabs" 72 0 stevel #define ATDIR "/var/spool/cron/atjobs" 73 0 stevel #define ACCTFILE "/var/cron/log" 74 0 stevel #define CRONALLOW "/etc/cron.d/cron.allow" 75 0 stevel #define CRONDENY "/etc/cron.d/cron.deny" 76 0 stevel #define ATALLOW "/etc/cron.d/at.allow" 77 0 stevel #define ATDENY "/etc/cron.d/at.deny" 78 0 stevel #define PROTO "/etc/cron.d/.proto" 79 0 stevel #define QUEDEFS "/etc/cron.d/queuedefs" 80 0 stevel #define FIFO "/etc/cron.d/FIFO" 81 0 stevel #define DEFFILE "/etc/default/cron" 82 0 stevel 83 0 stevel #define SHELL "/usr/bin/sh" /* shell to execute */ 84 0 stevel 85 8439 Chris #define ENV_SHELL "SHELL=" 86 8439 Chris #define ENV_TZ "TZ=" 87 8439 Chris #define ENV_HOME "HOME=" 88 8439 Chris 89 0 stevel #define CTLINESIZE 1000 /* max chars in a crontab line */ 90 0 stevel #define UNAMESIZE 20 /* max chars in a user name */ 91 0 stevel 92 11115 Nobutomo extern int allowed(char *, char *, char *); 93 11115 Nobutomo extern int days_in_mon(int, int); 94 11115 Nobutomo extern char *errmsg(int); 95 11115 Nobutomo extern char *getuser(uid_t); 96 11115 Nobutomo extern void cron_sendmsg(char, char *, char *, char); 97 11115 Nobutomo extern time_t num(char **); 98 11115 Nobutomo extern void *xmalloc(size_t); 99 11115 Nobutomo extern void *xcalloc(size_t, size_t); 100 11115 Nobutomo extern char *xstrdup(const char *); 101 11115 Nobutomo extern int isvalid_shell(const char *shell); 102 11115 Nobutomo extern int isvalid_dir(const char *dir); 103 11115 Nobutomo 104 11115 Nobutomo extern int cron_admin(const char *); 105 0 stevel 106 0 stevel #ifdef __cplusplus 107 0 stevel } 108 0 stevel #endif 109 0 stevel 110 0 stevel #endif /* _CRON_H */ 111