%% “CG” <exai17@yahoo.de> writes:
Think of this:
I really cannot check my username in qnx!
Try
env | grep USER
env | grep LOGNAME
or in a C application
username = getenv(“USER”);
logname = getenv(“LOGNAME”);
None of these is the best way. They rely on the environment, which
anyone can change to anything. Maybe that’s OK with you; maybe not.
If you want to know the current user info in a way that can’t be faked,
then from the shell you want to use the id command:
$ id
uid=390(psmith) gid=500(shasta)
From a program, you want to use the geteuid() function to get your
effective user ID, then give that to getpwuid() to get back the user’s
passwd entry.
See the QNX reference manuals for info on these utilities and functions.
c> Thank you. That helps! But… i would not have had to ask, if …
If… what?
It’s completely ridiculous to expect QSSL to provide user documentation
for a UNIX system–why should they? There are books galore out there,
a number of them better than anything QSSL would write anyway, which
describe how to use UNIX boxes from a user perspective, how to program
in both UNIX and POSIX, etc. etc. Go out and buy one. Or two.
QNX is not a complete UNIX clone (and that’s not really it’s goal), so
don’t expect every single little thing to work identically, but I doubt
you’ll find much that doesn’t.
QSSL provides pretty reasonable docs for the specific parts of their
system which aren’t standard: building BSPs, etc. etc. They also
provide quite good reference material, in HTML format. All the
functions are documented, with error return codes, etc. and many with
examples of their use.
One major benefit to basing your system on existing standards, after
all, is that you don’t need to worry so much about documentation! After
20+ years of UNIX and 10+ years of POSIX, why should QSSL spend valuable
resources writing Yet Another Manual?
–
Paul D. Smith <pausmith@nortelnetworks.com> HASMAT–HA Software Mthds & Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad Scientist
These are my opinions—Nortel Networks takes no responsibility for them.