Re: My way to check if a progam is already running
- From: Jan Panteltje <pNaonStpealmtje@xxxxxxxxx>
- Date: Mon, 25 Jun 2007 21:49:29 GMT
On a sunny day (Mon, 25 Jun 2007 14:31:06 -0700) it happened David Schwartz
<davids@xxxxxxxxxxxxx> wrote in
<1182807066.946422.180340@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
On Jun 25, 4:10 am, Jan Panteltje <pNaonStpealm...@xxxxxxxxx> wrote:
EAGAIN means test again, and I have tested this soft and forced the
EAGAIN condition.
Unless (we still have to look at the lockf() source) EAGAIN is used wrongly,
the loop is correct.
I have see errno values been used wrongly before.
It is just playing safe.
Err, what?! EAGAIN does not mean "test again", it means the file is
locked. Since that was what you wanted to know, ...
You seem *extremely* confused.
Na, it says:
F_TEST Test the lock:
return 0 if the specified section is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds a lock.
Not a word on the other error codes here, but further down:
ERRORS
EAGAIN The file is locked and F_TLOCK or F_TEST was specified,
or the operation is prohibited because the file has been memory mapped by another process.
etc for other errors.
I guess there are several ways one can read that man 3 lockf.
That is why one should look at the source.
So, basically if lockf returns -1 and errno is not EACCESS then some problem must exists.
I have tried several varieties of the code, both testing for EACCES and testing for EAGAIN.
I suggest you try some before you criticise,
Else it is just untried blabber.
.
- Follow-Ups:
- Re: My way to check if a progam is already running
- From: David Schwartz
- Re: My way to check if a progam is already running
- References:
- My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Michal Nazarewicz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: Rainer Weikusat
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: David Schwartz
- My way to check if a progam is already running
- Prev by Date: Re: My way to check if a progam is already running
- Next by Date: Re: My way to check if a progam is already running
- Previous by thread: Re: My way to check if a progam is already running
- Next by thread: Re: My way to check if a progam is already running
- Index(es):
Relevant Pages
|