NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Garmin gps tracker: libusb i/o error

On Mon, Mar 08, 2010 at 07:50:32AM -0500, Greg Troxel wrote:
> Try the 1.3.7 beta.  A lot of forerunner stuff has been spiffed up.
> But that's probably not it.

It's not a gpsbabel problem, it fails within a libusb call (usb_bulk_write).
The usb_bulk_write routine is implemented differently on *BSD and Linux.

Here's the BSD code:

int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
                   int timeout)
  int fd, ret;

  /* Ensure the endpoint address is correct */

  fd = ensure_ep_open(dev, ep, O_WRONLY);
  if (fd < 0) {
    if (usb_debug >= 2) {
      fprintf (stderr, "usb_bulk_write: got negative open file descriptor
                for endpoint %02d\n", UE_GET_ADDR(ep));
    return fd;

  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
  if (ret < 0)
    USB_ERROR_STR(-errno, "error setting timeout: %s",

  ret = write(fd, bytes, size);
  if (ret < 0)
    USB_ERROR_STR(-errno, "error writing to bulk endpoint %s.%02d: %s",
                dev->device->filename, UE_GET_ADDR(ep), strerror(errno));

  return size;

It's the write(3) call that fails with errno 5 (EIO).  I have no idea how
to debug this.


Geert Hendrickx  -=-  -=-  PGP: 0xC4BB9E9F
This e-mail was composed using 100% recycled spam messages!

Attachment: pgpBDmu9xAwyB.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index