[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ttyname_r on Solaris
From: |
Bruno Haible |
Subject: |
ttyname_r on Solaris |
Date: |
Sun, 25 Apr 2010 20:16:53 +0200 |
User-agent: |
KMail/1.9.9 |
Simon Josefsson wrote:
> There appears to be a ttyname_r signature bug, see:
> http://autobuild.josefsson.org/gnulib/log-201004250717723515000.txt
>
> g++ -DHAVE_CONFIG_H -I. -DGNULIB_STRICT_CHECKING=1 -I. -I. -I.. -I./..
> -I../gllib -I./../gllib -I/opt/local/include -MT test-fcntl-h-c++.o -MD -MP
> -MF $depbase.Tpo -c -o test-fcntl-h-c++.o test-fcntl-h-c++.cc &&\
> mv -f $depbase.Tpo $depbase.Po
> ../gllib/unistd.h:1463: error: invalid conversion from 'char* (*)(int, char*,
> size_t)' to 'int (*)(int, char*, size_t)'
> make[4]: *** [test-fcntl-h-c++.o] Error 1
> ...
> Should we define __DARWIN_UNIX03? I'm not sure how well supported that
> is.
A similar situation exists with ttyname_r and a few other functions on
Solaris. The default declaration of this function on Solaris is different
from the one specified in POSIX. This leads to:
test-ttyname_r.c:22: warning: initialization from incompatible pointer type
test-ttyname_r.c: In function 'main':
test-ttyname_r.c:45: warning: comparison between pointer and integer
...
test-ttyname_r.c:45: assertion failed
bash: line 5: 20285 Abort (core dumped) EXEEXT=''
srcdir='.' ${dir}$tst
FAIL: test-ttyname_r
The manual pages on Solaris say that in order to get the POSIX compliant
*_r function prototypes, one needs to define _POSIX_PTHREAD_SEMANTICS.
Should we define _POSIX_PTHREAD_SEMANTICS?
Should we document in the INSTALL file that on Solaris, _POSIX_PTHREAD_SEMANTICS
should be defined? (Like we do for _XOPEN_SOURCE on HP-UX.)
In any case, I'm updating the documentation:
2010-04-25 Bruno Haible <address@hidden>
Mention effects of _POSIX_PTHREAD_SEMANTICS on Solaris.
* doc/posix-functions/asctime_r.texi: Mention the Solaris problem.
* doc/posix-functions/ctime_r.texi: Likewise.
* doc/posix-functions/getgrgid_r.texi: Likewise.
* doc/posix-functions/getgrnam_r.texi: Likewise.
* doc/posix-functions/getlogin_r.texi: Likewise.
* doc/posix-functions/getpwnam_r.texi: Likewise.
* doc/posix-functions/getpwuid_r.texi: Likewise.
* doc/posix-functions/readdir_r.texi: Likewise.
* doc/posix-functions/sigwait.texi: Likewise.
* doc/posix-functions/ttyname_r.texi: Likewise.
Reported by Simon Josefsson.
--- doc/posix-functions/asctime_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/asctime_r.texi Sun Apr 25 19:43:46 2010
@@ -16,6 +16,9 @@
This function is missing on some platforms:
mingw.
@item
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
address@hidden
This function may put more than 26 bytes into the argument buffer if an
invalid year is passed.
@end itemize
--- doc/posix-functions/ctime_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/ctime_r.texi Sun Apr 25 19:43:46 2010
@@ -16,6 +16,9 @@
This function is missing on some platforms:
mingw.
@item
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
address@hidden
This function may put more than 26 bytes into the argument buffer if an
invalid year is passed.
@end itemize
--- doc/posix-functions/getgrgid_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/getgrgid_r.texi Sun Apr 25 19:43:45 2010
@@ -15,4 +15,7 @@
@item
This function is missing on some platforms:
mingw, BeOS.
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/getgrnam_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/getgrnam_r.texi Sun Apr 25 19:43:45 2010
@@ -15,4 +15,7 @@
@item
This function is missing on some platforms:
mingw, BeOS.
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/getlogin_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/getlogin_r.texi Sun Apr 25 19:43:46 2010
@@ -15,4 +15,7 @@
Portability problems not fixed by Gnulib:
@itemize
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/getpwnam_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/getpwnam_r.texi Sun Apr 25 19:43:45 2010
@@ -15,4 +15,7 @@
@item
This function is missing on some platforms:
OpenBSD 3.8, mingw, BeOS.
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/getpwuid_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/getpwuid_r.texi Sun Apr 25 19:43:45 2010
@@ -15,4 +15,7 @@
@item
This function is missing on some platforms:
OpenBSD 3.8, mingw, BeOS.
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/readdir_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/readdir_r.texi Sun Apr 25 19:43:45 2010
@@ -15,4 +15,7 @@
@item
This function is missing on some platforms:
mingw, BeOS.
address@hidden
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
--- doc/posix-functions/sigwait.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/sigwait.texi Sun Apr 25 19:43:46 2010
@@ -16,6 +16,9 @@
This function is missing on some platforms:
mingw, BeOS.
@item
+This function has an incompatible declaration on some platforms:
+Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
address@hidden
On Linux/glibc platforms before the advent of NPTL, signals could only be
sent to one particular thread. In POSIX, signals are sent to the entire
process and executed by any thread of the process that happens to have the
--- doc/posix-functions/ttyname_r.texi.orig Sun Apr 25 19:46:01 2010
+++ doc/posix-functions/ttyname_r.texi Sun Apr 25 19:43:59 2010
@@ -8,10 +8,14 @@
Portability problems fixed by Gnulib:
@itemize
address@hidden
This function is missing on some platforms:
NetBSD 3.0, mingw, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
address@hidden
+This function has an incompatible declaration on some platforms:
+MacOS X 10.4, Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize