s/qmail
4.3.20
Next generation secure email transport
Loading...
Searching...
No Matches
4.3
sqmail-4.3.20
src
chkspawn.c
Go to the documentation of this file.
1
#include "buffer.h"
2
#include "fmt.h"
3
#include "select.h"
4
#include "
exit.h
"
5
#include "
auto_spawn.h
"
6
#define MAXSPAWN 1000
/* Silent spawn limit increased to 1000 */
7
8
char
num
[FMT_ULONG];
9
fd_set
fds
;
10
11
int
main
()
12
{
13
unsigned
long
hiddenlimit;
14
unsigned
long
maxnumd;
15
16
hiddenlimit =
sizeof
(
fds
) * 8;
17
maxnumd = (hiddenlimit - 5) / 2;
18
19
if
(
auto_spawn
< 1) {
20
buffer_puts(buffer_2,
"Oops. You have set conf-spawn lower than 1.\n"
);
21
buffer_flush(buffer_2);
22
_exit
(1);
23
}
24
25
if
(
auto_spawn
>
MAXSPAWN
) {
26
buffer_puts(buffer_2,
"Oops. You have set conf-spawn higher than MAXSPAWN.\n"
);
27
buffer_flush(buffer_2);
28
_exit
(1);
29
}
30
31
if
(
auto_spawn
> maxnumd) {
32
buffer_puts(buffer_2,
"Oops. Your system's FD_SET() has a hidden limit of "
);
33
buffer_put(buffer_2,
num
,fmt_ulong(
num
,hiddenlimit));
34
buffer_puts(buffer_2,
" descriptors.\n\
35
This means that the qmail daemons could crash if you set the run-time\n\
36
concurrency higher than "
);
37
buffer_put(buffer_2,
num
,fmt_ulong(
num
,maxnumd));
38
buffer_puts(buffer_2,
". So I'm going to insist that the concurrency\n\
39
limit in conf-spawn be at most "
);
40
buffer_put(buffer_2,
num
,fmt_ulong(
num
,maxnumd));
41
buffer_puts(buffer_2,
". Right now it's "
);
42
buffer_put(buffer_2,
num
,fmt_ulong(
num
,(
unsigned
long
)
auto_spawn
));
43
buffer_puts(buffer_2,
".\n"
);
44
buffer_flush(buffer_2);
45
_exit
(1);
46
}
47
_exit
(0);
48
}
auto_spawn.h
auto_spawn
int auto_spawn
MAXSPAWN
#define MAXSPAWN
Definition:
chkspawn.c:6
num
char num[FMT_ULONG]
Definition:
chkspawn.c:8
main
int main()
Definition:
chkspawn.c:11
fds
fd_set fds
Definition:
chkspawn.c:9
exit.h
_exit
void _exit(int)
Generated on Thu Jan 16 2025 17:42:03 for s/qmail by
1.9.6