51 |
#ifdef HAVE_UNISTD_H |
#ifdef HAVE_UNISTD_H |
52 |
#include <unistd.h> |
#include <unistd.h> |
53 |
#endif |
#endif |
|
#ifdef HAVE_LIMITS_H |
|
|
#include <limits.h> |
|
|
#endif |
|
54 |
#include "getopt.h" |
#include "getopt.h" |
55 |
|
|
56 |
#include "global.h" |
#include "global.h" |
57 |
#include "const.h" |
#include "const.h" |
58 |
|
|
|
#if !defined(ARG_MAX) && defined(_SC_ARG_MAX) |
|
|
#define ARG_MAX sysconf(_SC_ARG_MAX) |
|
|
#endif |
|
|
|
|
59 |
static void usage(void); |
static void usage(void); |
60 |
static void help(void); |
static void help(void); |
61 |
void signal_setup(void); |
void signal_setup(void); |
814 |
/* |
/* |
815 |
* determine the maximum length of the list of paths. |
* determine the maximum length of the list of paths. |
816 |
*/ |
*/ |
817 |
#ifdef ARG_MAX |
path_list_max = exec_line_limit(); |
818 |
if (noxargs) { |
path_list_max -= strbuf_getlen(comline); |
819 |
/* force processing files individually. */ |
path_list_max -= 40; |
820 |
|
if (path_list_max < 0) |
821 |
path_list_max = 0; |
path_list_max = 0; |
822 |
} else { |
|
|
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(); |
|
|
path_list_max -= strbuf_getlen(comline); |
|
|
path_list_max -= 40; |
|
|
if (path_list_max < 0) |
|
|
path_list_max = 0; |
|
|
} |
|
|
#else |
|
|
path_list_max = 0; |
|
|
#endif |
|
823 |
gtop = gtags_open(dbpath, root, db, GTAGS_MODIFY, 0); |
gtop = gtags_open(dbpath, root, db, GTAGS_MODIFY, 0); |
824 |
if (vflag) { |
if (vflag) { |
825 |
char fid[32]; |
char fid[32]; |
925 |
/* |
/* |
926 |
* determine the maximum length of the list of paths. |
* determine the maximum length of the list of paths. |
927 |
*/ |
*/ |
928 |
#ifdef ARG_MAX |
path_list_max = exec_line_limit(); |
929 |
if (noxargs) { |
path_list_max -= strbuf_getlen(comline); |
930 |
/* force processing files individually. */ |
path_list_max -= 40; |
931 |
path_list_max = 0; |
if (path_list_max < 0) |
932 |
} else { |
path_list_max = 0;; |
|
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(); |
|
|
path_list_max -= strbuf_getlen(comline); |
|
|
path_list_max -= 40; |
|
|
if (path_list_max < 0) |
|
|
path_list_max = 0; |
|
|
} |
|
|
#else |
|
|
path_list_max = 0; |
|
|
#endif |
|
933 |
|
|
934 |
flags = 0; |
flags = 0; |
935 |
/* |
/* |