Re: [Vala] Interpreting exit status
- From: rastersoft <raster rastersoft com>
- To: vala-list gnome org
- Subject: Re: [Vala] Interpreting exit status
- Date: Sun, 5 May 2019 22:06:50 +0200
I presume that I have to use GLib.Subprocess instead of GLib.Process... Ok.
Thanks!
El 5/5/19 a las 20:08, Al Thomas via vala-list escribió:
> On Sunday, 5 May 2019, 15:36:38 BST, rastersoft <raster rastersoft com> wrote: > I have a little problem: I'm launching a process using
GLib.Process.spawn_async, and use g_child_add_watch() to receive the
exit status value....But waitpid documentation is not
very clear... Can I assume that the value set by the "exit()" call in
the spawned program is always stored in the upper 8 bits?
I can give some insight based on my own experience, which boils down to: - use GLib SubProcess - use the Open
Group documentation for anything that is unclear with POSIX (Unix)
https://valadoc.org/gio-2.0/GLib.Subprocess.get_exit_status.html states 'This is equivalent to the system
WEXITSTATUS macro' and http://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.htmlstates
'WEXITSTATUS(stat_val) If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order
8 bits of the status argumentthat the childprocess passed to _exit() or exit(), or the value the child
process returned from main()'
I hope that helps.
Al
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
--
Nos leemos
RASTER (Linux user #228804)
raster rastersoft com http://www.rastersoft.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]