diff options
author | Eric Blake <eblake@redhat.com> | 2011-11-07 15:26:08 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2011-11-09 15:53:07 -0700 |
commit | 78232883c8c01a22307bb38793928f2b9a5a6159 (patch) | |
tree | eb53e0effab97294bfc73767a34cc5270f5b99c0 /modules | |
parent | c025e2c9516ad949e0b8c97aacc2dd811909d877 (diff) | |
download | gnulib-78232883c8c01a22307bb38793928f2b9a5a6159.tar.gz |
ptsname_r: new module
For now, this replacement focuses solely on compilation
compatibility, and assumes that isatty() and ttyname_r() work
on a master side pty; if this assumption fails, or if
thread-safety is also required, then a later patch can follow
the lead of strerror_r.c in wrapping the system ptsname()
with a lock.
* modules/ptsname_r: New module.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): New file.
* lib/ptsname.c (__ptsname_r): Split...
* lib/ptsname_r.c: ...into new file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Check for decl.
(gl_STDLIB_H_DEFAULTS): Set witness defaults.
* modules/stdlib (Makefile.am): Substitute witnesses.
* lib/stdlib.in.h (ptsname_r): Declare it.
* doc/glibc-functions/ptsname_r.texi (ptsname_r): Document it.
* MODULES.html.sh (Misc): Likewise.
* modules/ptsname (Depends-on): Alter dependency.
* doc/posix-functions/ptsname.texi (ptsname): Mention new module.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ptsname | 2 | ||||
-rw-r--r-- | modules/ptsname_r | 30 | ||||
-rw-r--r-- | modules/stdlib | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/modules/ptsname b/modules/ptsname index 58560d63e5..f0ce25600d 100644 --- a/modules/ptsname +++ b/modules/ptsname @@ -8,7 +8,7 @@ m4/ptsname.m4 Depends-on: stdlib extensions -ttyname_r [test $HAVE_PTSNAME = 0] +ptsname_r [test $HAVE_PTSNAME = 0] configure.ac: gl_FUNC_PTSNAME diff --git a/modules/ptsname_r b/modules/ptsname_r new file mode 100644 index 0000000000..daf1d98125 --- /dev/null +++ b/modules/ptsname_r @@ -0,0 +1,30 @@ +Description: +ptsname_r() function: Determine name of the slave side of a pseudo-terminal. + +Files: +lib/ptsname_r.c +m4/ptsname_r.m4 + +Depends-on: +stdlib +extensions +ttyname_r [test $HAVE_PTSNAME_R = 0] + +configure.ac: +gl_FUNC_PTSNAME_R +if test $HAVE_PTSNAME_R = 0; then + AC_LIBOBJ([ptsname_r]) + gl_PREREQ_PTSNAME_R +fi +gl_STDLIB_MODULE_INDICATOR([ptsname_r]) + +Makefile.am: + +Include: +<stdlib.h> + +License: +LGPLv2+ + +Maintainer: +Bruno Haible, Eric Blake diff --git a/modules/stdlib b/modules/stdlib index 707d5e5d7d..d46f66412a 100644 --- a/modules/stdlib +++ b/modules/stdlib @@ -47,6 +47,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ @@ -74,6 +75,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ |