#ifdef AFS_SUN5_ENV
/* On solaris the above does not resolve hostnames to full names */
if (he != (struct hostent *)0) {
- bcopy(he->h_addr, ip_addr, he->h_length);
+ memcpy(ip_addr, he->h_addr, he->h_length);
he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype);
}
#endif
fprintf(stderr,"[ %s ] Memory Allocation error 1",rn);
afsmon_Exit(25);
}
- bzero(curr_host->thresh,numBytes);
+ memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
fprintf(stderr,"[ %s ] Memory Allocation error 2",rn);
afsmon_Exit(35);
}
- bzero(curr_host->thresh,numBytes);
+ memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
- bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
- sizeof(xstat_fs_Results.connP->hostName));
+ memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->probeNum = xstat_fs_Results.probeNum;
tmp_fsPR->probeTime = xstat_fs_Results.probeTime;
tmp_fsPR->probeOK = xstat_fs_Results.probeOK;
}
/* copy connection information */
-#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt),
- sizeof(struct sockaddr_in));
-#else
- bcopy(xstat_fs_Results.connP->skt, tmp_fsPR->connP->skt,
- sizeof(struct sockaddr_in));
-#endif
+ memcpy(&(tmp_fsPR->connP->skt), &(xstat_fs_Results.connP->skt), sizeof(struct sockaddr_in));
- bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
- sizeof(xstat_fs_Results.connP->hostName));
+ memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->collectionNumber = xstat_fs_Results.collectionNumber;
/* copy the probe data information */
tmp_fsPR->data.AFS_CollData_len = xstat_fs_Results.data.AFS_CollData_len;
- bcopy(xstat_fs_Results.data.AFS_CollData_val,
- tmp_fsPR->data.AFS_CollData_val,
- xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
+ memcpy(tmp_fsPR->data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
/* backup the display data of the probe cycle that just completed -
ie., store curr_fsData in prev_fsData */
- bcopy((char *)curr_fsData, (char *)prev_fsData,
- (numFS * sizeof(struct fs_Display_Data)) );
+ memcpy((char *)prev_fsData, (char *)curr_fsData, (numFS * sizeof(struct fs_Display_Data)) );
/* initialize curr_fsData but retain the threshold flag information.
for(i=0; i<numFS; i++) {
curr_fsDataP->probeOK = 0;
curr_fsDataP->ovfCount = 0;
- bzero((char *)curr_fsDataP->data, numBytes);
+ memset((char *)curr_fsDataP->data, 0, numBytes);
curr_fsDataP++;
}
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
- bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
- sizeof(xstat_cm_Results.connP->hostName));
+ memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->probeNum = xstat_cm_Results.probeNum;
tmp_cmPR->probeTime = xstat_cm_Results.probeTime;
tmp_cmPR->probeOK = xstat_cm_Results.probeOK;
/* copy connection information */
-#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt),
- sizeof(struct sockaddr_in));
-#else
- bcopy(xstat_cm_Results.connP->skt, tmp_cmPR->connP->skt,
- sizeof(struct sockaddr_in));
-#endif
+ memcpy(&(tmp_cmPR->connP->skt), &(xstat_cm_Results.connP->skt), sizeof(struct sockaddr_in));
/**** NEED TO COPY rx_connection INFORMATION HERE ******/
- bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
- sizeof(xstat_cm_Results.connP->hostName));
+ memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->collectionNumber = xstat_cm_Results.collectionNumber;
/* copy the probe data information */
tmp_cmPR->data.AFSCB_CollData_len = xstat_cm_Results.data.AFSCB_CollData_len;
- bcopy(xstat_cm_Results.data.AFSCB_CollData_val,
- tmp_cmPR->data.AFSCB_CollData_val,
- xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
+ memcpy(tmp_cmPR->data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
/* backup the display data of the probe cycle that just completed -
ie., store curr_cmData in prev_cmData */
- bcopy((char *)curr_cmData, (char *)prev_cmData,
- (numCM * sizeof(struct cm_Display_Data)) );
+ memcpy((char *)prev_cmData, (char *)curr_cmData, (numCM * sizeof(struct cm_Display_Data)) );
/* initialize curr_cmData but retain the threshold flag information.
for(i=0; i<numCM; i++) {
curr_cmDataP->probeOK = 0;
curr_cmDataP->ovfCount = 0;
- bzero((char *)curr_cmDataP->data, numBytes);
+ memset((char *)curr_cmDataP->data, 0, numBytes);
curr_cmDataP++;
}
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-1);
}
- bzero(curr_fsData,numBytes);
+ memset(curr_fsData, 0, numBytes);
numBytes = numFS * sizeof(struct fs_Display_Data);
prev_fsData = (struct fs_Display_Data *) malloc(numBytes);
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-5);
}
- bzero(prev_fsData,numBytes);
+ memset(prev_fsData, 0, numBytes);
/* fill in the host names */
tmp_fsData1 = curr_fsData;
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-10);
}
- bzero(curr_cmData,numBytes);
+ memset(curr_cmData, 0, numBytes);
numBytes = numCM * sizeof(struct cm_Display_Data);
prev_cmData = (struct cm_Display_Data *) malloc(numBytes);
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-15);
}
- bzero(prev_cmData,numBytes);
+ memset(prev_cmData, 0, numBytes);
/* fill in the host names */
tmp_cmData1 = curr_cmData;
return(-1);
}
- bzero(FSSktArray, FSsktbytes);
+ memset(FSSktArray, 0, FSsktbytes);
/* Fill in the socket information for each fileserve */
return(-1);
}
strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
- bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
+ memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7000); /*FileServer port*/
return(-1);
}
- bzero(CMSktArray, CMsktbytes);
+ memset(CMSktArray, 0, CMsktbytes);
/* Fill in the socket information for each CM */
return(-1);
}
strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
- bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
+ memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7001); /*Cache Manager port*/