<p>Is there a way of getting the process id of my C++ application? I am using the Carbon framework, but not Cocoa…</p>

[{'answer_id': 41710, 'author': 'John Boker', 'author_id': 2847, 'author_profile': 'https://Stackoverflow.com/users/2847', 'pm_score': 4, 'selected': True, 'text': '<p>can you use the getpid() function found in unistd.h ?</p>\n\n<p><a href="https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpid.2.html" rel="nofollow noreferrer">osx reference</a></p>\n'}, {'answer_id': 43722, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>GetProcessPID is what you need. This takes a ProcessSerialNumber, which you can obtain from GetCurrentProcess.</p>\n'}, {'answer_id': 61751, 'author': 'Nicholas Riley', 'author_id': 6372, 'author_profile': 'https://Stackoverflow.com/users/6372', 'pm_score': 1, 'selected': False, 'text': "<p>Note that you don't actually need to call GetCurrentProcess, you can use the constant kCurrentProcess.</p>\n\n<p>(But getpid is a lot less work if you're not trying to access another process's PID, anyway.)</p>\n"}]
['https://Stackoverflow.com/questions/41676', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/259/']