Re: error with system() command: Resource temporarily unavailable

From: Arti Potnis (artpot78_at_yahoo.com)
Date: 07/07/04


Date: 6 Jul 2004 23:01:07 -0700

steven_nospam@yahoo.ca (Steve N.) wrote in message news:<a7f2ae7e.0407060712.4b795ba6@posting.google.com>...
> artpot78@yahoo.com (Arti Potnis) wrote in message news:<ece8ea46.0407060151.1efe110b@posting.google.com>...
> <snip>
> > We are running a C program on AIX version 4.3 and calling an exe using
> > the system command.
> > This returns with errno=11 Resource temporarily unavailable
> > the same command runs fine on the shell prompt.
> > thanks in advance
> > Arti
>
> What does your C program do (or supposed to do)? Does it try to access
> a tape drive, CDROM, network card, etc? I usually get the "Resource
> temporarily unavailable" when I try to run a backup command (tar,
> cpio, etc) on a tape drive that is already in use by another backup or
> restore.
>
> In other words, you are trying to access a resource on the system that
> is limited to maybe one PID using it at a time. By calling the exe
> within the C program, perhaps both are trying to use the same resource
> (one opens it but does not release it before the other tries to access
> it).
>
> HTH.
>
> Steve

------------------------------------------------------------------------------
Our C program is calling a c++ exe (myprog.exe).
The exe does the following:-

-It opens a text file,reads it line by line and checks if the
parameter passed to the program exists in the line.
-If it exists it deletes the line.
-To delete the line it just stores the lines not containing the
parameter in a vector,opens the text file again in write mode (so that
it gets truncated) and writes the contents of the vector to the file.

I'm getting this problem in a number of other places too.For instance
there is a program which runs a
system("grep -i 'pattern' myfile")
If the pattern exists it returns the result but if it doesn't then it
returns errno=11.
No other program accesses the file being grepped.

--------------------------------------------------------------------------------



Relevant Pages

  • Re: error with system() command: Resource temporarily unavailable
    ... > the system command. ... > the same command runs fine on the shell prompt. ... I usually get the "Resource ... By calling the exe ...
    (comp.unix.aix)
  • Re: Simple program not producing output
    ... Pasted the MSDN code into this code file. ... When to a command shell, located the exe. ... public static void PrintValues ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Simple program not producing output
    ... Pasted the MSDN code into this code file. ... When to a command shell, located the exe. ... public static void PrintValues ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Shell Functions and DOS executables
    ... I had to create a .BAT file that actually made the call to the exe, ... Dim wshExec As IWshRuntimeLibrary.wshExec ... I followed the above and the DOS command executes perfectly! ...
    (microsoft.public.vb.general.discussion)
  • Re: Alternate file types for RUN ?
    ... Some of my programs are actually invoked with the RUN command without ... you rename the resulting .EXE into .EXE_VAX ... alternate extension. ... $ show symb arch ...
    (comp.os.vms)