This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] Add the bfd_iovec


Andrew Cagney <cagney@gnu.org> writes:

> > * I'm not crazy about the berror entry point.  Right now it is used in
> >   exactly one place, to indicate whether a short read is an error or
> >   simply a truncated file.  Since bfd_iovec is only going to be called
> >   by BFD routines, I think it would be quite reasonable to make the
> >   bread entry point responsible for calling bfd_set_error.  Then the
> >   caller does not need to go back in to find out what a short read
> >   means.  Note also that berror is the only function which doesn't
> >   have an obvious mapping to a Unix system call.
> 
> There are three cases here:
> 
> - error
> - eof
> - partial read (as in the next read should yield more data)
> 
> I guess BFD isn't set up for partial transfers and retrys so the third
> case doesn't apply?

Yes.  Or, to put it another way, the bread routine should be
responsible for handling partial reads, if they are possible for the
underlying I/O structure.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]