In alt_up_pci_lib.c I have an ioctl call. retval = ioctl(fd, ALT_UP_IOCTL_DMA_ADD, &handler) where fd is pointing to /dev/alt_up_pci0, ALT_UP_IOCTL_DMA_ADD is defined in alt_up_pci_ioctl.h as ALT_UP_IOCTL_DMA_ADD _IOWR(ALT_UP_IOC_MAGIC, 1, struct alt_up_ioctl_arg) (ALT_UP_IOC_MAGIC being 'A', alt_up_ioctl_arg has rw_bar_no,dma_controller_id, use_interrupt, *user_buffer_addr, dma_rw_slave_addr,dma_length_byte, to_device) and handler is providing device id, user buffer addr, dma id, dma rw slave addr, length of byte, to device to alt_up_ioctl_args. These codes are provided by altera. I am trying to run the test program which uses alt_up_pci_lib. It is failing because ioctl is returning -1. I have also checked the possible error situations of ioctl but I have no clue what is wrong in this program. Please help me to fix this issue.