X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Funistd.in.h;h=450d0be9cf62fb7c51047172d1c665c3c315facd;hb=f62a2da1390a78aebe7dcbc5753ba7a2b34cf1fd;hp=811a67b3ec142ff4cf602302d8e71fb9b4e45a3b;hpb=a9097796ff31942ab21b990723569493615f0fa6;p=gnulib.git diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 811a67b3e..450d0be9c 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -108,8 +107,9 @@ # include #endif -/* MSVC defines off_t in . */ -#if !@HAVE_UNISTD_H@ +/* MSVC defines off_t in . + May also define off_t to a 64-bit type on native Windows. */ +#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ /* Get off_t. */ # include #endif @@ -563,10 +563,19 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - " Return 0 if successful, otherwise -1 and errno set. See the POSIX:2008 specification . */ -# if !@HAVE_FTRUNCATE@ +# if @REPLACE_FTRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftruncate +# define ftruncate rpl_ftruncate +# endif +_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); +_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); +# else +# if !@HAVE_FTRUNCATE@ _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); -# endif +# endif _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); +# endif _GL_CXXALIASWARN (ftruncate); #elif defined GNULIB_POSIXCHECK # undef ftruncate @@ -1309,7 +1318,7 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) _GL_ARG_NONNULL ((1))); # endif -/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5 +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 and FreeBSD 6.4 the second parameter is int. On Solaris 11 2011-10, the first parameter is not const. */ _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));