if ((fd = open (videodevice, O_RDWR)) == -1) {
perror ("ERROR opening V4L interface \n");
exit (1);
}
.....
videochan.norm = norme;
videochan.channel = channel;
if (ioctl (fd, VIDIOCSCHAN, &videochan) == -1) {
printf ("ERROR setting channel and norme \n");
exit (1);
运行发生Segmentation fault
我用gdb远程调试确定问题是在那里
同样的程序在PC上可以正常运行,移植到开发板上就有了问题
我用了arm-linux-gcc 4 和3 编译都有问题
有趣的是相同的问题又发生在另一个程序里
fb_info_to_driver.Bpp = vinfo.bits_per_pixel ;
fb_info_to_driver.LeftTop_x = 0;
fb_info_to_driver.LeftTop_y = 0;
fb_info_to_driver.Width = destWidth;
fb_info_to_driver.Height = destHeight;
if (ioctl(dev_fb0, SET_OSD_INFO, &fb_info_to_driver)) {
printf("Some problem with the ioctl SET_VS_INFO!!!\n");
return -1;
}
运行报Some problem with the ioctl SET_VS_INFO!!! Segmentation fault
几乎一模一样的问题