Mercurial > gnulib
annotate lib/ptsname_r.c @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
16067 | 1 /* Determine name of the slave side of a pseudo-terminal. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
17125
diff
changeset
|
2 Copyright (C) 1998, 2002, 2010-2013 Free Software Foundation, Inc. |
16067 | 3 |
4 This program is free software: you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 3 of the License, or | |
7 (at your option) any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
16 | |
17 #include <config.h> | |
18 | |
19 #include <stdlib.h> | |
20 | |
21 #include <errno.h> | |
16940
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
22 #include <fcntl.h> |
16067 | 23 #include <string.h> |
24 #include <sys/stat.h> | |
25 #include <unistd.h> | |
26 | |
27 #ifdef _LIBC | |
28 # include <paths.h> | |
29 #else | |
30 # ifndef _PATH_TTY | |
31 # define _PATH_TTY "/dev/tty" | |
32 # endif | |
33 # ifndef _PATH_DEV | |
34 # define _PATH_DEV "/dev/" | |
35 # endif | |
36 | |
37 # define __set_errno(e) errno = (e) | |
38 # define __isatty isatty | |
39 # define __stat stat | |
40 # define __ttyname_r ttyname_r | |
41 # define __ptsname_r ptsname_r | |
42 | |
43 #endif | |
44 | |
16942
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
45 #ifdef __sun |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
46 /* Get ioctl() and 'struct strioctl'. */ |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
47 # include <stropts.h> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
48 /* Get ISPTM. */ |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
49 # include <sys/stream.h> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
50 # include <sys/ptms.h> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
51 /* Get the major, minor macros. */ |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
52 # include <sys/sysmacros.h> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
53 # include <stdio.h> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
54 #endif |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
55 |
16945
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
56 #if defined _AIX || defined __osf__ |
16944
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
57 /* Get ioctl(), ISPTM. */ |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
58 # include <sys/ioctl.h> |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
59 /* Get the major, minor macros. */ |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
60 # include <sys/sysmacros.h> |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
61 # include <stdio.h> |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
62 #endif |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
63 |
16067 | 64 |
65 /* Store at most BUFLEN characters of the pathname of the slave pseudo | |
66 terminal associated with the master FD is open on in BUF. | |
67 Return 0 on success, otherwise an error number. */ | |
68 int | |
69 __ptsname_r (int fd, char *buf, size_t buflen) | |
70 { | |
71 int save_errno = errno; | |
72 int err; | |
73 struct stat st; | |
74 | |
75 if (buf == NULL) | |
76 { | |
77 __set_errno (EINVAL); | |
78 return EINVAL; | |
79 } | |
80 | |
16942
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
81 #if defined __sun /* Solaris */ |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
82 if (fstat (fd, &st) < 0) |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
83 return errno; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
84 if (!(S_ISCHR (st.st_mode) && major (st.st_rdev) == 0)) |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
85 { |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
86 errno = ENOTTY; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
87 return errno; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
88 } |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
89 { |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
90 /* Master ptys can be recognized through a STREAMS ioctl. See |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
91 "STREAMS-based Pseudo-Terminal Subsystem" |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
92 <http://docs.oracle.com/cd/E18752_01/html/816-4855/termsub15-44781.html> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
93 and "STREAMS ioctl commands" |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
94 <http://docs.oracle.com/cd/E18752_01/html/816-5177/streamio-7i.html> |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
95 */ |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
96 struct strioctl ioctl_arg; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
97 ioctl_arg.ic_cmd = ISPTM; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
98 ioctl_arg.ic_timout = 0; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
99 ioctl_arg.ic_len = 0; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
100 ioctl_arg.ic_dp = NULL; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
101 |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
102 if (ioctl (fd, I_STR, &ioctl_arg) < 0) |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
103 { |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
104 errno = ENOTTY; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
105 return errno; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
106 } |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
107 } |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
108 { |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
109 char tmpbuf[9 + 10 + 1]; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
110 int n = sprintf (tmpbuf, "/dev/pts/%u", minor (st.st_rdev)); |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
111 if (n >= buflen) |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
112 { |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
113 errno = ERANGE; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
114 return errno; |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
115 } |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
116 memcpy (buf, tmpbuf, n + 1); |
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
117 } |
16945
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
118 #elif defined _AIX || defined __osf__ /* AIX, OSF/1 */ |
16944
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
119 /* This implementation returns /dev/pts/N, like ptsname() does. |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
120 Whereas the generic implementation below returns /dev/ttypN. |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
121 Both are correct, but let's be consistent with ptsname(). */ |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
122 if (fstat (fd, &st) < 0) |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
123 return errno; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
124 if (!S_ISCHR (st.st_mode)) |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
125 { |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
126 errno = ENOTTY; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
127 return errno; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
128 } |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
129 { |
16945
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
130 int ret; |
16944
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
131 int dev; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
132 char tmpbuf[9 + 10 + 1]; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
133 int n; |
16945
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
134 # ifdef _AIX |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
135 ret = ioctl (fd, ISPTM, &dev); |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
136 # endif |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
137 # ifdef __osf__ |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
138 ret = ioctl (fd, ISPTM, NULL); |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
139 dev = ret; |
af6492941f0d
ptsname_r: Make it consistent with ptsname on AIX.
Bruno Haible <bruno@clisp.org>
parents:
16944
diff
changeset
|
140 # endif |
16946
f34e11adfc84
ptsname_r: Fix typo in last commit.
Bruno Haible <bruno@clisp.org>
parents:
16945
diff
changeset
|
141 if (ret < 0) |
16944
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
142 { |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
143 errno = ENOTTY; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
144 return errno; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
145 } |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
146 n = sprintf (tmpbuf, "/dev/pts/%u", minor (dev)); |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
147 if (n >= buflen) |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
148 { |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
149 errno = ERANGE; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
150 return errno; |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
151 } |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
152 memcpy (buf, tmpbuf, n + 1); |
00ae3faf06c6
ptsname_r: Make it consistent with ptsname on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
16942
diff
changeset
|
153 } |
16942
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
154 #else |
16067 | 155 if (!__isatty (fd)) |
16940
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
156 { |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
157 #if ISATTY_FAILS_WITHOUT_SETTING_ERRNO && defined F_GETFL /* IRIX, Solaris */ |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
158 /* Set errno. */ |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
159 if (fcntl (fd, F_GETFL) != -1) |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
160 errno = ENOTTY; |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
161 #else |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
162 /* We rely on isatty to set errno properly (i.e. EBADF or ENOTTY). */ |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
163 #endif |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
164 return errno; |
f0c9b2dc0596
ptsname_r: Fix test failures on IRIX, Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
165 } |
16067 | 166 |
167 if (buflen < strlen (_PATH_TTY) + 3) | |
168 { | |
169 __set_errno (ERANGE); | |
170 return ERANGE; | |
171 } | |
172 | |
173 err = __ttyname_r (fd, buf, buflen); | |
174 if (err != 0) | |
175 { | |
176 __set_errno (err); | |
177 return errno; | |
178 } | |
179 | |
17125
99a0d94bccb1
ptsname_r: support ptys returned by FreeBSD posix_openpt
Eric Blake <eblake@redhat.com>
parents:
16946
diff
changeset
|
180 if (strncmp(buf, "/dev/pts/", strlen("/dev/pts/")) != 0) |
99a0d94bccb1
ptsname_r: support ptys returned by FreeBSD posix_openpt
Eric Blake <eblake@redhat.com>
parents:
16946
diff
changeset
|
181 buf[sizeof (_PATH_DEV) - 1] = 't'; |
16942
17843e284264
ptsname_r: Add support for Solaris.
Bruno Haible <bruno@clisp.org>
parents:
16940
diff
changeset
|
182 #endif |
16067 | 183 |
184 if (__stat (buf, &st) < 0) | |
185 return errno; | |
186 | |
187 __set_errno (save_errno); | |
188 return 0; | |
189 } |