#include <unistd.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/ioctl.h>
#define LDISC_N_SLCAN 17 /* default slcan line discipline since Kernel 2.6.25 */
#define LDISC_N_SLCAN 17 /* default slcan line discipline since Kernel 2.6.25 */
int send_close = 0;
char *speed = NULL;
char *btr = NULL;
int send_close = 0;
char *speed = NULL;
char *btr = NULL;
}
if (ioctl (fd, TIOCSETD, &ldisc) < 0) {
}
if (ioctl (fd, TIOCSETD, &ldisc) < 0) {
+ perror("ioctl TIOCSETD");
+
+ if (ioctl (fd, SIOCGIFNAME, buf) < 0) {
+ perror("ioctl SIOCGIFNAME");
+ exit(1);
+ } else
+ printf("attached tty %s to netdevice %s\n", tty, buf);