Re: My way to check if a progam is already running



On a sunny day (Mon, 25 Jun 2007 16:57:19 -0700) it happened David Schwartz
<davids@xxxxxxxxxxxxx> wrote in
<1182815839.808132.9630@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:

On Jun 25, 2:49 pm, Jan Panteltje <pNaonStpealm...@xxxxxxxxx> wrote:

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.

In other words, some other process is using the file. This is exactly
what you were testing for, so you have your answer.

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.

Your code is broken. EAGAIN gives you your answer, there is no reason
to retry.

DS

No my code works perfectly, immediately.
What is broken or at least illogical is their use of errno.
;-)
.



Relevant Pages

  • Re: My way to check if a progam is already running
    ... or the operation is prohibited because the file has been memory ... EAGAIN gives you your answer, there is no reason ... to retry. ...
    (comp.os.linux.development.apps)
  • Re: Memory overcommit
    ... When preparing KSM unmerge to handle OOM, I looked at how the precedent ... of the same size as physical memory, ... But this is then liable to hang the system if there's some reason ... But badness() reckons ...
    (Linux-Kernel)
  • Re: Memory overcommit
    ... When preparing KSM unmerge to handle OOM, I looked at how the precedent ... of the same size as physical memory, ... by the poor decisions the OOM killer made. ... But this is then liable to hang the system if there's some reason ...
    (Linux-Kernel)
  • Re: A Rash of STOP errors.. what does it all mean? (D1,3D,C2,FE,50,7F, death)
    ... up to pull up the diagnostic boot ... addition of 1GB of memory and an HP webcam. ... poss Reason: faulty driver/buggy s/w ... Hardware failures are the most common cause (many dozen KB ...
    (microsoft.public.windowsxp.help_and_support)
  • [PATCH -mm 1/5] Freezer: Document relationship with memory shrinking
    ... allocate memory after freeing it for the hibernation image, ... The majority of these are user space processes, but if any of the kernel threads ... The second reason is to prevent user space processes and some kernel threads ... +memory and we need to do that before ...
    (Linux-Kernel)