Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 230 forks source link

status codes #1082

Open DanGrayson opened 4 years ago

DanGrayson commented 4 years ago

The functions "run" and "wait" have return values that are hard to use and not as informative as they could be, and they didn't even work all that well until commit ab6b03b8679d909b975f071c6d6142f09846131a, commit d02d853c1fad2445fdc13e65ea82989aea0074fd, and commit 0304da334de3cfb7ee9e224741240a857a03ee5c. Perhaps better than returning a single integer would be to return a list {status code, signal number, whether core was dumped, whether process was stopped, whether process was continued}. The man page for waitpid describes the macros that can get all that information.

Then we should also consider replacing use of the "system" command with something that is more aggressive about not running /bin/sh to run the command, because then not all the information is available. Someone must have already written that in some GNU code, so maybe we could get it.

mahrud commented 4 years ago

The first commit is potentially going to conflict with some simplifications I'm working on (for instance changes to M2lib.c here). Using pull requests would make things easier, if it's the same for you, for instance as a part of #1073 which I presume will be affected by this.