Earlier quoted context omitted.
CyberRabbi's definition of blocking is correct and what I've always seen commonly accepted. Blocking means you don't know how long it'll take, and you want to wait for it to finish. The only safe assumption is that you cannot guarantee how long it'll take. getpid is accurately therefore a blocking call. You don't know how long it'll take. You can profile and make best guesses, but you can never assuredly say how long…
Every operation in a non-RTOS is blocking by this definition, even local function calls that don’t enter the kernel, because the kernel may switch to another thread at any time. It’s utterly useless as a definition. Much more common is to divide system calls into ones that call depend on some external actor and those that don’t. Eg, recv() on a socket, blocking on a futex held by some other process, or waiting on IO…
E.g if you do this inside a function (useless code)
int pid = getpid(); std::cout Will the output print even if the hypothetical call to getpid takes a second?
If the answer is the print will wait, then it's a blocking call.
If it was an async call, then it could happen concurrently or in parallel, and unless you waited, it would continue on in a non blocking fashion.
Waiting for a return == blocking. It may be quick but unless the spec specifies that it must be synchronous+non-blocking, the distinction between the two is moot.