Hi all,
I've read many emails in several groups and learned that interrupts
can interrupt low level system calls.
But I could not find out what low level system calls are.
Is there anybody who can help me?
Jrgen
I've read many emails in several groups and learned that interrupts
can interrupt low level system calls.
But I could not find out what low level system calls are.
Is there anybody who can help me?
Jrgen
> I've read many emails in several groups and learned that interrupts
> can interrupt low level system calls.
> But I could not find out what low level system calls are.
As an example, say you wanted to use the write call, writing 4k of
data. An interrupt could happen before the write begins and cause
a return code of -1 (errno=EINTR) or part of the way through
returning say 2100.
karl.
> > Hi all,
> > I've read many emails in several groups and learned that interrupts
> > can interrupt low level system calls.
> > But I could not find out what low level system calls are.
> It's the ones provided by the kernel, and nicely wrapped up in glibc.
> Look in section 2 of the man pages, calls like read, write, send,
> select etc. These calls can block or spend a significant amount of
> time and can be interrupted. Calls like kill don't because they
> don't block per se.
> As an example, say you wanted to use the write call, writing 4k of
> data. An interrupt could happen before the write begins and cause
> a return code of -1 (errno=EINTR) or part of the way through
> returning say 2100.
> What do I have to do when a write-call returns a number which is not
> exact the number of bytes as I wanted to send (like your example).
> Have I to send the rest of the bytes with a new write-call?
one.Quote:> Ok this would be no problem, but then two datastrings are made of
possibly, while you may issue two write calls of say 2k each,
invariably those get split upto into packets for transmission MTU
being 1500 say means like 1400odd bytes first then 600 next, but
if a second write has occured before the second packet is sent then
it can be more the 600 bytes.
yes.Quote:> The same thing happens if the read-call is interrupted!
You won't receive more than is sent, but you have to determine theQuote:> My applikation doesn't know how many bytes are sent so it gets two
> datastrings but only one was sent!
> How can I handle these problems?
read - partial datastring1
read - rest of datastring1 and bit of datastring2
read - rest of datastring2
karl.
> >> As an example, say you wanted to use the write call, writing 4k of
> >> data. An interrupt could happen before the write begins and cause
> >> a return code of -1 (errno=EINTR) or part of the way through
> >> returning say 2100.
> > What do I have to do when a write-call returns a number which is not
> > exact the number of bytes as I wanted to send (like your example).
> > Have I to send the rest of the bytes with a new write-call?
> typically yes, but there maybe non-blocking file descriptors (like
> sockets) which will mean a busy loop which you don't want.
> > Ok this would be no problem, but then two datastrings are made of
> one.
> possibly, while you may issue two write calls of say 2k each,
> invariably those get split upto into packets for transmission MTU
> being 1500 say means like 1400odd bytes first then 600 next, but
> if a second write has occured before the second packet is sent then
> it can be more the 600 bytes.
How can I get out of these three datastrings the two correctQuote:> > My applikation doesn't know how many bytes are sent so it gets two
> > datastrings but only one was sent!
> > How can I handle these problems?
> You won't receive more than is sent, but you have to determine the
> syntax of the reads. It's a parsing problem. It's possible that with
> 2 data strings, you'll get
> read - partial datastring1
> read - rest of datastring1 and bit of datastring2
> read - rest of datastring2
Jrgen
Well thats a problem of parsing, ie do you know the length of theQuote:>> You won't receive more than is sent, but you have to determine the
>> syntax of the reads. It's a parsing problem. It's possible that with
>> 2 data strings, you'll get
>> read - partial datastring1
>> read - rest of datastring1 and bit of datastring2
>> read - rest of datastring2
> How can I get out of these three datastrings the two correct
> datastrings?
karl.
1. GETSERVBYNAME()????????????????????"""""""""""""
Hi,
Does anyone know why
struct servent *serv;
serv=getservbyname("exec","tcp");
gives a warning err of incomparible pointer type?
I also can't get rexec to function. It compiles ok....
Thanks
Kirk
2. Creating Attractive App. Icons
3. what system call is used for "trcnm" and "genkex"?
5. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""
6. GCOS field in /etc/passwd file
7. Help me with "errno=EINTR Interrupted system call"
8. Printing to lpq from Win3.1???
9. fetchmail reporting "interrupted system call"
10. "Interrupted System Call"?
11. interrupted system call on "poll"
12. "Interrupted system call" by SIGALRM