LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   detect process attached to devices (https://www.linuxquestions.org/questions/linux-newbie-8/detect-process-attached-to-devices-734739/)

linux_newbie79 06-22-2009 06:16 AM

detect process attached to devices
 
Hi All,

How to find the process's that were attached to devices. For example, if we open ttyS driver from user space application, is it possible to get the process id by examining the /proc of the devices? If yes, how?

Thanks in Advance

bathory 06-22-2009 06:56 AM

You can use lsof to find the PID of the process that uses the serial port:
Code:

lsof|grep ttyS
Then under /proc/<PID> you'll find more details about that process.

Regards


All times are GMT -5. The time now is 12:37 PM.