Menu

ioctl FBIO_OSD_CMD alway return !=0

2009-09-28
2013-04-22
  • Nobody/Anonymous

    ioctl FBIO_OSD_CMD alway return !=0
    fbfd = open("/dev/fb1", O_RDWR);
            if (!fbfd) {
                printf("Error: cannot open framebuffer device.\n");
                exit(1);
            }
            printf("The framebuffer device was opened successfully.\n");
    if( ioctl(fbfd,FBIO_OSD_CMD,FB_OSD_SHOW)!=0) printf("set osd show false\n");

     
  • Sergey Kostyuk

    Sergey Kostyuk - 2009-10-03

    No ideas.
    Check that you use last svn-revision.
    Whats the error code (see errno) ioctl returns?

    This my code is working quite well

        #include <stdio.h>
        #include <sys/types.h>
        #include <sys/stat.h>
        #include <fcntl.h>
        #include <sys/ioctl.h>
        #include <linux/types.h>
        #include "linux/sigma/quasar.h"

        int main(int argc, char *argv)
        {
            int fd, st;
            struct quasar_osd_screeninfo osd;
            osd_command_t cmd;

            fd = open("/dev/fb1", O_RDONLY);
            if (fd == -1) {
                    perror("open:");
                    return 0;
            }

            st = atoi(argv);
            if (st)
                    cmd = FB_OSD_SHOW;
            else
                    cmd = FB_OSD_HIDE;
            if (ioctl(fd, FBIO_OSD_CMD, &cmd) != 0) {
                    perror("ioctl:");
                    return 0;
            }
            return 1;
        }

     
  • Nobody/Anonymous

    it's ok .
       ioctl(fd, FBIO_OSD_CMD, &cmd)
    i make a mistake

     

Log in to post a comment.

MongoDB Logo MongoDB