Index: include/stdlib.h =================================================================== --- include/stdlib.h +++ include/stdlib.h @@ -225,7 +225,6 @@ long nrand48(unsigned short[3]); int posix_openpt(int); char *ptsname(int); -int ptsname_r(int, char *, size_t); int putenv(char *); long random(void); unsigned short @@ -237,6 +236,7 @@ #endif /* __XSI_VISIBLE */ #if __BSD_VISIBLE +int ptsname_r(int, char *, size_t); extern const char *malloc_conf; extern void (*malloc_message)(void *, const char *); Index: lib/libc/stdlib/Symbol.map =================================================================== --- lib/libc/stdlib/Symbol.map +++ lib/libc/stdlib/Symbol.map @@ -122,10 +122,10 @@ }; FBSD_1.6 { + ptsname_r; qsort_s; rand; srand; - ptsname_r; }; FBSDprivate_1.0 { Index: lib/libc/stdlib/ptsname.c =================================================================== --- lib/libc/stdlib/ptsname.c +++ lib/libc/stdlib/ptsname.c @@ -71,12 +71,8 @@ __strong_reference(__isptmaster, grantpt); __strong_reference(__isptmaster, unlockpt); -/* - * ptsname_r(): return the pathname of the slave pseudo-terminal device - * associated with the specified master. - */ -int -ptsname_r(int fildes, char *buffer, size_t buflen) +static int +__ptsname_r(int fildes, char *buffer, size_t buflen) { if (buflen <= sizeof(_PATH_DEV)) { @@ -101,6 +97,18 @@ return (0); } +/* + * ptsname_r(): return the pathname of the slave pseudo-terminal device + * associated with the specified master. + */ +#pragma weak ptsname_r +int +ptsname_r(int fildes, char *buffer, size_t buflen) +{ + + return (__ptsname_r(fildes, buffer, buflen)); +} + /* * ptsname(): return the pathname of the slave pseudo-terminal device * associated with the specified master. @@ -108,10 +116,10 @@ char * ptsname(int fildes) { - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN]; + static char pt_slave[sizeof(_PATH_DEV) + SPECNAMELEN]; - if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) + if (__ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) return (pt_slave); - else - return (NULL); + + return (NULL); }