From aa9890239a2aef81e64f3f22a31c7e01b6501f69 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 24 Nov 2009 18:50:32 -0800 Subject: Optimize grantpt. grantpt was performing two consecutive calls to stat with the same file name. Avoid this by creating a special version of the ptsname function which allows to pass the stat result back to the caller. --- include/stdlib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/stdlib.h b/include/stdlib.h index d90e6ff4fe..f540bece9c 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -9,6 +9,7 @@ /* Now define the internal interfaces. */ #ifndef __Need_M_And_C +# include __BEGIN_DECLS @@ -77,6 +78,8 @@ extern int __clearenv (void); extern char *__canonicalize_file_name (__const char *__name); extern char *__realpath (__const char *__name, char *__resolved); extern int __ptsname_r (int __fd, char *__buf, size_t __buflen); +extern int __ptsname_internal (int fd, char *buf, size_t buflen, + struct stat64 *stp); extern int __getpt (void); extern int __posix_openpt (int __oflag); -- cgit v1.2.3