bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] system() should return != 0 when the process is killed


From: Stephane Chazelas
Subject: Re: [bug-gawk] system() should return != 0 when the process is killed
Date: Mon, 7 Mar 2016 22:46:02 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

2016-03-07 23:38:54 +0200, Aharon Robbins:
[...]
> +Traditionally, @command{awk}'s @code{system()} function has simply
> +returned the exit status value and ignored death-by-signal. POSIX
> +states that @command{awk}'s @code{system()} should return the full
> +16-bit value.
[...]

That's not true. as I said in my first article in this thread,
bwk's awk returns the value returned by system(3) divided by
256. With x that value, you can have

signal_number = (x * 256) % 128
core_dumped = x * 256 % 256 / 128

And see mawk for alternative approach that is similar to shell's
$? except that it can tell when a core was dumped.

And again, the value returned by awk's close(cmd) should also be
addressed (after cmd | getline or print | cmd).

-- 
Stephane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]