![]() |
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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
can anyone tell me the program about how to implement a routine similar to getpid() in C program without using the function getpid(). ie. the program has to find out the pid of the process without using the getpid command. Please do help me in this regards at the earliest.
|
|
||||
|
Where I come from, getpid() is a system call. Anything that gets it is going to be using getpid() to do so, eventually; there's nothing below it to use.
If a simply less direct method will do, check if you've got /proc/self on your system -- it'll be a symlink to /proc/<pid#> |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|