funcs.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 1988-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */
#include <fcntl.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <dirent.h>
#include <libintl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <tzfile.h>
#include "cron.h"
#define CANTCD "can't change directory to the at directory"
#define NOREADDIR "can't read the at directory"
#define YEAR 1900
extern int audit_cron_is_anc_name(char *);
{
time_t n = 0;
*ptr += 1; }
return (n);
}
{
/*
* calculate the number of "full" days in between
* NOTE: there should not be more than a year separation in the
* dates. also, m should be in 0 to 11, and d should be in 1 to 31.
*/
int days;
int m;
return (0);
/*
* In case of d2==29 ,d1==28 and m1==m2==Feb and year is not
* a leap year, this function should return the days till the
* the next Feb 29.See Bug 4257355.
*/
int p;
}
}
/* the remaining dates are on different months */
while (m != m2) {
if (m == 0)
y1++;
m = (m + 1) % 12;
}
return (days);
}
int
days_in_mon(int m, int y)
{
/*
* returns the number of days in month m of year y
* NOTE: m should be in the range 0 to 11
*/
}
void *
{
char *p;
perror("malloc");
exit(55);
}
return (p);
}
void
{
static int msgfd = -2;
int i;
if (msgfd == -2) {
" be running - call your system"
" administrator\n"));
else
"error in message queue open\n"));
return;
}
}
else if (i != sizeof (struct message))
"error in message send: Premature EOF\n"));
}
char
{
char *msg;
static char msgbuf[32];
return (msgbuf);
} else
return (msg);
}
int
{
char *p;
register char c;
(void) num(&p);
return (0); /* didn't start with a number */
if (*p++ != '.')
return (0); /* followed by a period */
c = *p++;
if (c < 'a' || c > 'z')
return (0); /* followed by a queue name */
return (0);
return (1);
}
/*
* Scan the directory dirname calling select to make a list of selected
* directory entries then sort using qsort and compare routine dcomp.
* Returns the number of entries and a pointer to a list of pointers to
* struct direct (through namelist). Returns -1 if there were any errors.
*/
#ifdef DIRSIZ
#endif
int
char *dirname;
int (*select)();
int (*dcomp)();
{
register int nitems;
long arraysz;
return (-1);
return (-1);
/*
* estimate the array size by taking the size of the directory file
* and dividing it by a multiple of the minimum size entry.
*/
return (-1);
nitems = 0;
continue; /* just selected names */
/*
* Make a minimum size copy of the data
*/
if (p == NULL)
return (-1);
/* p->d_namlen = d->d_namlen; */
/*
* Check to make sure the array has space left and
* realloc the maximum size.
*/
return (-1); /* just might have grown */
return (-1);
}
}
return (nitems);
}
void *
{
void *p;
perror("calloc");
exit(55);
}
return (p);
}