Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does _r suffix mean?

Tags:

c++

c

typing

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?

like image 646
Zaffy Avatar asked Oct 27 '12 19:10

Zaffy


2 Answers

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".

like image 118
halex Avatar answered Sep 20 '22 23:09

halex


The _r suffix stands for reentrant.

like image 33
Olaf Dietsche Avatar answered Sep 21 '22 23:09

Olaf Dietsche