aboutsummaryrefslogtreecommitdiffstats
path: root/lib/unistd.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r--lib/unistd.in.h159
1 files changed, 159 insertions, 0 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index a81a14fe873..357a35e3881 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -273,6 +273,12 @@ _GL_INLINE_HEADER_BEGIN
273_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) 273_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
274 _GL_ARG_NONNULL ((1))); 274 _GL_ARG_NONNULL ((1)));
275_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); 275_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
276# elif defined _WIN32 && !defined __CYGWIN__
277# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
278# undef access
279# define access _access
280# endif
281_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
276# else 282# else
277_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); 283_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
278# endif 284# endif
@@ -286,11 +292,22 @@ _GL_WARN_ON_USE (access, "access does not always support X_OK - "
286 "also, this function is a security risk - " 292 "also, this function is a security risk - "
287 "use the gnulib module faccessat instead"); 293 "use the gnulib module faccessat instead");
288# endif 294# endif
295#elif defined _WIN32 && !defined __CYGWIN__
296# undef access
297# define access _access
289#endif 298#endif
290 299
291 300
292#if @GNULIB_CHDIR@ 301#if @GNULIB_CHDIR@
302# if defined _WIN32 && !defined __CYGWIN__
303# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
304# undef chdir
305# define chdir _chdir
306# endif
307_GL_CXXALIAS_MDA (chdir, int, (const char *file));
308# else
293_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); 309_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
310# endif
294_GL_CXXALIASWARN (chdir); 311_GL_CXXALIASWARN (chdir);
295#elif defined GNULIB_POSIXCHECK 312#elif defined GNULIB_POSIXCHECK
296# undef chdir 313# undef chdir
@@ -298,6 +315,9 @@ _GL_CXXALIASWARN (chdir);
298_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " 315_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
299 "use gnulib module chdir for portability"); 316 "use gnulib module chdir for portability");
300# endif 317# endif
318#elif defined _WIN32 && !defined __CYGWIN__
319# undef chdir
320# define chdir _chdir
301#endif 321#endif
302 322
303 323
@@ -342,6 +362,12 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
342# endif 362# endif
343_GL_FUNCDECL_RPL (close, int, (int fd)); 363_GL_FUNCDECL_RPL (close, int, (int fd));
344_GL_CXXALIAS_RPL (close, int, (int fd)); 364_GL_CXXALIAS_RPL (close, int, (int fd));
365# elif defined _WIN32 && !defined __CYGWIN__
366# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
367# undef close
368# define close _close
369# endif
370_GL_CXXALIAS_MDA (close, int, (int fd));
345# else 371# else
346_GL_CXXALIAS_SYS (close, int, (int fd)); 372_GL_CXXALIAS_SYS (close, int, (int fd));
347# endif 373# endif
@@ -354,6 +380,9 @@ _GL_CXXALIASWARN (close);
354/* Assume close is always declared. */ 380/* Assume close is always declared. */
355_GL_WARN_ON_USE (close, "close does not portably work on sockets - " 381_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
356 "use gnulib module close for portability"); 382 "use gnulib module close for portability");
383#elif defined _WIN32 && !defined __CYGWIN__
384# undef close
385# define close _close
357#endif 386#endif
358 387
359 388
@@ -382,6 +411,12 @@ _GL_WARN_ON_USE (copy_file_range,
382# endif 411# endif
383_GL_FUNCDECL_RPL (dup, int, (int oldfd)); 412_GL_FUNCDECL_RPL (dup, int, (int oldfd));
384_GL_CXXALIAS_RPL (dup, int, (int oldfd)); 413_GL_CXXALIAS_RPL (dup, int, (int oldfd));
414# elif defined _WIN32 && !defined __CYGWIN__
415# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
416# undef dup
417# define dup _dup
418# endif
419_GL_CXXALIAS_MDA (dup, int, (int oldfd));
385# else 420# else
386_GL_CXXALIAS_SYS (dup, int, (int oldfd)); 421_GL_CXXALIAS_SYS (dup, int, (int oldfd));
387# endif 422# endif
@@ -392,6 +427,9 @@ _GL_CXXALIASWARN (dup);
392_GL_WARN_ON_USE (dup, "dup is unportable - " 427_GL_WARN_ON_USE (dup, "dup is unportable - "
393 "use gnulib module dup for portability"); 428 "use gnulib module dup for portability");
394# endif 429# endif
430#elif defined _WIN32 && !defined __CYGWIN__
431# undef dup
432# define dup _dup
395#endif 433#endif
396 434
397 435
@@ -407,6 +445,12 @@ _GL_WARN_ON_USE (dup, "dup is unportable - "
407# endif 445# endif
408_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); 446_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
409_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); 447_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
448# elif defined _WIN32 && !defined __CYGWIN__
449# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
450# undef dup2
451# define dup2 _dup2
452# endif
453_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
410# else 454# else
411_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); 455_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
412# endif 456# endif
@@ -417,6 +461,9 @@ _GL_CXXALIASWARN (dup2);
417_GL_WARN_ON_USE (dup2, "dup2 is unportable - " 461_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
418 "use gnulib module dup2 for portability"); 462 "use gnulib module dup2 for portability");
419# endif 463# endif
464#elif defined _WIN32 && !defined __CYGWIN__
465# undef dup2
466# define dup2 _dup2
420#endif 467#endif
421 468
422 469
@@ -517,6 +564,43 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
517#endif 564#endif
518 565
519 566
567#if defined _WIN32 && !defined __CYGWIN__
568# undef execl
569# define execl _execl
570#endif
571
572#if defined _WIN32 && !defined __CYGWIN__
573# undef execle
574# define execle _execle
575#endif
576
577#if defined _WIN32 && !defined __CYGWIN__
578# undef execlp
579# define execlp _execlp
580#endif
581
582
583#if defined _WIN32 && !defined __CYGWIN__
584# undef execv
585# define execv _execv
586#endif
587
588#if defined _WIN32 && !defined __CYGWIN__
589# undef execve
590# define execve _execve
591#endif
592
593#if defined _WIN32 && !defined __CYGWIN__
594# undef execvp
595# define execvp _execvp
596#endif
597
598#if defined _WIN32 && !defined __CYGWIN__
599# undef execvpe
600# define execvpe _execvpe
601#endif
602
603
520#if @GNULIB_FACCESSAT@ 604#if @GNULIB_FACCESSAT@
521# if @REPLACE_FACCESSAT@ 605# if @REPLACE_FACCESSAT@
522# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 606# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -692,6 +776,12 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
692# endif 776# endif
693_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); 777_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
694_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); 778_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
779# elif defined _WIN32 && !defined __CYGWIN__
780# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
781# undef getcwd
782# define getcwd _getcwd
783# endif
784_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
695# else 785# else
696/* Need to cast, because on mingw, the second parameter is 786/* Need to cast, because on mingw, the second parameter is
697 int size. */ 787 int size. */
@@ -704,6 +794,9 @@ _GL_CXXALIASWARN (getcwd);
704_GL_WARN_ON_USE (getcwd, "getcwd is unportable - " 794_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
705 "use gnulib module getcwd for portability"); 795 "use gnulib module getcwd for portability");
706# endif 796# endif
797#elif defined _WIN32 && !defined __CYGWIN__
798# undef getcwd
799# define getcwd _getcwd
707#endif 800#endif
708 801
709 802
@@ -1038,6 +1131,12 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - "
1038#endif 1131#endif
1039 1132
1040 1133
1134#if defined _WIN32 && !defined __CYGWIN__
1135# undef getpid
1136# define getpid _getpid
1137#endif
1138
1139
1041#if @GNULIB_GETUSERSHELL@ 1140#if @GNULIB_GETUSERSHELL@
1042/* Return the next valid login shell on the system, or NULL when the end of 1141/* Return the next valid login shell on the system, or NULL when the end of
1043 the list has been reached. */ 1142 the list has been reached. */
@@ -1110,6 +1209,12 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
1110# endif 1209# endif
1111_GL_FUNCDECL_RPL (isatty, int, (int fd)); 1210_GL_FUNCDECL_RPL (isatty, int, (int fd));
1112_GL_CXXALIAS_RPL (isatty, int, (int fd)); 1211_GL_CXXALIAS_RPL (isatty, int, (int fd));
1212# elif defined _WIN32 && !defined __CYGWIN__
1213# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1214# undef isatty
1215# define isatty _isatty
1216# endif
1217_GL_CXXALIAS_MDA (isatty, int, (int fd));
1113# else 1218# else
1114_GL_CXXALIAS_SYS (isatty, int, (int fd)); 1219_GL_CXXALIAS_SYS (isatty, int, (int fd));
1115# endif 1220# endif
@@ -1120,6 +1225,9 @@ _GL_CXXALIASWARN (isatty);
1120_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " 1225_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
1121 "use gnulib module isatty for portability"); 1226 "use gnulib module isatty for portability");
1122# endif 1227# endif
1228#elif defined _WIN32 && !defined __CYGWIN__
1229# undef isatty
1230# define isatty _isatty
1123#endif 1231#endif
1124 1232
1125 1233
@@ -1231,6 +1339,12 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
1231# endif 1339# endif
1232_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); 1340_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1233_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); 1341_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1342# elif defined _WIN32 && !defined __CYGWIN__
1343# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1344# undef lseek
1345# define lseek _lseek
1346# endif
1347_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
1234# else 1348# else
1235_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); 1349_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1236# endif 1350# endif
@@ -1241,6 +1355,9 @@ _GL_CXXALIASWARN (lseek);
1241_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " 1355_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
1242 "systems - use gnulib module lseek for portability"); 1356 "systems - use gnulib module lseek for portability");
1243# endif 1357# endif
1358#elif defined _WIN32 && !defined __CYGWIN__
1359# undef lseek
1360# define lseek _lseek
1244#endif 1361#endif
1245 1362
1246 1363
@@ -1373,6 +1490,12 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1373_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) 1490_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
1374 _GL_ARG_NONNULL ((2))); 1491 _GL_ARG_NONNULL ((2)));
1375_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); 1492_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1493# elif defined _WIN32 && !defined __CYGWIN__
1494# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1495# undef read
1496# define read _read
1497# endif
1498_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
1376# else 1499# else
1377/* Need to cast, because on mingw, the third parameter is 1500/* Need to cast, because on mingw, the third parameter is
1378 unsigned int count 1501 unsigned int count
@@ -1380,6 +1503,9 @@ _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1380_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); 1503_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
1381# endif 1504# endif
1382_GL_CXXALIASWARN (read); 1505_GL_CXXALIASWARN (read);
1506#elif defined _WIN32 && !defined __CYGWIN__
1507# undef read
1508# define read _read
1383#endif 1509#endif
1384 1510
1385 1511
@@ -1462,6 +1588,12 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
1462# endif 1588# endif
1463_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); 1589_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
1464_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); 1590_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
1591# elif defined _WIN32 && !defined __CYGWIN__
1592# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1593# undef rmdir
1594# define rmdir _rmdir
1595# endif
1596_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
1465# else 1597# else
1466_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); 1598_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1467# endif 1599# endif
@@ -1472,6 +1604,9 @@ _GL_CXXALIASWARN (rmdir);
1472_GL_WARN_ON_USE (rmdir, "rmdir is unportable - " 1604_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
1473 "use gnulib module rmdir for portability"); 1605 "use gnulib module rmdir for portability");
1474# endif 1606# endif
1607#elif defined _WIN32 && !defined __CYGWIN__
1608# undef rmdir
1609# define rmdir _rmdir
1475#endif 1610#endif
1476 1611
1477 1612
@@ -1530,6 +1665,12 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
1530#endif 1665#endif
1531 1666
1532 1667
1668#if defined _WIN32 && !defined __CYGWIN__
1669# undef swab
1670# define swab _swab
1671#endif
1672
1673
1533#if @GNULIB_SYMLINK@ 1674#if @GNULIB_SYMLINK@
1534# if @REPLACE_SYMLINK@ 1675# if @REPLACE_SYMLINK@
1535# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1676# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1654,6 +1795,12 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
1654# endif 1795# endif
1655_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); 1796_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
1656_GL_CXXALIAS_RPL (unlink, int, (char const *file)); 1797_GL_CXXALIAS_RPL (unlink, int, (char const *file));
1798# elif defined _WIN32 && !defined __CYGWIN__
1799# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1800# undef unlink
1801# define unlink _unlink
1802# endif
1803_GL_CXXALIAS_MDA (unlink, int, (char const *file));
1657# else 1804# else
1658_GL_CXXALIAS_SYS (unlink, int, (char const *file)); 1805_GL_CXXALIAS_SYS (unlink, int, (char const *file));
1659# endif 1806# endif
@@ -1664,6 +1811,9 @@ _GL_CXXALIASWARN (unlink);
1664_GL_WARN_ON_USE (unlink, "unlink is not portable - " 1811_GL_WARN_ON_USE (unlink, "unlink is not portable - "
1665 "use gnulib module unlink for portability"); 1812 "use gnulib module unlink for portability");
1666# endif 1813# endif
1814#elif defined _WIN32 && !defined __CYGWIN__
1815# undef unlink
1816# define unlink _unlink
1667#endif 1817#endif
1668 1818
1669 1819
@@ -1735,6 +1885,12 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
1735_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) 1885_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
1736 _GL_ARG_NONNULL ((2))); 1886 _GL_ARG_NONNULL ((2)));
1737_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); 1887_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1888# elif defined _WIN32 && !defined __CYGWIN__
1889# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1890# undef write
1891# define write _write
1892# endif
1893_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
1738# else 1894# else
1739/* Need to cast, because on mingw, the third parameter is 1895/* Need to cast, because on mingw, the third parameter is
1740 unsigned int count 1896 unsigned int count
@@ -1742,6 +1898,9 @@ _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1742_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); 1898_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
1743# endif 1899# endif
1744_GL_CXXALIASWARN (write); 1900_GL_CXXALIASWARN (write);
1901#elif defined _WIN32 && !defined __CYGWIN__
1902# undef write
1903# define write _write
1745#endif 1904#endif
1746 1905
1747_GL_INLINE_HEADER_END 1906_GL_INLINE_HEADER_END