/* Prototype for private function that gets the name of the slave
pseudo terminal in a safe way. */
static int pts_name (int fd, char **pts, size_t buf_len);
-
+extern __typeof(statfs) __libc_statfs;
#endif
/* Change the ownership and access permission of the slave pseudo
terminal associated with the master pseudo terminal specified
by FD. */
int
+#if !defined __ASSUME_DEVPTS__
grantpt (int fd)
+#else
+grantpt (attribute_unused int fd)
+#endif
{
#if !defined __ASSUME_DEVPTS__
struct statfs fsbuf;
-# ifdef PATH_MAX
char _buf[PATH_MAX];
-# else
- char _buf[512];
-# endif
char *buf = _buf;
if (pts_name (fd, &buf, sizeof (_buf)))
return -1;
-
- if (statfs (buf, &fsbuf) < 0)
+
+ if (__libc_statfs (buf, &fsbuf) < 0)
return -1;
/* If the slave pseudo terminal lives on a `devpts' filesystem, the