user823738
user823738

Reputation: 17521

What does _r suffix mean?

I know _r suffix is used to indicate something thread-safe. For example strtok and strtok_r or libmysql.so and libmysql_r.so. But I cannot find anywhere what this actually means ? For example, _t means 'type' and what does _r suffix mean?

Upvotes: 7

Views: 2302

Answers (3)

halex
halex

Reputation: 16403

See Chapter A.4.16 Thread-Safety in http://pubs.opengroup.org/onlinepubs/000095399/xrat/xbd_chap04.html:

The suffix "_r" is historical, where the 'r' stood for "reentrant".

Upvotes: 12

ninjalj
ninjalj

Reputation: 43688

_r means reentrant, even though those functions may not be really reentrant. Those functions just guarantee not to use static storage.

Upvotes: 3

Olaf Dietsche
Olaf Dietsche

Reputation: 74028

The _r suffix stands for reentrant.

Upvotes: 5

Related Questions