X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fnanosleep.c;h=4cfe21b57b7b4e67662e65d5c0df0bc9b91c1e3a;hb=abde38362f9239723c9b762d1b2ac41af575e6d5;hp=42f179c556c57ccd39d7edeb659d3267a44ff07b;hpb=e645160f72d4e01800c3043e541294fe3c723111;p=gnulib.git diff --git a/lib/nanosleep.c b/lib/nanosleep.c index 42f179c55..4cfe21b57 100644 --- a/lib/nanosleep.c +++ b/lib/nanosleep.c @@ -1,5 +1,5 @@ /* Provide a replacement for the POSIX nanosleep function. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,11 @@ /* written by Jim Meyering */ #include + +/* Undefine nanosleep here so any prototype is not redefined to be a + prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2) */ +#undef nanosleep + #include #include #include @@ -31,9 +36,7 @@ extern int errno; # include #endif -#include -/* FIXME: is including both like this kosher? */ -#include +#include "nanosleep.h" static int suspended; int first_call = 1; @@ -60,10 +63,10 @@ my_usleep (const struct timespec *ts_delay) /* FIXME: comment */ int -nanosleep (const struct timespec *requested_delay, - struct timespec *remaining_delay) +rpl_nanosleep (const struct timespec *requested_delay, + struct timespec *remaining_delay) { -#ifdef SA_INTERRUPT +#ifdef SA_NOCLDSTOP struct sigaction oldact, newact; #endif @@ -72,7 +75,7 @@ nanosleep (const struct timespec *requested_delay, /* set up sig handler */ if (first_call) { -#ifdef SA_INTERRUPT +#ifdef SA_NOCLDSTOP newact.sa_handler = sighandler; sigemptyset (&newact.sa_mask); newact.sa_flags = 0;