summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2020-10-20 01:29:45 +0000
committerXin LI <delphij@FreeBSD.org>2020-10-20 01:29:45 +0000
commit5011fb430a898f8ef4f53f4ae2034d029cd388c0 (patch)
tree2e8cf93c74ff5112ccd9fcf0b8d83b3f387c5b3c
parentbce74ff0ce287821c77de88ccd679031a17c65fb (diff)
Notes
-rw-r--r--include/stdlib.h14
-rw-r--r--lib/libc/stdlib/Symbol.map2
-rw-r--r--lib/libc/stdlib/ptsname.c12
3 files changed, 18 insertions, 10 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index b09517751e8d8..045a9fda9cfb7 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -211,7 +211,6 @@ double drand48(void);
double erand48(unsigned short[3]);
/* char *fcvt(double, int, int * __restrict, int * __restrict); */
/* char *gcvt(double, int, int * __restrict, int * __restrict); */
-int grantpt(int);
char *initstate(unsigned int, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
@@ -223,9 +222,6 @@ char *mktemp(char *);
#endif
long mrand48(void);
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
@@ -233,8 +229,18 @@ unsigned short
char *setstate(/* const */ char *);
void srand48(long);
void srandom(unsigned int);
+#endif /* __XSI_VISIBLE */
+
+#if __XSI_VISIBLE
+int grantpt(int);
+int posix_openpt(int);
+char *ptsname(int);
int unlockpt(int);
#endif /* __XSI_VISIBLE */
+#if __BSD_VISIBLE
+/* ptsname_r will be included in POSIX issue 8 */
+int ptsname_r(int, char *, size_t);
+#endif
#if __BSD_VISIBLE
extern const char *malloc_conf;
diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map
index 3d8657f1c6a07..2be23390e333d 100644
--- a/lib/libc/stdlib/Symbol.map
+++ b/lib/libc/stdlib/Symbol.map
@@ -122,10 +122,10 @@ FBSD_1.5 {
};
FBSD_1.6 {
+ ptsname_r;
qsort_s;
rand;
srand;
- ptsname_r;
};
FBSDprivate_1.0 {
diff --git a/lib/libc/stdlib/ptsname.c b/lib/libc/stdlib/ptsname.c
index 247c02a6002b0..6851d3d765555 100644
--- a/lib/libc/stdlib/ptsname.c
+++ b/lib/libc/stdlib/ptsname.c
@@ -76,7 +76,7 @@ __strong_reference(__isptmaster, unlockpt);
* associated with the specified master.
*/
int
-ptsname_r(int fildes, char *buffer, size_t buflen)
+__ptsname_r(int fildes, char *buffer, size_t buflen)
{
if (buflen <= sizeof(_PATH_DEV)) {
@@ -101,6 +101,8 @@ ptsname_r(int fildes, char *buffer, size_t buflen)
return (0);
}
+__strong_reference(__ptsname_r, ptsname_r);
+
/*
* ptsname(): return the pathname of the slave pseudo-terminal device
* associated with the specified master.
@@ -108,10 +110,10 @@ ptsname_r(int fildes, char *buffer, size_t buflen)
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);
}