Re: System Calls and I/O Parameter Reinitialization



Barry Margolin <barmar@xxxxxxxxxxxx> writes:

In article <1P2dnb4LrZWMsXbanZ2dnUVZ_sOrnZ2d@xxxxxxxxxxxx>,
Aaron Hsu <arcfide@xxxxxxxxxxx> wrote:

Say that we take the set of system calls or built in procedures provided
by a UNIX, which could include libraries and the like in POSIX and
others. Then, say that we consider the subset of these calls that can or
could potentially be interruptable. Ones that come to mind immediately
are things like WAIT, functions that return EINTR, &c.

For this set of functions, I will have some that take input or output
parameters, such as pointers to structures or variables that are going
to either be read for input or used to store output values, such as a
pointer to an integer that stores the count of what was read or stored.

Say then, that a function like the above is interrupted. What kind of
Gurantee on a UNIX system do I have on the integrity of these I/O
Parameters? That is, is there any guarantee that I will not have to
reinitialize these parameters when I restart the call? I'm looking both
for the normal case as well as fringe cases like Cygwin or the like. For
example, if a call to a funtion that has a count pointer into which is
stored the amount of data transferred or something of the like, is
interrupted, can I be absolutely sure, from a conservative point of
view, that the count variable is reliable and does not need to be
reinitialized before restarting the call?

I'm having trouble understanding what you're asking about. Are you
asking from the perspective of a USER of the system calls, or as an
IMPLEMENTOR?

I am asking as an user of the system calls. I want to ensure that the
code I write is ``well-behaved'' over all the UNIX platforms, and this
is one issue I would like to ensure I am doing right.
--
Aaron Hsu <arcfide@xxxxxxxxxxx> | Jabber: arcfide@xxxxxxxxxx
``Government is the great fiction through which everybody endeavors to
live at the expense of everybody else.'' - Frederic Bastiat
.



Relevant Pages

  • Re: System Calls and I/O Parameter Reinitialization
    ... pointer to an integer that stores the count of what was read or stored. ... Gurantee on a UNIX system do I have on the integrity of these I/O ... reinitialize these parameters when I restart the call? ...
    (comp.unix.programmer)
  • System Calls and I/O Parameter Reinitialization
    ... pointer to an integer that stores the count of what was read or stored. ... Gurantee on a UNIX system do I have on the integrity of these I/O ... reinitialize these parameters when I restart the call? ...
    (comp.unix.programmer)
  • Re: Great SWT Program
    ... For example, the unix way presents a simpler naming system, perhaps, ... I'm not sure the unix architecture actually *forces* things like ports ... "Restart X" means restart ... also the option of putting the towers on desks, ...
    (comp.lang.java.programmer)
  • Re: Plz explain me the following code
    ... So, dereferencing a NULL pointer on Unix can't launch nuclear missiles, since Unix says it should SEGV. ... The only way I can imagine such a guarantee working would be for ...
    (comp.lang.c)
  • Re: System Calls and I/O Parameter Reinitialization
    ... pointer to an integer that stores the count of what was read or stored. ... Gurantee on a UNIX system do I have on the integrity of these I/O ... of system implementors enough to assume that they understand why 'the ...
    (comp.unix.programmer)