On Wed, 2010-09-22 at 16:03 -0700, Keith Packard wrote:
> On Wed, 22 Sep 2010 16:10:49 -0400, Adam Jackson <[email protected]> wrote:
> 
> > +static struct pci_io_handle *
> > +pci_device_freebsd_open_legacy_io(struct pci_io_handle *ret,
> > +                                  struct pci_device *dev, pciaddr_t base,
> > +                                  pciaddr_t size)
> > +{
> > +    ret->fd = open("/dev/io", O_RDWR);
> > +
> > +    if (ret->fd < 0)
> > +   return NULL;
> > +
> > +    ret->base = base;
> > +    ret->size = size;
> > +
> > +    return ret;
> > +}
> 
> That's a terrible API. Is this fixed in stone somewhere? Or can it just
> return an error indication instead of NULL?

This isn't app API, this is just the backend talking to the frontend.
The external API is pretty similar.

libpciaccess in general doesn't really attempt to encode why an API call
would fail; the caller is assumed to have whatever privileges it needs
and to look at errno for any details.  Fixable, I suppose, but now
you're in soname bump territory for not a lot of win.

- ajax

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to