Reentrant Interfaces [ DCE for the HP 3000 ] MPE/iX 5.0 Express III Documentation
DCE for the HP 3000
Reentrant Interfaces
Many /lib/libc.a (POSIX C Library) routines return pointers to internal
static data. This causes problems in a multithreaded program; while one
thread tries to access the data another thread could be modifying it in
some way.
The following are interfaces that should be called by multithreaded
programs. These versions of the interfaces are different from the
original versions.
The reentrant definitions currently defined in /lib/libc.a are:
opendir_r readdir_r getgrgid_r getgrnam_r
getpwnam_r getwpuid_r getlogin_r
In addition, the following are provided as part of /usr/lib/libdce.a on
the HP 3000:
asctime_r crypt_r ctime_r ecvt_r
fcvt_r gmtime_r l64a_r localtime_r
There are four reentrant routines that are not defined in the
DCE/3000 header files. To use them, add the following lines to the
/usr/include/time.h file, just before the last line (#endif /*
_TIME_INCLUDED */). For example,
# ifdef _REENTRANT
extern int asctime_r(const struct tm *, char *, int);
extern int ctime_r(const time_t *, char *, int);
extern int gmtime_r(const time_t *, struct tm *);
extern int localtime_r(const time_t *, struct tm *);
# endif /* _REENTRANT */
MPE/iX 5.0 Express III Documentation