Fix linkage of grantpt(3).

Also clean up the implementation of all the pty functions, add tests,
and fix the stub implementations of ttyname(3) and ttyname_r(3).

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I0fb36438cd1abf8d4e87c29415f03db9ba13c3c2
This commit is contained in:
Elliott Hughes
2014-07-25 17:24:00 -07:00
parent 50a9630cc2
commit 4916706cfe
9 changed files with 184 additions and 169 deletions

View File

@@ -126,18 +126,12 @@ long random(void);
char* setstate(char*);
void srandom(unsigned int);
/* Basic PTY functions. These only work if devpts is mounted! */
extern int unlockpt(int);
extern char* ptsname(int);
extern int ptsname_r(int, char*, size_t);
extern int getpt(void);
static __inline__ int grantpt(int __fd __attribute((unused)))
{
(void)__fd;
return 0; /* devpts does this all for us! */
}
int getpt(void);
int grantpt(int);
int posix_openpt(int);
char* ptsname(int) __warnattr("ptsname is not thread-safe; use ptsname_r instead");
int ptsname_r(int, char*, size_t);
int unlockpt(int);
typedef struct {
int quot;