summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-09-10 07:27:28 +0000
committerPaul Smith <psmith@gnu.org>2002-09-10 07:27:28 +0000
commit7ea029a07c02b9401cb3d88566eac41959b84c11 (patch)
tree0a26e865bee26f79c718258415b5389023076942 /misc.c
parent9b41488ad15e4ffc63b8094379c17f567b094c1b (diff)
downloadgunmake-7ea029a07c02b9401cb3d88566eac41959b84c11.tar.gz
Add support for broken SA_RESTART on PTX.
Fix bug #103: allow ifdef, export, and unexport to expand their arguments.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 6e2b570..669dabc 100644
--- a/misc.c
+++ b/misc.c
@@ -856,3 +856,38 @@ get_path_max ()
return value;
}
#endif
+
+
+#ifdef HAVE_BROKEN_RESTART
+
+#undef stat
+#undef readdir
+
+int
+atomic_stat(file, buf)
+ const char *file;
+ struct stat *buf;
+{
+ int r;
+
+ while ((r = stat (file, buf)) < 0)
+ if (errno != EINTR)
+ break;
+
+ return r;
+}
+
+struct dirent *
+atomic_readdir(dir)
+ DIR *file;
+{
+ struct dirent *r;
+
+ while ((r = readdir (file, buf)) == NULL)
+ if (errno != EINTR)
+ break;
+
+ return r;
+}
+
+#endif /* HAVE_BROKEN_RESTART */