39 |
#ifdef HAVE_UNISTD_H |
#ifdef HAVE_UNISTD_H |
40 |
#include <unistd.h> |
#include <unistd.h> |
41 |
#endif |
#endif |
|
#ifdef HAVE_LIMITS_H |
|
|
#include <limits.h> |
|
|
#endif |
|
42 |
#include "getopt.h" |
#include "getopt.h" |
43 |
|
|
44 |
#include "global.h" |
#include "global.h" |
45 |
#include "regex.h" |
#include "regex.h" |
46 |
#include "const.h" |
#include "const.h" |
47 |
|
|
|
#if !defined(ARG_MAX) && defined(_SC_ARG_MAX) |
|
|
#define ARG_MAX sysconf(_SC_ARG_MAX) |
|
|
#endif |
|
|
|
|
48 |
static void usage(void); |
static void usage(void); |
49 |
static void help(void); |
static void help(void); |
50 |
static void setcom(int); |
static void setcom(int); |
920 |
/* |
/* |
921 |
* determine the maximum length of the list of paths. |
* determine the maximum length of the list of paths. |
922 |
*/ |
*/ |
923 |
#ifdef ARG_MAX |
path_list_max = exec_line_limit(); |
|
path_list_max = ARG_MAX; |
|
|
path_list_max -= 2048; |
|
|
if (path_list_max > 20 * 1024) |
|
|
path_list_max = 20 * 1024; |
|
|
path_list_max -= env_size(); |
|
924 |
path_list_max -= strbuf_getlen(comline); |
path_list_max -= strbuf_getlen(comline); |
925 |
path_list_max -= 40; |
path_list_max -= 40; |
926 |
if (path_list_max < 0) |
if (path_list_max < 0) |
927 |
path_list_max = 0; |
path_list_max = 0; |
|
#else |
|
|
path_list_max = 0; |
|
|
#endif |
|
928 |
|
|
929 |
if (!(op = openfilter())) |
if (!(op = openfilter())) |
930 |
die("cannot open output filter."); |
die("cannot open output filter."); |