tags:

views:

25

answers:

1

What's the difference between the getmypid() and the posix_getpid() functions?

I turned to getmypid() because my script has to run both on Windows and on Linux.

+2  A: 

It seems the main difference is what you said :

I guess the second one exists to be kinda POSIX-compliant (if there are others POSIX functions, why not this one ? )

So, if you want your code to be portable, you'll use the first one -- as you did.

Pascal MARTIN