Segfault on port operation
Vance Shipley
vances@REDACTED
Thu Feb 27 20:24:35 CET 2003
Luke,
You should declare the driver_int function using this macro:
DRIVER_INIT(tun_driver) {
...
}
The function tun_init() is redundant for a dynamically linked driver.
It is called after the driver is loaded (i.e. after driver_init()).
There are of course many functions missing from your driver entry.
Notably you have no function for sending data to the port. :)
-Vance
On Thu, Feb 27, 2003 at 06:43:22PM +0100, Luke Gorrie wrote:
}
} That aside, can someone tell me if the following code is initializing
} the linked-in driver entry correctly?
}
} ErlDrvEntry tun_driver_entry;
}
} ErlDrvEntry *driver_init(void)
} {
} memset(&tun_driver_entry, 0, sizeof(tun_driver_entry));
} tun_driver_entry.init = tun_init;
} tun_driver_entry.start = tun_start;
} tun_driver_entry.stop = tun_stop;
} tun_driver_entry.ready_input = tun_input;
} tun_driver_entry.control = tun_ctl;
} tun_driver_entry.driver_name = "tun_drv";
} return &tun_driver_entry;
} }
}
} Cheers,
} Luke
}
More information about the erlang-questions
mailing list