[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    file locking
From:       Sergey Uvarov <uvarovsl () mail ! pnpi ! spb ! ru>
Date:       2005-07-27 23:48:34
Message-ID: 42E81D52.1020909 () mail ! pnpi ! spb ! ru
[Download RAW message or body]

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.

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic