aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-03-27 02:31:33 +0000
committerChristopher Faylor <me@cgf.cx>2005-03-27 02:31:33 +0000
commit255557f8c3bcc39467cd02a234d2a544f17d22c9 (patch)
treee152f9b0f349b6351d12563c0f14718775204142
parentec98d19a08c2e4678e8a6f40fea0c9bbeaa4a2c7 (diff)
downloadnewlib-255557f8c3bcc39467cd02a234d2a544f17d22c9.zip
newlib-255557f8c3bcc39467cd02a234d2a544f17d22c9.tar.gz
newlib-255557f8c3bcc39467cd02a234d2a544f17d22c9.tar.bz2
* timer.cc (nanosleep): Treat tv_sec < 0 as invalid.
* include/search.h: Make declarations consistent with newlib.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/include/search.h19
-rw-r--r--winsup/cygwin/signal.cc1
3 files changed, 21 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index cd890ec..0f420db 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-26 Christopher Faylor <cgf@timesys.com>
+
+ * timer.cc (nanosleep): Treat tv_sec < 0 as invalid.
+
+ * include/search.h: Make declarations consistent with newlib.
+
2005-03-26 Pierre Humblet <pierre.humblet@ieee.org>
Christopher Faylor <cgf@timesys.com>
diff --git a/winsup/cygwin/include/search.h b/winsup/cygwin/include/search.h
index fedfc8c..a1ccfe2 100644
--- a/winsup/cygwin/include/search.h
+++ b/winsup/cygwin/include/search.h
@@ -45,20 +45,29 @@ struct que_elem
};
#endif
+struct hsearch_data
+{
+ struct internal_head *htable;
+ size_t htablesize;
+};
+
__BEGIN_DECLS
int hcreate (size_t);
void hdestroy (void);
ENTRY *hsearch (ENTRY, ACTION);
-void *lfind (const void *, const void *, size_t *, size_t,
- int (*) (const void *, const void *));
-void *lsearch (const void *, void *, size_t *, size_t,
- int (*) (const void *, const void *));
+int hcreate_r (size_t, struct hsearch_data *);
+void hdestroy_r (struct hsearch_data *);
void *tdelete (const void * __restrict, void ** __restrict,
int (*) (const void *, const void *));
-void *tfind (const void *, void * const *,
+void tdestroy (void *, void (*)(void *));
+void *tfind (const void *, void **,
int (*) (const void *, const void *));
void *tsearch (const void *, void **, int (*) (const void *, const void *));
void twalk (const void *, void (*) (const void *, VISIT, int));
+void *lfind (const void *, const void *, size_t *, size_t,
+ int (*) (const void *, const void *));
+void *lsearch (const void *, void *, size_t *, size_t,
+ int (*) (const void *, const void *));
__END_DECLS
#endif /* !_SEARCH_H_ */
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 1808b24..41b4831 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -77,6 +77,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
pthread_testcancel ();
if ((unsigned int) rqtp->tv_sec > (HIRES_DELAY_MAX / 1000 - 1)
+ || rqtp->tv_sec < 0
|| (unsigned int) rqtp->tv_nsec > 999999999)
{
set_errno (EINVAL);