Menu

why open em8xxx0 segmentation fault

liloyu
2009-09-18
2013-04-22
  • liloyu

    liloyu - 2009-09-18

    i want to get stc
    here is my code

     
      
        #include <stdlib.h>
        #include <stdio.h>
        #include <asm/types.h>
        #include <linux/sigma/em8xxx.h>
        #include <sys/ioctl.h>
        #include <fcntl.h>
        #include <sys/time.h>
        #include <unistd.h>
       
        int main( int argc, char *argv)
        {
        int fd_sigma=-1;
        fd_sigma = open("/dev/sigma/em8xxx0", O_RDWR);
                if (fd_sigma != -1) {
           printf("open sigma em8xxx device error\n");
           return 1;
                }
        struct sigma_time sigmatime;
        struct timeval tv;
                gettimeofday(&tv,NULL);
                //sigmatime.time= (__u64)tv.tv_sec*10000+(__u64)tv.tv_usec/100;
        //ioctl(fd_sigma, SGMIOCTL_DECODER_GET_SYSTEM_CLOCK, &sigmatime);
        //printf("time is %x\n",sigmatime.time);
        close(fd_sigma);
        return 0;
        }

     
  • Sergey Kostyuk

    Sergey Kostyuk - 2009-09-26

    Fixed

     

Log in to post a comment.

MongoDB Logo MongoDB