LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2005, 09:41 AM   #16
vishamr2000
Member
 
Registered: Aug 2004
Posts: 210

Original Poster
Rep: Reputation: 31

Hi to all,

To Mara and sudhir_pandey...Many thx for the examples. They are helping me understand sigaction better.

However, i'm still facing some problems:

1) How can make a call to run Program2.c from inside Program1.c?

2) Program1 and Program2 are two separate C programs - Program1 is in kernel whereas Program is a user space program that I've written. How can I send a signal from program1 to Program2? Do I get the pid of Program2 when it is run and then issue a kill with the pid as argument? How do I get the pid of Program2 using C code? Is there a function where you provide the name of the .c file and it will return the pid?

Any input will be greatly appreciated as always...

Warm regards to you all,
Visham
 
Old 08-27-2005, 02:48 PM   #17
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
The two things are related. Everything depends on the thing what's program1 in fact. If it's a driver, you can add a new iocntl that will run the code. When writing code which supports iocntl (from the kernel side) you can get pid of the process that called it, so you can note it down somewhere.
 
Old 08-28-2005, 09:15 AM   #18
sudhir_pandey
LQ Newbie
 
Registered: Aug 2005
Posts: 5

Rep: Reputation: 0
hi vishamr2000

A process can know it's pid by executing cat /proc/self . Execute this command through your programme and you know the pid . also do man proc for more details .

bye
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ redirect program execution blizunt7 Programming 6 09-13-2005 12:09 PM
execution of one program inside of another microsoft/linux Programming 2 03-18-2005 10:24 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM
program execution at startup DeeDub Linux - Software 2 09-11-2003 01:25 PM
program execution monitoring imp Linux - General 1 05-26-2002 09:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration