s/qmail 4.2.29a
Next generation secure email transport
Loading...
Searching...
No Matches
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
8char num[FMT_ULONG];
9fd_set fds;
10
11int 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\
35This means that the qmail daemons could crash if you set the run-time\n\
36concurrency 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\
39limit 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}
int auto_spawn
#define MAXSPAWN
Definition: chkspawn.c:6
char num[FMT_ULONG]
Definition: chkspawn.c:8
int main()
Definition: chkspawn.c:11
fd_set fds
Definition: chkspawn.c:9
void _exit()