Hi ,
     Yes...the error is EACCESS. But can you change the access rights of
block devices in the /dev folder?. In my case it  /dev/scsi is with
brw-rw---  access rights. Will it not cause trouble if I do so?

With Warm Regards,
Sunil

----- Original Message -----
From: "Prabhat Tyagi , Gurgaon" <[EMAIL PROTECTED]>
To: "Sunil S" <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 4:05 PM
Subject: RE: [ilugd] How to execute open & ioctl in User mode?


Hi Sunil,
You can always use open system call with any user. After the open just see
the errno. I assume it would be EACCESS. Just see the permisiion of
/dev/scsi file. If its a symbolic link then see the  file permission of the
actual linked file.


Cheers
Prabhat


-----Original Message-----
From: Sunil S [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 2:28 PM
To: [EMAIL PROTECTED]
Subject: [ilugd] How to execute open & ioctl in User mode?


Hi everyone,
    Is there any way by which one can use the 'open' system call in a
program to access the device file descriptor in user mode? For  example

......
.....
int fd = open('/dev/scsi', _RONLY);
if (fd != -1)
{
   printf("Error");

}
else
{
   int handle;
   ioctl(fd,SCSI_IOCTL_GET_BUS_NO, &handle);
   ..........
   ..........
}
........
......
the above piece of code works well when executed with root user.

Is there any way by which you can execute the program in user mode.

Regards,
Sunil
_______________________________________________
ilugd mailing list
[EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd




_______________________________________________
ilugd mailing list
[EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to