View topic - LookupPrivilegeValue in QNX

Page 1 of 1

LookupPrivilegeValue in QNX

PostPosted: Thu Feb 25, 2010 10:04 am
by anvesh
Hi All,
I need to migrate some requirements from windows to QNX. As per one requirement process have privileges to shutdown,backup,restore entire system and windows code has used LookupPrivilegeValue API for granting privileges. My doubt are,

1. Is there any way in QNX to shutdown entire system using application.
2. Is there any equilivalent for windows specific API LookupPrivilegeValue in QNX.

RE: LookupPrivilegeValue in QNX

PostPosted: Sat Feb 27, 2010 7:16 pm
by maschoen
1. system("shutdown");

2. Check whether the process is root?

RE: LookupPrivilegeValue in QNX

PostPosted: Tue Mar 02, 2010 7:48 am
by garyritu
Thanks maschoen it worked and system rebooted after using this API.

RE: LookupPrivilegeValue in QNX

PostPosted: Tue Mar 02, 2010 4:17 pm
by maschoen
Just to be clear, system("shutdown") just runs a shell as in:

# sh shutdown

and shutdown is program that shuts the system down.