[comp.unix.questions] errno question

ok@quintus (12/08/88)

What is the difference between EDEADLK and EDEADLOCK?

daveh@marob.MASA.COM (Dave Hammond) (12/11/88)

In article <827@quintus.UUCP> ok@quintus writes:
>What is the difference between EDEADLK and EDEADLOCK?

EDEADLK specifies a kernel deadlock condition; EDEADLOCK specifies
a file locking deadlock.

--
Dave Hammond
...!uunet!masa.com!{marob,dsix2}!daveh

eirik@tekcrl.TEK.COM (Eirik Fuller) (12/13/88)

In article <415@marob.MASA.COM> daveh@marob.masa.com (Dave Hammond) writes:
) In article <827@quintus.UUCP> ok@quintus writes:
) >What is the difference between EDEADLK and EDEADLOCK?
) 
) EDEADLK specifies a kernel deadlock condition; EDEADLOCK specifies
) a file locking deadlock.
) 

And this, of course, was obvious to anyone who knows how to spell.

:-) :-)

guy@auspex.UUCP (Guy Harris) (12/14/88)

>EDEADLK specifies a kernel deadlock condition; EDEADLOCK specifies
>a file locking deadlock.

Err, umm, the only place I could find EDEADLK used in the S5R3 or S5R3.1
kernel is in the file-locking code, where it's used to indicate -
surprise! - a file locking deadlock, and I couldn't find *any* uses of
EDEADLOCK.  Unless there's some obscure POSIX-related stuff here, I
think some code-slinger just got confused....

ok@quintus.uucp (Richard A. O'Keefe) (12/14/88)

In article <704@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes:
>>EDEADLK specifies a kernel deadlock condition; EDEADLOCK specifies
>>a file locking deadlock.
>
>Err, umm, the only place I could find EDEADLK used in the S5R3 or S5R3.1
>kernel is in the file-locking code, where it's used to indicate -
>surprise! - a file locking deadlock, and I couldn't find *any* uses of
>EDEADLOCK.  Unless there's some obscure POSIX-related stuff here, I
>think some code-slinger just got confused....

I was the one who asked the original question.
The background is that I was trying to write some code that handled some
errors, and found that not only was the set of 'errno' values different
from UNIX to UNIX, but that the same error in the same system call might
produce different 'errno' values from allegedly related UNIX ports.
(For example, compare the reaction to character codes 128..255 in file
names.)  This got me interested in errno.h generally, and I produced a
sort of Hexapla of errnos (actually an Octopla, but what the heck).  The
next step was to try to figure out what some of the newer errno values
mean.  And in S5R3 I came across
	#define EDEADLK    ~~~	{Deadlock condition}
	#define EDEADLOCK  ~~~  {File locking deadlock error}
Oh *PEST*.  I just noticed that on one of our V.3 systems the two
names are bound to different numbers, but on another they are bound
to the same number and both glossed as {Deadlock condition}.  SunOS
4.0 has only EDEADLK, glossed as {Deadlock condition}.  So it looks
as though EDEADLK is a V.3 thing, and EDEADLOCK is more recent than
that.  Presumably "some obscure POSIX-related stuff"...

Just for extra-special fun, Ultrix 2.0-1 defines EDEADLK as an alias
for EWOULDBLOCK and glosses it as {resource deadlock would occur}.
(The only mention of it is as a result of F_SETLK in fcntl(2).)

Gosh, this is more fun than kissing a cactus.

wescott@sauron.Columbia.NCR.COM (Mike Wescott) (12/14/88)

In article <704@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes:
> >EDEADLK specifies a kernel deadlock condition; EDEADLOCK specifies
> >a file locking deadlock.
> 
> Err, umm, the only place I could find EDEADLK used in the S5R3 or S5R3.1
> kernel is in the file-locking code ... used to indicate ... a file locking
> deadlock, and I couldn't find *any* uses of EDEADLOCK.

The S5R3.2 sys/errno.h shows:

#define	EDEADLK	45	/* Deadlock condition.			*/

/* Convergent Error Returns */
#define EDEADLOCK 56	/* file locking deadlock error		*/

And the corresponding man page only talks about EDEADLK being related
to file locking.  EDEADLOCK is not mentioned.  I would guess that EDEADLOCK
is cruft left around from a Convergent port.
-- 
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM

guy@auspex.UUCP (Guy Harris) (12/16/88)

>Oh *PEST*.  I just noticed that on one of our V.3 systems the two
>names are bound to different numbers, but on another they are bound
>to the same number and both glossed as {Deadlock condition}.  SunOS
>4.0 has only EDEADLK, glossed as {Deadlock condition}.  So it looks
>as though EDEADLK is a V.3 thing, and EDEADLOCK is more recent than
>that.  Presumably "some obscure POSIX-related stuff"...

SunOS's use probably dates back to 3.2, which picked up the locking code
from S5R2.  I don't have S5R2 source handy, so I don't know whether
EDEADLOCK existed in S5R2 or not; in the S5R3.1 source from AT&T,
they have different values.

Nevertheless, the S5R3.1 code still uses EDEADLK to report file-locking
deadlocks, not EDEADLOCK (the reference to "obscure POSIX-related stuff"
was made because I don't have 1003.1 handy and don't know what POSIX
specifies as the deadlock return code - if it even specifies it at all). 

guy@auspex.UUCP (Guy Harris) (12/16/88)

>/* Convergent Error Returns */
>#define EDEADLOCK 56	/* file locking deadlock error		*/

Yup, that's in S5R3.1's <sys/errno.h> too, with the same comment; I'd
just done a quick "grep" and didn't see the "Convergent" stuff.

>And the corresponding man page only talks about EDEADLK being related
>to file locking.  EDEADLOCK is not mentioned.  I would guess that EDEADLOCK
>is cruft left around from a Convergent port.

I would agree.  It's probably in AT&T's releases as a left-over from the
days of the 7300/3B1, which was a Convergent box.  I hope CTIX now uses
EDEADLK; I would suspect they do.

bdb@becker.UUCP (Bruce Becker) (12/18/88)

In article <1448@sauron.Columbia.NCR.COM> wescott@sauron.Columbia.NCR.COM (Mike Wescott) writes:
>In article <704@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes:
> [...]
>The S5R3.2 sys/errno.h shows:
>
>#define	EDEADLK	45	/* Deadlock condition.			*/
>
>/* Convergent Error Returns */
>#define EDEADLOCK 56	/* file locking deadlock error		*/
>
>And the corresponding man page only talks about EDEADLK being related
>to file locking.  EDEADLOCK is not mentioned.  I would guess that EDEADLOCK
>is cruft left around from a Convergent port.
>-- 
>	-Mike Wescott
>	 mike.wescott@ncrcae.Columbia.NCR.COM



From CTIX 3.5.1 on AT&T 3B1 (approximately System V release 2):

/* Convergent Error Returns */
[...]
#define EDEADLOCK 56	/* file locking deadlock error		*/
[...]
#ifndef BASSLOCKING
#define ENOLCK 58	/* no more locks available		*/
#define EDEADLK 59	/* file locking deadlock error		*/
#endif



Cheers,
-- 
Bruce Becker        Toronto, Ont.
Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu, becker@ziebmef.UUCP
BitNet:   BECKER@HUMBER.BITNET
"Paranoia is its own reward" - Lyon Bullroarey, honorary American