Lines 115-120
__FBSDID("$FreeBSD: src/usr.sbin/inetd/i
Link Here
|
115 |
#include <sys/resource.h> |
115 |
#include <sys/resource.h> |
116 |
#include <sys/stat.h> |
116 |
#include <sys/stat.h> |
117 |
#include <sys/un.h> |
117 |
#include <sys/un.h> |
|
|
118 |
#include <sys/mman.h> |
118 |
|
119 |
|
119 |
#include <netinet/in.h> |
120 |
#include <netinet/in.h> |
120 |
#include <netinet/tcp.h> |
121 |
#include <netinet/tcp.h> |
Lines 244-249
int wrap_ex = 0;
Link Here
|
244 |
int wrap_bi = 0; |
245 |
int wrap_bi = 0; |
245 |
int debug = 0; |
246 |
int debug = 0; |
246 |
int dolog = 0; |
247 |
int dolog = 0; |
|
|
248 |
int is_immortal = 0; |
247 |
int maxsock; /* highest-numbered descriptor */ |
249 |
int maxsock; /* highest-numbered descriptor */ |
248 |
fd_set allsock; |
250 |
fd_set allsock; |
249 |
int options; |
251 |
int options; |
Lines 344-350
main(int argc, char **argv)
Link Here
|
344 |
|
346 |
|
345 |
openlog("inetd", LOG_PID | LOG_NOWAIT | LOG_PERROR, LOG_DAEMON); |
347 |
openlog("inetd", LOG_PID | LOG_NOWAIT | LOG_PERROR, LOG_DAEMON); |
346 |
|
348 |
|
347 |
while ((ch = getopt(argc, argv, "dlwWR:a:c:C:p:s:")) != -1) |
349 |
while ((ch = getopt(argc, argv, "dilwWR:a:c:C:p:s:")) != -1) |
348 |
switch(ch) { |
350 |
switch(ch) { |
349 |
case 'd': |
351 |
case 'd': |
350 |
debug = 1; |
352 |
debug = 1; |
Lines 353-358
main(int argc, char **argv)
Link Here
|
353 |
case 'l': |
355 |
case 'l': |
354 |
dolog = 1; |
356 |
dolog = 1; |
355 |
break; |
357 |
break; |
|
|
358 |
case 'i': |
359 |
is_immortal = 1; |
360 |
break; |
356 |
case 'R': |
361 |
case 'R': |
357 |
getvalue(optarg, &toomany, |
362 |
getvalue(optarg, &toomany, |
358 |
"-R %s: bad value for service invocation rate"); |
363 |
"-R %s: bad value for service invocation rate"); |
Lines 562-567
main(int argc, char **argv)
Link Here
|
562 |
if (signalpipe[1] > maxsock) |
567 |
if (signalpipe[1] > maxsock) |
563 |
maxsock = signalpipe[1]; |
568 |
maxsock = signalpipe[1]; |
564 |
|
569 |
|
|
|
570 |
if (is_immortal) |
571 |
if (madvise(NULL, 0, MADV_PROTECT)) { |
572 |
syslog(LOG_ERR, "Unable to set MADV_PROTECT flag: %s", strerror(error)); |
573 |
exit(EX_OSERR); |
574 |
} |
575 |
|
565 |
for (;;) { |
576 |
for (;;) { |
566 |
int n, ctrl; |
577 |
int n, ctrl; |
567 |
fd_set readable; |
578 |
fd_set readable; |