summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-06-18 23:15:53 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-06-18 23:15:53 (GMT)
commit52ac5273d5dddb7076e6c75d2e9f538f0d77aa1d (patch)
tree6936eb62fbc641e43f94fe3ecd1752a24508a594
parentd41b9fffdfca2e97c36bc0ad0899fbb7b055f926 (diff)
downloadhdf5-52ac5273d5dddb7076e6c75d2e9f538f0d77aa1d.zip
hdf5-52ac5273d5dddb7076e6c75d2e9f538f0d77aa1d.tar.gz
hdf5-52ac5273d5dddb7076e6c75d2e9f538f0d77aa1d.tar.bz2
[svn-r4013] Purpose:
POSIX Removal Description: Removed calls to POSIX functions and replaced them with the HD* equivalents. Solution: Did just that. Also had to create two new HD* macros, the gettimeofday() and getrusage() Platforms tested: Linux
-rw-r--r--src/H5.c16
-rw-r--r--src/H5B.c4
-rw-r--r--src/H5private.h2
3 files changed, 12 insertions, 10 deletions
diff --git a/src/H5.c b/src/H5.c
index 85a31f6..d0fef4b 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -15,10 +15,10 @@
/* private headers */
#include "H5private.h" /*library */
#include "H5Bprivate.h" /*B-link trees */
-#include "H5Dprivate.h" /*datasets */
+#include "H5Dprivate.h" /*datasets */
#include "H5Eprivate.h" /*error handling */
#include "H5FDprivate.h" /*file driver */
-#include "H5FLprivate.h" /*Free Lists */
+#include "H5FLprivate.h" /*free lists */
#include "H5Iprivate.h" /*atoms */
#include "H5MMprivate.h" /*memory management */
#include "H5Pprivate.h" /*property lists */
@@ -110,7 +110,7 @@ H5_init_library(void)
* adding it again later if the library is cosed and reopened.
*/
if (!dont_atexit_g) {
- atexit(H5_term_library);
+ HDatexit(H5_term_library);
dont_atexit_g = TRUE;
}
@@ -194,7 +194,7 @@ H5_term_library(void)
#define DOWN(F) \
(((n=H5##F##_term_interface()) && at+5<sizeof loop)? \
(sprintf(loop+at, "%s%s", at?",":"", #F), \
- at += strlen(loop+at), \
+ at += HDstrlen(loop+at), \
n):0)
do {
@@ -658,7 +658,7 @@ HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- n = vsprintf(buf, fmt, ap);
+ n = HDvsprintf(buf, fmt, ap);
va_end(ap);
return n;
}
@@ -693,7 +693,7 @@ HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...)
int
HDvsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
- return vsprintf(buf, fmt, ap);
+ return HDvsprintf(buf, fmt, ap);
}
#endif /* H5_HAVE_VSNPRINTF */
@@ -1157,7 +1157,7 @@ H5_timer_begin (H5_timer_t *timer)
assert (timer);
#ifdef H5_HAVE_GETRUSAGE
- getrusage (RUSAGE_SELF, &rusage);
+ HDgetrusage (RUSAGE_SELF, &rusage);
timer->utime = (double)rusage.ru_utime.tv_sec +
(double)rusage.ru_utime.tv_usec/1e6;
timer->stime = (double)rusage.ru_stime.tv_sec +
@@ -1167,7 +1167,7 @@ H5_timer_begin (H5_timer_t *timer)
timer->stime = 0.0;
#endif
#ifdef H5_HAVE_GETTIMEOFDAY
- gettimeofday (&etime, NULL);
+ HDgettimeofday (&etime, NULL);
timer->etime = (double)etime.tv_sec + (double)etime.tv_usec/1e6;
#else
timer->etime = 0.0;
diff --git a/src/H5B.c b/src/H5B.c
index afa53d9..e907d5c 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -1585,8 +1585,8 @@ H5B_iterate (H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
}
for (i=0; i<bt->nchildren+1; i++) {
if (!bt->key[i].nkey) H5B_decode_key(f, bt, i);
- memcpy(key+i*type->sizeof_nkey, bt->key[i].nkey,
- type->sizeof_nkey);
+ HDmemcpy(key+i*type->sizeof_nkey, bt->key[i].nkey,
+ type->sizeof_nkey);
}
next_addr = bt->right;
nchildren = bt->nchildren;
diff --git a/src/H5private.h b/src/H5private.h
index fcaf4c2..fb05118 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -588,7 +588,9 @@ __DLL__ int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDgetppid() getppid()
#define HDgetpwnam(S) getpwnam(S)
#define HDgetpwuid(U) getpwuid(U)
+#define HDgetrusage(X,S) getrusage(X,S)
#define HDgets(S) gets(S)
+#define HDgettimeofday(S,P) gettimeofday(S,P)
#define HDgetuid() getuid()
#define HDgmtime(T) gmtime(T)
#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/