* uname() in mdoc_validate.c on Solaris @ 2011-03-31 10:04 Yuri Pankov 2011-03-31 10:23 ` Kristaps Dzonsons 0 siblings, 1 reply; 3+ messages in thread From: Yuri Pankov @ 2011-03-31 10:04 UTC (permalink / raw) To: discuss Hi, uname(2) on Solaris (OpenSolaris, OpenIndiana, Solaris 11 Express) states: RETURN VALUES Upon successful completion, a non-negative value is returned. Otherwise, -1 is returned and errno is set to indicate the error. Could we possibly change if (uname(&utsname)) { to if (uname(&utsname) == -1) { to make .Os without arguments work on these OSes? TIA, Yuri -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: uname() in mdoc_validate.c on Solaris 2011-03-31 10:04 uname() in mdoc_validate.c on Solaris Yuri Pankov @ 2011-03-31 10:23 ` Kristaps Dzonsons 2011-04-02 22:20 ` Ingo Schwarze 0 siblings, 1 reply; 3+ messages in thread From: Kristaps Dzonsons @ 2011-03-31 10:23 UTC (permalink / raw) To: discuss; +Cc: Yuri Pankov > uname(2) on Solaris (OpenSolaris, OpenIndiana, Solaris 11 Express) > states: > > RETURN VALUES > Upon successful completion, a non-negative value is > returned. Otherwise, -1 is returned and errno is set to > indicate the error. > > Could we possibly change > > if (uname(&utsname)) { > > to > > if (uname(&utsname) == -1) { > > to make .Os without arguments work on these OSes? Ingo, This surprises me, as I usually do (-1 == syscall()). And indeed, it seems this was lost in version 1.136 of mdoc_validate.c: http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_validate.c.diff?r1=1.135&r2=1.136&cvsroot=mdocml&f=h Is there a technical reason for this (according to the CVS log, I was merging your changes)? If not, I'll revert to the specific check for -1. Yuri, thanks for the note! Thanks, Kristaps -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: uname() in mdoc_validate.c on Solaris 2011-03-31 10:23 ` Kristaps Dzonsons @ 2011-04-02 22:20 ` Ingo Schwarze 0 siblings, 0 replies; 3+ messages in thread From: Ingo Schwarze @ 2011-04-02 22:20 UTC (permalink / raw) To: discuss; +Cc: Yuri Pankov Hi Kristaps, hi Yuri, Kristaps Dzonsons wrote on Thu, Mar 31, 2011 at 12:23:21PM +0200: > Yuri Pankov wrote: >> uname(2) on Solaris (OpenSolaris, OpenIndiana, Solaris 11 Express) >> states: >> >> RETURN VALUES >> Upon successful completion, a non-negative value is >> returned. Otherwise, -1 is returned and errno is set to >> indicate the error. Hm, indeed, that is not just Solaris, but POSIX, see here: http://pubs.opengroup.org/onlinepubs/9699919799/functions/uname.html > This surprises me, as I usually do (-1 == syscall()). And indeed, > it seems this was lost in version 1.136 of mdoc_validate.c: > > http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_validate.c.diff?r1=1.135&r2=1.136&cvsroot=mdocml&f=h > > Is there a technical reason for this (according to the CVS log, I > was merging your changes)? If not, I'll revert to the specific > check for -1. Actually, i did the change on purpose given the text in the OpenBSD uname(3) manual: RETURN VALUES If uname() is successful, 0 is returned; otherwise, -1 is returned and errno is set appropriately. Hence, i regarded requiring zero as safer. However, in view of the POSIX text, my change is clearly wrong. >> Could we possibly change >> >> if (uname(&utsname)) { >> >> to >> >> if (uname(&utsname) == -1) { >> >> to make .Os without arguments work on these OSes? Yes. Kristaps, please go ahead. > Yuri, thanks for the note! Indeed, and sorry for inadvertently introducing a POSIX violation. Yours, Ingo -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-02 22:20 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-03-31 10:04 uname() in mdoc_validate.c on Solaris Yuri Pankov 2011-03-31 10:23 ` Kristaps Dzonsons 2011-04-02 22:20 ` Ingo Schwarze
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).