Re: strerror(0) POSIX compliance

2016-03-24 Thread James K. Lowden
On Thu, 24 Mar 2016 17:09:50 + (UTC) chris...@astron.com (Christos Zoulas) wrote: > >IMO it's incorrect to say 0 is an "undefined error". It's defined as > >success by nearly every syscall. The emitted string should reflect > >that, even if [sic] Posix says so. Perhaps, > > Actually not;

Re: pidfile_lock(3)

2016-03-24 Thread Steffen Nurpmeso
Hi. "James K. Lowden" wrote: |mlel...@serpens.de (Michael van Elst) wrote: |> r...@marples.name (Roy Marples) writes: |>>See here: |>>http://mail-index.netbsd.org/tech-userlevel/2016/03/21/msg009799.html Well, btw., the MUA i maintain forks, keeping a communication pipe to its parent, then c

Re: strerror(0) POSIX compliance

2016-03-24 Thread Michael van Elst
jklow...@schemamania.org ("James K. Lowden") writes: >> Well, if calling strerror(0) is a bug, then usually because it's >> called after an error condition that didn't set errno. >Has that happened to you? I feel sure that's never happened to me, but >maybe I'm less adventurous. Happened all

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 05:09:50PM +, Christos Zoulas wrote: > Actually not; syscalls set errno on error, don't clear errno on success [1]. > Thus it is incorrect code to test errno if the syscall succeeded. It shows > nothing, try: Actually, it is even worse. errno is essentially *undefined*

Re: strerror(0) POSIX compliance

2016-03-24 Thread Christos Zoulas
In article <20160324125858.516aa36bc70bddd1b180e...@schemamania.org>, James K. Lowden wrote: >On Thu, 24 Mar 2016 14:29:39 + (UTC) >mlel...@serpens.de (Michael van Elst) wrote: > >> >(I agree that calling strerror(0) is odd and a likely sign of a bug, >> >but that's separate from complying wit

Re: strerror(0) POSIX compliance

2016-03-24 Thread James K. Lowden
On Thu, 24 Mar 2016 14:29:39 + (UTC) mlel...@serpens.de (Michael van Elst) wrote: > >(I agree that calling strerror(0) is odd and a likely sign of a bug, > >but that's separate from complying with standards when compliance > >isn't harmful.) > > Well, if calling strerror(0) is a bug, then usu

Re: pidfile_lock(3)

2016-03-24 Thread James K. Lowden
On Thu, 24 Mar 2016 07:18:13 + (UTC) mlel...@serpens.de (Michael van Elst) wrote: > r...@marples.name (Roy Marples) writes: > > >See here: > >http://mail-index.netbsd.org/tech-userlevel/2016/03/21/msg009799.html > > ... handling crashing programs reliably > > isn't a worthwhile goal to me.

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 09:56:47AM -0400, Greg Troxel wrote: > > Joerg Sonnenberger writes: > > > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: > >> -BEGIN PGP SIGNED MESSAGE- > >> Hash: SHA256 > >> > >> POSIX extension to ISO C says: > >> > >> [CX] [Option Start] I

NLM (was: pidfile_lock(3))

2016-03-24 Thread Edgar Fuß
> POSIX file locking over NFS [...] relies on userspace daemons on > client and server which just never seem to work all that well. Or are plain missing on your favourite OS. Sigh.

Re: strerror(0) POSIX compliance

2016-03-24 Thread Michael van Elst
g...@ir.bbn.com (Greg Troxel) writes: >Why do you find it questionable? If POSIX says the string must be empty >or indicate there is no error, what's wrong with following POSIX? >(I agree that calling strerror(0) is odd and a likely sign of a bug, but >that's separate from complying with standar

Re: pidfile_lock(3)

2016-03-24 Thread Thor Lancelot Simon
On Thu, Mar 24, 2016 at 11:55:25AM +, Roy Marples wrote: > Lets go back to the original question. > > On 20/03/2016 09:26, Michael van Elst wrote: > > r...@marples.name (Roy Marples) writes: > > > >> So I've created pidfile_lock (patch attached) to address these problems. > > > > Does it wor

Re: strerror(0) POSIX compliance

2016-03-24 Thread Greg Troxel
Joerg Sonnenberger writes: > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA256 >> >> POSIX extension to ISO C says: >> >> [CX] [Option Start] If the value of errnum is a valid error number, >> the message string shall indica

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > POSIX extension to ISO C says: > > [CX] [Option Start] If the value of errnum is a valid error number, > the message string shall indicate what error occurred; if the value of

Re: pidfile_lock(3)

2016-03-24 Thread Roy Marples
On 24/03/2016 12:47, Michael van Elst wrote: > r...@marples.name (Roy Marples) writes: > >> If it doesn't work on NFS and you care so much, please spend your time >> fixing NFS > > If you want to change things you should not try to pass your responsibility > to someone else. But with regards to

Re: pidfile_lock(3)

2016-03-24 Thread Michael van Elst
r...@marples.name (Roy Marples) writes: >If it doesn't work on NFS and you care so much, please spend your time >fixing NFS If you want to change things you should not try to pass your responsibility to someone else. -- -- Michael van Elst Internet: mlel...@serp

Re: strerror(0) POSIX compliance

2016-03-24 Thread Roy Marples
On 24/03/2016 12:04, Jonathan A. Kollasch wrote: > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: >> POSIX extension to ISO C says: >> >> [CX] [Option Start] If the value of errnum is a valid error number, >> the message string shall indicate what error occurred; if the value of

Re: strerror(0) POSIX compliance

2016-03-24 Thread Jonathan A. Kollasch
On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: > POSIX extension to ISO C says: > > [CX] [Option Start] If the value of errnum is a valid error number, > the message string shall indicate what error occurred; if the value of > errnum is zero, the message string shall either be a

Re: strerror(0) POSIX compliance

2016-03-24 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 24.03.2016 12:49, Kamil Rytarowski wrote: > POSIX extension to ISO C says: > > [CX] [Option Start] If the value of errnum is a valid error > number, the message string shall indicate what error occurred; if > the value of errnum is zero, the mess

Re: pidfile_lock(3)

2016-03-24 Thread Roy Marples
Lets go back to the original question. On 20/03/2016 09:26, Michael van Elst wrote: > r...@marples.name (Roy Marples) writes: > >> So I've created pidfile_lock (patch attached) to address these problems. > > Does it work on NFS root? After taking on board what everyone has said, my considered a

strerror(0) POSIX compliance

2016-03-24 Thread Kamil Rytarowski
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 POSIX extension to ISO C says: [CX] [Option Start] If the value of errnum is a valid error number, the message string shall indicate what error occurred; if the value of errnum is zero, the message string shall either be an empty string or indicate

Re: pidfile_lock(3)

2016-03-24 Thread Michael van Elst
r...@marples.name (Roy Marples) writes: >See here: >http://mail-index.netbsd.org/tech-userlevel/2016/03/21/msg009799.html ... handling crashing programs reliably isn't a worthwhile goal to me. -- -- Michael van Elst Internet: mlel...@serpens.de