On Thu, Jul 22, 2010 at 06:52:00PM -0400, Daniel Dickman wrote: > > sure. let me try. the problem is that right now i think env on OpenBSD > can return 4 ambiguous values: 0, 1, 126, 127. if any of these values > are returned i don't think it's possible to know if the value was > returned from env itself or from the underlying utility. (and in fact > according to what posix specifies, there really isn't any way to > portably determine if *any* return value came from env or from the > underlying utility.) >
ok, we need to separate the issue of the man page being wrong and code being wrong. i'm arguing only from the point of the man page... i don;t see that env returns any ambiguous values. if it's 1-125, it's from the app, unless you pass an invalid command line option to env, in which you get a 1 from env, not "utility". so, is there ambiguity in the man page? > the second problem, is that according to (my reading of posix) > something that uses env will expect a return value in the range of > 1-125 to mean "something went wrong in env" and 126 to mean "something > went wrong with invoking utility". but at the moment there are 2 > places in the code where 126 is returned where something went wrong in > env. > ok, that's for other people to discuss. > i'm hoping to try to make the man pages clearer about what > circumstances lead to what error codes and to spell out the > ambiguities a bit more clearly. > we spent a bit of time on exactly this section some time back trying to make it clear. if you can find some ambiguity, please let me know. jmc