]>
Commit | Line | Data |
---|---|---|
0545caaa | 1 | /* |
bde978a6 | 2 | * Copyright (C) 1996-2015 The Squid Software Foundation and contributors |
0545caaa AJ |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
f7f3304a | 9 | #include "squid.h" |
9ece7c7c | 10 | #include "xusleep.h" |
11 | ||
9ece7c7c | 12 | #if HAVE_UNISTD_H |
13 | #include <unistd.h> | |
14 | #endif | |
9ece7c7c | 15 | |
489520a9 | 16 | /** |
9ece7c7c | 17 | * xusleep, as usleep but accepts longer pauses |
18 | */ | |
19 | int | |
20 | xusleep(unsigned int usec) | |
21 | { | |
22 | /* XXX emulation of usleep() */ | |
23 | struct timeval sl; | |
24 | sl.tv_sec = usec / 1000000; | |
25 | sl.tv_usec = usec % 1000000; | |
26 | return select(0, NULL, NULL, NULL, &sl); | |
27 | } | |
f53969cc | 28 |