diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-05-09 14:20:58 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-05-09 14:20:58 -0400 |
commit | 5fd83771641d15c418f747bd343ba6738d3875f7 (patch) | |
tree | 5abf0f78f680d9837dbd93d4d4c3933bb7509599 /system_cmds/gcore.tproj/options.h | |
download | apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.tar.gz apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.tar.zst apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.zip |
Import macOS userland
adv_cmds-176
basic_cmds-55
bootstrap_cmds-116.100.1
developer_cmds-66
diskdev_cmds-667.40.1
doc_cmds-53.60.1
file_cmds-321.40.3
mail_cmds-35
misc_cmds-34
network_cmds-606.40.1
patch_cmds-17
remote_cmds-63
shell_cmds-216.60.1
system_cmds-880.60.2
text_cmds-106
Diffstat (limited to 'system_cmds/gcore.tproj/options.h')
-rw-r--r-- | system_cmds/gcore.tproj/options.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/system_cmds/gcore.tproj/options.h b/system_cmds/gcore.tproj/options.h new file mode 100644 index 0000000..71481fa --- /dev/null +++ b/system_cmds/gcore.tproj/options.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016 Apple Inc. All rights reserved. + */ + +#include <sys/types.h> +#include <compression.h> + +#include <assert.h> + +#ifndef _OPTIONS_H +#define _OPTIONS_H + +#if defined(__arm__) || defined(__arm64__) +#define RDAR_23744374 1 /* 'true' while not fixed i.e. enable workarounds */ +#define RDAR_28040018 1 /* 'true' while not fixed i.e. enable workarounds */ +#endif + +//#define CONFIG_SUBMAP 1 /* include submaps (debugging output) */ +#define CONFIG_GCORE_MAP 1 /* support 'gcore map' */ +#define CONFIG_GCORE_CONV 1 /* support 'gcore conv' - new -> old core files */ +#define CONFIG_GCORE_FREF 1 /* support 'gcore fref' - referenced file list */ +#define CONFIG_DEBUG 1 /* support '-d' option */ + +#ifdef NDEBUG +#define poison(a, p, s) /* do nothing */ +#else +#define poison(a, p, s) memset(a, p, s) /* scribble on dying memory */ +#endif + +struct options { + int corpsify; // make a corpse to dump from + int suspend; // suspend while dumping + int preserve; // preserve the core file, even if there are errors + int verbose; // be chatty +#ifdef CONFIG_DEBUG + int debug; // internal debugging: options accumulate. noisy. +#endif + int extended; // avoid writing out ro mapped files, compress regions + off_t sizebound; // maximum size of the dump + size_t chunksize; // max size of a compressed subregion + compression_algorithm calgorithm; // algorithm in use + size_t ncthresh; // F_NOCACHE enabled *above* this value + int allfilerefs; // if set, every mapped file on the root fs is a fileref + int dsymforuuid; // Try dsysForUUID to retrieve symbol-rich executable +}; + +extern const struct options *opt; + +/* + * == 0 - not verbose + * >= 1 - verbose plus chatty + * >= 2 - tabular summaries + * >= 3 - all + */ + +#ifdef CONFIG_DEBUG +#define OPTIONS_DEBUG(opt, lvl) ((opt)->debug && (opt)->debug >= (lvl)) +#else +#define OPTIONS_DEBUG(opt, lvl) 0 +#endif + +#endif /* _OPTIONS_H */ |