pci_attach using QNX IDE (non-root)

OK, I figured out why I cannot do a pci_attach while developing under the
IDE in QNX. Although I can’t find it documented anywhere it appears
pci_attach will only succeed if you are running as root user (makes sense).
Unfortunately, you cannot use the IDE as root user. So the question is:
what is the best way to develop/debug code using the pci_* functions and the
Momentics IDE. Can I do a setuid(0) in my code?

Dave G.

Dave G. <~~~dkg@ormec.com> wrote:

OK, I figured out why I cannot do a pci_attach while developing under the
IDE in QNX. Although I can’t find it documented anywhere it appears
pci_attach will only succeed if you are running as root user (makes sense).
Unfortunately, you cannot use the IDE as root user. So the question is:
what is the best way to develop/debug code using the pci_* functions and the
Momentics IDE. Can I do a setuid(0) in my code?

Setup qconn on your local machine and debug via it. Run qconn as root.

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

As a related/follow-up question - I want my end users to log in as non-root
users so that they cannot get access to crucial parts of the filesystem, but
I want them to be able to run an application that accesses the pci bus. What
is the preferred solution to this problem?

Jim

“Dave G.” <~~~dkg@ormec.com> wrote in message
news:b2g22m$t7k$2@inn.qnx.com

OK, I figured out why I cannot do a pci_attach while developing under the
IDE in QNX. Although I can’t find it documented anywhere it appears
pci_attach will only succeed if you are running as root user (makes
sense).
Unfortunately, you cannot use the IDE as root user. So the question is:
what is the best way to develop/debug code using the pci_* functions and
the
Momentics IDE. Can I do a setuid(0) in my code?

Dave G.

Either have a separate PCI-accessing process that runs with root privileges
and make your application communicate with that, or make the application
itself “setuid root” and code it such that it acquires and relinquishes its
PCI-accessing privileges carefully. Read up on the chmod command and the
setuid() library routine if you don’t know what I’m talking about - these
are standard Unixisms. The QNX Help pages on this are only rather minimal
reference material on this important subject, so be prepared to do some
outside searching and studying!

dB

“Jim Douglas” <jim@dramatec.co.uk> wrote in message
news:b2lu82$m6f$1@inn.qnx.com

As a related/follow-up question - I want my end users to log in as
non-root
users so that they cannot get access to crucial parts of the filesystem,
but
I want them to be able to run an application that accesses the pci bus.
What
is the preferred solution to this problem?

Jim

“Dave G.” <~~~> dkg@ormec.com> > wrote in message
news:b2g22m$t7k$> 2@inn.qnx.com> …
OK, I figured out why I cannot do a pci_attach while developing under
the
IDE in QNX. Although I can’t find it documented anywhere it appears
pci_attach will only succeed if you are running as root user (makes
sense).
Unfortunately, you cannot use the IDE as root user. So the question is:
what is the best way to develop/debug code using the pci_* functions and
the
Momentics IDE. Can I do a setuid(0) in my code?

Dave G.

\