Shutdown qnx6.x with C-code from user apps ?
10/06/2017 10:46
hi all,know anyone, how i can shutdown a qnx6.x system with c-code ?i look for a sample like this for QNX4 thank you /*----------------------------------------------------------------------------*/ static void shutdown(void){struct sched_param param;sigset_t bits;union{struct _proc_shutdown s;struct _proc_shutdown_reply r;}msg; qnx_sync(getnid()); bits=~0L; sigprocmask(SIG_BLOCK,&bits,0); msg.s.type=_PROC_SHUTDOWN; msg.s.signum=SIGPWR; Send(PROC_PID,&msg.s,&msg.r,sizeof(msg.s),sizeof(msg.r)); sleep(2); param.sched_priority=PRIO_FIFO_MAX; sched_setscheduler(0,SCHED_FIFO,¶m);}/*----------------------------------------------------------------------------*/ void halt(void){shutdown();while(1) Yield();}/*----------------------------------------------------------------------------*/ void reboot(void){union { struct _proc_shutdown s; struct _proc_shutdown_reply r; }msg;shutdown();msg.s.type=_PROC_SHUTDOWN;msg.s.signum=-1; // RestartSend(PROC_PID,&msg.s,&msg.r,sizeof(msg.s),sizeof(msg.r));}/*----------------------------------------------------------------------------*/

Source is Usenet: comp.os.qnx
Sign in to add a comment

Answer score: 5
10/06/2017 10:46 - Chris McKillop <cdm@qnx.com> wrote in messagenews:bdsa60$ds3$1@nntp.qnx.com...

I.E. You may want to sund a message or a signal to your own processes sothey can flush out any data *BEFORE* the filesystem shuts down.


Source is Usenet: comp.os.qnx
Sign in to add a comment

Answer score: 5
10/06/2017 10:46 - Try using sysmgr_reboot(). However, this will not take care of cleanlykilling all the processes on the system. It simply reboots the machine.

chris

Source is Usenet: comp.os.qnx
Sign in to add a comment

eDiscover
Helpforce eDiscover provides technical articles updated each dayHelpforce eDiscover RSS feed contains the latest technical articles in RSS
Click the logo to go back to the main page
Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS

Type your comment into the box below