3 linux_check_core_pattern()
5 if grep -q '^|' </proc/sys/kernel/core_pattern; then
7 Your system uses a crash report tool ($(cat /proc/sys/kernel/core_pattern)). Core files
8 will not be generated. Please reset /proc/sys/kernel/core_pattern (requires root
9 privileges) to enable core generation.
18 core_pattern=$(sysctl -n kern.corefile)
21 core_pattern=$(cat /proc/sys/kernel/core_pattern)
24 echo "OS $OS not supported" >&2
32 if [ -z "$file" ]; then
34 Please supply the main source file as the first argument.
39 if [ "$OS" = Linux ]; then
40 linux_check_core_pattern
44 real_limit=$(ulimit -c)
45 if [ $real_limit -lt 100 ]; then
47 Unable to increase the core file limit. Core file may be truncated!
48 To fix this, increase HARD core file limit (ulimit -H -c 1000). This may require root
53 ${CC:-cc} -nostdlib -static -g $CFLAGS "$file" -o a.out
56 Executable file is in a.out.
57 Core file will be saved according to pattern $core_pattern.
60 ulimit -s 8 # Decrease stack size to 8k => smaller core files.