![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to start a process and make it sleep for 5 mins and then kill that process | shrao | Shell Programming and Scripting | 6 | 03-27-2007 12:54 PM |
| Process KILL | rkrgarlapati | Shell Programming and Scripting | 2 | 09-22-2006 05:07 AM |
| When kill doesnt work, how to kill a process ? | VijayHegde | UNIX for Advanced & Expert Users | 3 | 05-12-2006 04:24 PM |
| HP UX How to kill Process | prakashpichika | HP-UX | 5 | 02-10-2006 01:40 AM |
| who -uH, kill the process at different pts/tb | yls177 | UNIX for Dummies Questions & Answers | 3 | 12-11-2002 09:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
kill(0,-9) don't kill the process
Hi all
i have simple c program , when i wish to kill the app im using kill(0,-9) , but it seams this command don't do any thing and the program. just ignore it . what im doing wrong here ? im using HP-UX ia64 Thanks |
|
|||||
|
If you need killing a process from C programme, You will read about system call 'kill'.
http://www.freebsd.org/cgi/man.cgi?q...SE&format=html Best regards, Iliyan Varshilov Last edited by ilko_partizan; 06-19-2007 at 04:42 AM.. |
|
||||
|
hi
i have read it also read this : http://www.cs.cf.ac.uk/Dave/C/node24...00000000000000 that helped me understand this is my code: Code:
int k=kill(getpid(),-9); int r=raise(-9); that is it proform the kill command but failled , the question is why ? the getpid() also returns the right pid . so what can i do next ? how can i catch errno msg? what else i can do to understand what is wrong ? thanks |
|
|||||
|
You can get a error in string format from your programme with function 'strerror'.
This is part of code you needed: Code:
#include <errno.h> #include <stdio.h> fprintf(stderr, "Error: %s\n", strerror(errno)); http://www.freebsd.org/cgi/man.cgi?q...SE&format=html This man page describes 'strerror'. http://www.freebsd.org/cgi/man.cgi?q...SE&format=html Best regards, Iliyan Varshilov Last edited by ilko_partizan; 06-19-2007 at 04:07 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|