From: Thomas Schwinge Date: Fri, 26 Jan 2018 22:35:29 +0000 (+0000) Subject: t/grantpt X-Git-Tag: archive/raspbian/2.26-6+rpi1^2~161 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=34fd69cd6a76187099f0e1afbfe06678dff7dc7a;p=glibc.git t/grantpt /media/Stalin/tmp/glibc.hurd.gnu-2/libc_pic.os: In function `pts_name': /media/data/home/thomas/tmp/source/glibc/git/glibc.hurd/login/../sysdeps/unix/grantpt.c:52: undefined reference to `__ptsname_internal' collect2: ld returned 1 exit status make[1]: *** [/media/Stalin/tmp/glibc.hurd.gnu-2/libc.so] Error 1 Cf. aa9890239a2aef81e64f3f22a31c7e01b6501f69 Need any of the checks (stat, etc.) that Linux' __ptsname_internal does? Implement close_all_fds as in 139ee080b6b428240bf49f3e6361f3ac729f891a? Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name tg-grantpt.diff --- diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c index 7625aeed9..8578c7910 100644 --- a/sysdeps/mach/hurd/ptsname.c +++ b/sysdeps/mach/hurd/ptsname.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -38,11 +39,10 @@ ptsname (int fd) } -/* Store at most BUFLEN characters of the pathname of the slave pseudo - terminal associated with the master FD is open on in BUF. - Return 0 on success, otherwise an error number. */ +/* We can't make use of STP, but do it that way for conformity with the Linux + version... */ int -__ptsname_r (int fd, char *buf, size_t buflen) +__ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp) { string_t peername; size_t len; @@ -61,4 +61,14 @@ __ptsname_r (int fd, char *buf, size_t buflen) memcpy (buf, peername, len); return 0; } + + +/* Store at most BUFLEN characters of the pathname of the slave pseudo + terminal associated with the master FD is open on in BUF. + Return 0 on success, otherwise an error number. */ +int +__ptsname_r (int fd, char *buf, size_t buflen) +{ + return __ptsname_internal (fd, buf, buflen, NULL); +} weak_alias (__ptsname_r, ptsname_r)