Possible error in Beejs guide to IPC document
- From: Guru <guru.jois@xxxxxxxxx>
- Date: Thu, 9 Jul 2009 02:00:27 -0700 (PDT)
Hi,
My query is for Unix IPC. In the document "Beej's guide to Unix Inter
Process Communication",
( http://beej.us/guide/bgipc/output/html/singlepage/bgipc.html#flockset
) , section 6.1 - "Setting a lock", 4th paragraph, Beej says:
" The next step is to open() the file, since flock() needs a file
descriptor of the file that's being locked. Note that when you open
the file, you need to open it in the same mode as you have specified
in the lock, as shown in the table, below. If you open the file in the
wrong mode for a given lock type, open() will return EBADF."
I think he meant to say fcntl() will return EBADF. Because open()
accept the path and returns a file descriptor which we input to fcntl
(), and if the mode of opening down's match, fcntl() should return
error EBADF. How can open() return EBADF.
Also open is a call which returns file descriptor and fcntl() is a
call which accept a file descriptor. There is no error called EBADF in
open() man page,, but it is in fcntl().
I tried mailing Beej about this error, but didn't get any reply, nor
the error was corrected
Please comment on it or let me know if I'm wrong.
Cheers,
Guru
.
- Follow-Ups:
- Re: Possible error in Beejs guide to IPC document
- From: Beej Jorgensen
- Re: Possible error in Beejs guide to IPC document
- Prev by Date: Re: changing filename
- Next by Date: Localization & Internationalization for C Application on UNIX
- Previous by thread: ◑﹏◐♀﹌♀Wholesale Jeans (Prada,RMC,G-star,Cavalli,Icebe-rg,Levis,Coogi,BBC,Laguna,True Religion ect)---www.fjrjtrade.com ♀﹌♀
- Next by thread: Re: Possible error in Beejs guide to IPC document
- Index(es):
Relevant Pages
|