-diff --git a/lib/gnulib.mk b/lib/gnulib.mk
-index bb79c0d..0a22af3 100644
---- a/lib/gnulib.mk
-+++ b/lib/gnulib.mk
-@@ -548,6 +548,14 @@ EXTRA_libgzip_a_SOURCES += getcwd.c
-
- ## end gnulib module getcwd
-
-+## begin gnulib module getdtablesize
-+
-+EXTRA_DIST += getdtablesize.c
-+
-+EXTRA_libgzip_a_SOURCES += getdtablesize.c
-+
-+## end gnulib module getdtablesize
-+
- ## begin gnulib module getopt-posix
-
- BUILT_SOURCES += $(GETOPT_H)
-diff --git a/lib/unistd.in.h b/lib/unistd.in.h
-index bffdf8f..21cf667 100644
---- a/lib/unistd.in.h
-+++ b/lib/unistd.in.h
-@@ -423,17 +423,19 @@ extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
-
-
- #if @GNULIB_GETDTABLESIZE@
--# if !@HAVE_GETDTABLESIZE@
- /* Return the maximum number of file descriptors in the current process.
- In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
--extern int getdtablesize (void);
-+# if !@HAVE_GETDTABLESIZE@
-+_GL_FUNCDECL_SYS (getdtablesize, int, (void));
- # endif
-+_GL_CXXALIAS_SYS (getdtablesize, int, (void));
-+_GL_CXXALIASWARN (getdtablesize);
- #elif defined GNULIB_POSIXCHECK
- # undef getdtablesize
--# define getdtablesize() \
-- (GL_LINK_WARNING ("getdtablesize is unportable - " \
-- "use gnulib module getdtablesize for portability"), \
-- getdtablesize ())
-+# if HAVE_RAW_DECL_GETDTABLESIZE
-+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
-+ "use gnulib module getdtablesize for portability");
-+# endif
- #endif
-
-