Languages

Menu
Sites
Language
How to load process name?

I can search process id using c api but how can I search current process name in tizen?

I want to distinguish what app include my library in runtime and pid is different each run so I think I can use process name.

Are there a way to search process name?

Responses

3 Replies
Shaswati Saha

Hello,

According to my findings, there's no API to get process name as PID till now. I've found that Application Manager API provides functions to get PID and App ID only but not process name.

Shaswati Saha

Hi,

Instead of using process name, you may try a workaround to do this. Generate logs along with the ID of current application inside all the functions provided by your lib. it'll work as a marker of the uses of the lib as well. After that, create a text file in the media directory and write the logs in that file. Now, from the other app which will be working as a detector read that text file and extract the required information.

N.B: Functionality to create a text file in media directory and writing log data in that should be integrated with the lib.

Carsten Haitzler

open the /proc/self/* files. e.g /proc/self/cmdline. /proc/self/exe will be a symlink to the executable...  so open("/proc/self/cmdline", ...); and read the file output (read()) and close fd when done... this is a normal Linux system in this way... :) or should be... sdb is broken for me right now to check... hmmm :/ GRRR. SDB.