squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
test-suite
waiter.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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
9
#include "
squid.h
"
10
11
#if HAVE_ASSERT_H
12
#include <
assert.h
>
13
#endif
14
15
int
16
main
(
int
argc,
char
*argv[])
17
{
18
int
i;
19
struct
timeval
now
;
20
struct
timeval alarm;
21
struct
timeval to;
22
assert
(argc == 2);
23
i = atoi(argv[1]);
24
gettimeofday(&
now
,
NULL
);
25
alarm.tv_sec =
now
.tv_sec + i + (
now
.tv_sec % i);
26
alarm.tv_usec = 0;
27
to.tv_sec = alarm.tv_sec -
now
.tv_sec;
28
to.tv_usec = alarm.tv_usec -
now
.tv_usec;
29
if
(to.tv_usec < 0) {
30
to.tv_usec += 1000000;
31
to.tv_sec -= 1;
32
}
33
select(1,
NULL
,
NULL
,
NULL
, &to);
34
return
0;
35
}
36
assert.h
assert
#define assert(EX)
Definition:
assert.h:17
now
static time_t now
Definition:
cachemgr.cc:109
squid.h
NULL
#define NULL
Definition:
types.h:145
main
int main(int argc, char *argv[])
Definition:
waiter.c:16
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Quick Setup
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
pl
...
full list
FTP Package Archive