This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: ecos and gettimeofday()
On Thu, Oct 20, 2005 at 10:06:17AM +0100, Nick Garnett wrote:
> Andrew Lunn <andrew@lunn.ch> writes:
>
> > > Additionally I'd like to move the rest of misc.c into its own
> > > CYGPKG_POSIX_MISC component, but I haven't figured out yet what
> > > cyg_posix_function_start() and cyg_posix_function_finish() exactly do.
> > > What are they required for ?
> >
> > Good question. They are only used in the io/fileio. They are called
> > when entering or existing all fileio functions.
> >
> > They disable and enable ASR. Why i don't know. That is a question for
> > Nick...
>
> They are used mainly to control the delivery of signals.
>
> As far as the POSIX standard is concerned, most IO calls are atomic,
> reflecting their implementation in Unix as system call traps. In eCos
> these calls are often composed of a sequence of calls on other
> subsystems. If a signal handler is delivered at an arbitrary point, it
> may longjump out, or make other calls which will leave some
> unsuspecting eCos subsystem with inconsistent data structures. To
> avoid this the sensitive functions use cyg_posix_function_start() and
> _finish() to block ASR and signal delivery.
>
> Any signals that get queued for a thread will only be delivered during
> the _finish() call, although the thread may still be knocked out of
> any wait it is in regardless of the subsystem it is currently
> executing.
Hi Nick
Thanks for the explanation.
What i don't understand now is why only the fileio package uses these
functions. I would of expected at least the functions in the POSIX
package to also use these.
What am i missing?
Thanks
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss