summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-29 13:32:40 (GMT)
committerGitHub <noreply@github.com>2023-06-29 13:32:40 (GMT)
commita90bdbbcfc6db6718d368fe7d0c570238e302bc7 (patch)
tree41e896d50e68458fa5cadddafeca80ef44c327e3 /src
parent651b20ccb7b83d5e9ef215594542cdb8119071a5 (diff)
downloadhdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.zip
hdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.tar.gz
hdf5-a90bdbbcfc6db6718d368fe7d0c570238e302bc7.tar.bz2
Remove HD from protected POSIX calls (#3203)
These calls are non-C99 but protected by ifdefs and have no Windows equivalents: * HDalarm * HDasprintf * HDclock_gettime * HDfcntl * HDgethostname * HDgetrusage * HDsymlink
Diffstat (limited to 'src')
-rw-r--r--src/H5private.h21
-rw-r--r--src/H5system.c2
-rw-r--r--src/H5timer.c6
3 files changed, 4 insertions, 25 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 676fb22..ea28b51 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -614,15 +614,9 @@ typedef off_t h5_stat_size_t;
#ifndef HDaccess
#define HDaccess(F, M) access(F, M)
#endif
-#ifndef HDalarm
-#define HDalarm(N) alarm(N)
-#endif
#ifndef HDasctime
#define HDasctime(T) asctime(T)
#endif
-#ifndef HDasprintf
-#define HDasprintf asprintf /*varargs*/
-#endif
#ifndef HDatexit
#define HDatexit(F) atexit(F)
#endif
@@ -647,9 +641,6 @@ typedef off_t h5_stat_size_t;
#ifndef HDclock
#define HDclock() clock()
#endif
-#ifndef HDclock_gettime
-#define HDclock_gettime(CID, TS) clock_gettime(CID, TS)
-#endif
#ifndef HDclose
#define HDclose(F) close(F)
#endif
@@ -683,9 +674,6 @@ typedef off_t h5_stat_size_t;
#ifndef HDfclose
#define HDfclose(F) fclose(F)
#endif
-#ifndef HDfcntl
-#define HDfcntl(F, C, ...) fcntl(F, C, __VA_ARGS__)
-#endif
#ifndef HDfdopen
#define HDfdopen(N, S) fdopen(N, S)
#endif
@@ -793,15 +781,9 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#ifndef HDgetenv
#define HDgetenv(S) getenv(S)
#endif
-#ifndef HDgethostname
-#define HDgethostname(N, L) gethostname(N, L)
-#endif
#ifndef HDgetpid
#define HDgetpid() getpid()
#endif
-#ifndef HDgetrusage
-#define HDgetrusage(X, S) getrusage(X, S)
-#endif
/* Don't define HDgets - gets() was deprecated in C99 and removed in C11 */
#ifdef HDgets
@@ -1140,9 +1122,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#ifndef HDstrtoumax
#define HDstrtoumax(S, R, N) strtoumax(S, R, N)
#endif
-#ifndef HDsymlink
-#define HDsymlink(F1, F2) symlink(F1, F2)
-#endif
#ifndef HDtime
#define HDtime(T) time(T)
#endif
diff --git a/src/H5system.c b/src/H5system.c
index 46fea7a..8c0af55 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -167,7 +167,7 @@ Pflock(int fd, int operation)
flk.l_pid = 0; /* not used with set */
/* Lock or unlock */
- if (HDfcntl(fd, F_SETLK, &flk) < 0)
+ if (fcntl(fd, F_SETLK, &flk) < 0)
return -1;
return 0;
diff --git a/src/H5timer.c b/src/H5timer.c
index 89e4fd2..e1a97fe 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -191,7 +191,7 @@ H5_now_usec(void)
{
struct timespec ts;
- HDclock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_MONOTONIC, &ts);
/* Cast all values in this expression to uint64_t to ensure that all intermediate
* calculations are done in 64 bit, to prevent overflow */
@@ -240,7 +240,7 @@ H5_get_time(void)
{
struct timespec ts;
- HDclock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_MONOTONIC, &ts);
ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0);
}
#elif defined(H5_HAVE_GETTIMEOFDAY)
@@ -295,7 +295,7 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/)
{
struct rusage res;
- if (HDgetrusage(RUSAGE_SELF, &res) < 0)
+ if (getrusage(RUSAGE_SELF, &res) < 0)
return -1;
times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / 1.0E6);
times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / 1.0E6);