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?
Asked
Active
Viewed 1,755 times
3 Answers
11
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".

halex
- 16,253
- 5
- 58
- 67
3
_r
means reentrant, even though those functions may not be really reentrant. Those functions just guarantee not to use static storage.

ninjalj
- 42,493
- 9
- 106
- 148
-
1See also the discussion in the comments of http://stackoverflow.com/a/8405940/371250 – ninjalj Oct 27 '12 at 19:29