1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Ulrich Drepper
2009-11-24 18:50:32 -08:00
parent 0f622686af
commit aa9890239a
4 changed files with 38 additions and 21 deletions

View File

@ -9,6 +9,7 @@
/* Now define the internal interfaces. */
#ifndef __Need_M_And_C
# include <sys/stat.h>
__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);