Operating System - HP-UX
1830919 Members
1850 Online
110017 Solutions
New Discussion

Re: Help with Error message please

 
Gaetano_1
New Member

Help with Error message please

Hello, we are a development house that, uses oracle and a product called uniface for our application. I created a script to import records using uniface's import utility called idf. I had a filesize limitation problem, so I introduced named pipes to gzip the trx files and gunzip to import them. I recieved an error message during the import of one of our tables data. "Interrupted system call" from this point it hung. The command that was issued through the script is
gnuzip < tablename.trx.gz > tablename.trx &
sleep
then the import of the trx using the uniface import utility. My question is, is this a system level error, that requires any kernel parameter modifications, or is this erro message not related to kernel or processes?
4 REPLIES 4
Ollie R
Respected Contributor

Re: Help with Error message please

Hi Gaetano,

I don't really understand your usage of the "gunzip" command here.

To achieve the same results as your command you could simply use:
"gunzip tablename.trx"

Is there something special you need to do by using redirected STDIN and STDOUT?

Ollie.
To err is human but to not award points is unforgivable
doug hosking
Esteemed Contributor

Re: Help with Error message please

Interrupted system calls are quite common, and usually nothing to worry about, if your applications are written correctly. They are not a sign of any kernel tuning problem. Many applications get this error and deal with it so transparently that you never see it. If your program aborts with this error, it usually means that you need to make a minor code change to restart reads if they fail with an EINTR error.

If you typed ^C or ^\ in frustration when the application appeared to hang, you might have indirectly caused that error message to appear.

The 'interrupted system call' message corresponds to the EINTR error code from a system call. Quoting from the manual page for
read(2):

If a read() is interrupted by a signal before it reads any data, it will return -1 with errno set to [EINTR].

Quoting from the manual page for errno(2):

[EINTR] Interrupted system call. An asynchronous signal (such as interrupt or quit), which the user has elected to catch, occurred during a system call. If execution is
resumed after processing the signal, it will appear as if the interrupted system call returned this error condition unless the system call is restarted (see sigvector(2)).

A sample program:
Compile and run this, then type ^C after
it starts but before typing anything else:

#include
#include
#include

/* Define a handler to trap ^C when typed but do nothing */

void
handler(int n)
{
}

main(int argc, char *argv[])
{
char buf[100]; /* a buffer for read */
signal(SIGINT, handler); /* catch ^C */
/* read 100 bytes from tty */
/* and complain if can't complete read */
if (read(0, &buf, 100) != 100)
perror("read");/* show error reason */
}

When run, if I type ^C the program
replies:

read: Interrupted system call

Intelligent programs will often test the result from the read() and restart the read silently if they encounter this error.


Gaetano_1
New Member

Re: Help with Error message please

Thank you all for your answers, I did make a minor change to my shell script, and Im not sure if that was the cause, but my script and update finished sucessfully without any errors. I simply added the sleep after feeding the pipe before doing the actuall import.

Thanks again

Ps. thank you for all the c but unfortunatly thats just like japaneese to me. Never really had the time to sit and learn C. Its on my list of things to do before I pass.
Gaetano_1
New Member

Re: Help with Error message please

The gunzip is only feeding a named pipe, thats why you see < > the named pipe name is tablename.trx, created with the mkfifo command. hence to put feed of this pipe. gunzip < tablename.trx.gx > tablename.trx. I did find a solution to my problem though thank you.