jboolean islink = JNI_FALSE;
int i;
struct timeval tv0, tv1;
- struct timezone tz;
/*memset(target, 0, FILENAME_MAX);*/
return JNI_FALSE;
}
- gettimeofday(&tv0, &tz);
+ gettimeofday(&tv0, NULL);
if ((strcmp(dirName, "/afs") == 0) || (strcmp(dirName, "/afs/") == 0)) {
rc = 1; /* special case for /afs since statmountpoint fails on it */
} else {
rc = uafs_statmountpoint(dirName);
- gettimeofday(&tv1, &tz);
+ gettimeofday(&tv1, NULL);
sub_time(&tv1, &tv0);
/*printf("%s: statmountpoint %d.%06d\n", dirName, tv1.tv_sec, tv1.tv_usec);*/
}
extern struct deviceSyncNode *deviceLatch;
extern char globalCellName[];
struct timeval tp;
-struct timezone tzp;
/* forward declaration */
afs_int32 readVolumeHeader(char *, afs_int32, struct volumeHeader *);
struct butm_tapeLabel *tapeLabel)
{
struct timeval tp;
- struct timezone tzp;
afs_uint32 size;
memset(tapeLabel, 0, sizeof(struct butm_tapeLabel));
} else {
size = 0; /* no tape size */
}
- gettimeofday(&tp, &tzp);
+ gettimeofday(&tp, NULL);
tapeLabel->structVersion = CUR_TAPE_VERSION;
tapeLabel->creationTime = tp.tv_sec;
{
Date expiration;
struct timeval tp;
- struct timezone tzp;
expiration = ExpirationDate(tapeLabelPtr->dumpid);
if (!expiration)
expiration = tapeLabelPtr->expirationDate;
- gettimeofday(&tp, &tzp);
+ gettimeofday(&tp, NULL);
return ((expiration < tp.tv_sec) ? 1 : 0);
}
char tapeName[BU_MAXTAPELEN];
char strlevel[5];
struct timeval tp;
- struct timezone tzp;
afs_int32 curTime;
int tapecount = 1;
*/
else {
/* Check the tape's expiration date. Use the expiration on the label */
- gettimeofday(&tp, &tzp);
+ gettimeofday(&tp, NULL);
curTime = tp.tv_sec;
if (curTime < oldTapeLabel.expirationDate) {
TLog(taskId, "This tape has not expired\n");
}
memset(&label, 0, sizeof(label));
- gettimeofday(&tp, 0);
+ gettimeofday(&tp, NULL);
label.structVersion = CUR_TAPE_VERSION;
label.creationTime = tp.tv_sec;
label.size = info.tapeSize;
char *symbol;
if (!gensym_n) {
struct timeval tv;
- gettimeofday(&tv, (void *)0);
+ gettimeofday(&tv, NULL);
gensym_n = (tv.tv_sec % 10000) * 100 + tv.tv_usec / 10000;
}
symbol = (char *)malloc(32 * sizeof(char));
int i;
afs_int32 to;
- gettimeofday(&time, 0);
+ gettimeofday(&time, NULL);
bit = (random_value[3] >> 31) & 1; /* get high bit of high word */
for (i = 0; i < 4; i++) {
nbit = random_value[i] >> 31;
struct ktc_encryptionKey key;
int code;
- gettimeofday((struct timeval *)&key, 0); /* this is just a cheap seed key */
+ gettimeofday((struct timeval *)&key, NULL); /* this is just a cheap seed key */
DES_set_odd_parity(ktc_to_cblock(&key));
DES_init_random_number_generator(ktc_to_cblock(&key));
if ((code = DES_new_random_key(ktc_to_cblock(&key)))
{
va_list args;
struct timeval now;
- struct timezone tz;
struct tm *ltime;
time_t tt;
int code;
PROCESS pid;
extern char *program;
- code = gettimeofday(&now, &tz);
+ code = gettimeofday(&now, NULL);
assert(code == 0);
tt = now.tv_sec;
(struct sockaddr *)&taddr, sizeof(struct sockaddr_in));
/* see if there's a packet available */
- gettimeofday(&tv_wake,0);
+ gettimeofday(&tv_wake, NULL);
tv_wake.tv_sec += waitTime;
for (;;) {
FD_ZERO(&imask);
FD_SET(socket, &imask);
tv_delta.tv_sec = tv_wake.tv_sec;
tv_delta.tv_usec = tv_wake.tv_usec;
- gettimeofday(&tv_now, 0);
+ gettimeofday(&tv_now, NULL);
if (tv_delta.tv_usec < tv_now.tv_usec) {
/* borrow */
struct timeval tv;
long temp;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, NULL);
temp = ((tv.tv_sec & 0xffff) * 1000) + (tv.tv_usec / 1000);
return temp;
}
int i;
fc_keysched(key1, sched);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 1000000; i++)
fc_keysched(key1, sched);
- gettimeofday(&stop, 0);
+ gettimeofday(&stop, NULL);
printf("fc_keysched = %2.2f us\n",
(stop.tv_sec - start.tv_sec +
(stop.tv_usec - start.tv_usec) / 1e6) * 1);
fc_ecb_encrypt(data, data, sched, ENCRYPT);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 1000000; i++)
fc_ecb_encrypt(data, data, sched, ENCRYPT);
gettimeofday(&stop, 0);
fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv,
ENCRYPT);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 100000; i++)
fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv,
ENCRYPT);
- gettimeofday(&stop, 0);
+ gettimeofday(&stop, NULL);
printf("fc_cbc_encrypt = %2.2f us\n",
(stop.tv_sec - start.tv_sec +
(stop.tv_usec - start.tv_usec) / 1e6) * 10);
int i;
fc_keysched((struct ktc_encryptionKey *)key1, sched);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 1000000; i++)
fc_keysched((struct ktc_encryptionKey *)key1, sched);
- gettimeofday(&stop, 0);
+ gettimeofday(&stop, NULL);
printf("fc_keysched = %2.2f us\n",
(stop.tv_sec - start.tv_sec +
(stop.tv_usec - start.tv_usec) / 1e6) * 1);
fc_ecb_encrypt(data, data, sched, ENCRYPT);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 1000000; i++)
fc_ecb_encrypt(data, data, sched, ENCRYPT);
- gettimeofday(&stop, 0);
+ gettimeofday(&stop, NULL);
printf("fc_ecb_encrypt = %2.2f us\n",
(stop.tv_sec - start.tv_sec +
(stop.tv_usec - start.tv_usec) / 1e6) * 1);
fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv,
ENCRYPT);
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
for (i = 0; i < 100000; i++)
fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv,
ENCRYPT);
- gettimeofday(&stop, 0);
+ gettimeofday(&stop, NULL);
printf("fc_cbc_encrypt = %2.2f us\n",
(stop.tv_sec - start.tv_sec +
(stop.tv_usec - start.tv_usec) / 1e6) * 10);
ftime(void)
{
struct timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, NULL);
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}
int filesz = 0;
int ch, blksize, bytesremaining, bytes;
struct timeval start, finish;
- struct timezone tz;
struct rx_securityClass *ssc = 0, *dsc = 0;
int sscindex, dscindex;
struct rx_connection *sconn = NULL, *dconn = NULL;
scall = rx_NewCall(sconn);
if (!dlcl && !unlock)
dcall = rx_NewCall(dconn);
- gettimeofday(&start, &tz);
+ gettimeofday(&start, NULL);
if (unlock) {
if (fst.lockCount) {
printf("Sending 1 unlock for %s (%d locks)\n", srcf, fst.lockCount);
if (storecode)
printf("Error returned from store: %s\n", afs_error_message(storecode));
Finish:
- gettimeofday(&finish, &tz);
+ gettimeofday(&finish, NULL);
if (!slcl) {
theFids.AFSCBFids_len = 1;
static struct timeval starttime, opentime, readtime, writetime;
afs_uint64 xfered=0, oldxfered=0;
static struct timeval now;
-struct timezone Timezone;
static float seconds, datarate, oldseconds;
extern int rxInitDone;
#ifdef AFS_NT40_ENV
CBServiceNeeded = 1;
InitializeCBService();
- gettimeofday (&starttime, &Timezone);
+ gettimeofday (&starttime, NULL);
fname = as->parms[0].items->data;
cell = 0;
if (as->parms[1].items)
useHost, fname, code);
continue;
}
- gettimeofday(&opentime, &Timezone);
+ gettimeofday(&opentime, NULL);
if (verbose) {
seconds = (float)(opentime.tv_sec + opentime.tv_usec *.000001
-starttime.tv_sec - starttime.tv_usec *.000001);
write(1, buf, len);
length -= len;
xfered += len;
- gettimeofday(&now, &Timezone);
+ gettimeofday(&now, NULL);
if (verbose)
printDatarate();
}
}
break;
}
- gettimeofday(&readtime, &Timezone);
+ gettimeofday(&readtime, NULL);
if (worstCode) {
fprintf(stderr,"%s failed with code %d\n",
(char *) &as->name, worstCode);
return ENOENT;
}
cl = FindCell(cell);
- gettimeofday (&starttime, &Timezone);
+ gettimeofday (&starttime, NULL);
useHost = hosts[0];
RXConn = FindRXConnection(useHost, htons(AFSCONF_FILEPORT), 1,
cl->sc, cl->scIndex);
previous = tbuf;
Len += tbuf->used;
}
- gettimeofday(&opentime, &Timezone);
+ gettimeofday(&opentime, NULL);
if (verbose) {
seconds = (float) (opentime.tv_sec + opentime.tv_usec *.000001
-starttime.tv_sec - starttime.tv_usec *.000001);
break;
}
xfered += tbuf->used;
- gettimeofday(&now, &Timezone);
+ gettimeofday(&now, NULL);
if (verbose)
printDatarate();
length -= tbuf->used;
}
}
}
- gettimeofday(&writetime, &Timezone);
+ gettimeofday(&writetime, NULL);
if (worstCode) {
fprintf(stderr,"%s failed with code %d\n", as->name, worstCode);
} else if(verbose) {
header.volumeInfo.uniquifier = (isp->maxUniquifier + 1) + 1000;
header.volumeInfo.type = (isp->volumeId == isp->RWvolumeId ? readwriteVolume : readonlyVolume); /* XXXX */
header.volumeInfo.needsCallback = 0;
- gettimeofday(&tp, 0);
+ gettimeofday(&tp, NULL);
header.volumeInfo.creationDate = tp.tv_sec;
nBytes =
FDH_PWRITE(fdP, (char *)&header.volumeInfo,
} else
#endif
if (logFile) {
- gettimeofday(&now, 0);
+ gettimeofday(&now, NULL);
fprintf(logFile, "%s %s", TimeStamp(now.tv_sec, 1), tmp);
fflush(logFile);
}
/* set volid, next, partition */
struct volser_trans *tt, *newtt;
struct timeval tp;
- struct timezone tzp;
newtt = (struct volser_trans *)malloc(sizeof(struct volser_trans));
VTRANS_LOCK;
tt->refCount = 1;
tt->rxCallPtr = (struct rx_call *)0;
strcpy(tt->lastProcName, "");
- gettimeofday(&tp, &tzp);
+ gettimeofday(&tp, NULL);
tt->creationTime = tp.tv_sec;
tt->time = FT_ApproxTime();
tt->tid = transCounter++;