Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2005 03:48:34 +0400
From:      Sergey Uvarov <uvarovsl@mail.pnpi.spb.ru>
To:        freebsd-hackers@freebsd.org
Subject:   file locking
Message-ID:  <42E81D52.1020909@mail.pnpi.spb.ru>

next in thread | raw e-mail | index | archive | help
Hello hackers,

man page for flock(2) and fcntl(2) reads that a system call returns 
EOPNOTSUPP if file descriptor refers to an object that does not support 
file locking.

However, it seems that it is not always true. For example, if underlying 
object is a device or a fifo returned error code depends on type of lock.

When I look at sources of VOP_ADVLOCK for fifo 
(sys/fs/fifofs/fifo_vnops.c, fifo_advlock() function) I see
the following line:

...
return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL);
...

I.e. for freebsd locks EOPNOTSUPP error code is returned. It is correct.
But for posix locks EINVAL error code is returned. Is it correct?

Thanks you in advance,
	Sergey.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42E81D52.1020909>