]> Dogcows Code - chaz/tar/blobdiff - src/port.h
Fix Solaris bug where chmod fails if we don't have PRIV_SYS_LINKDIR
[chaz/tar] / src / port.h
index 481f36ab3f4aaefbf80e85e5fa37e5fc144b1543..4e65a9ace886cd611bd00fb0b168b75e38905652 100644 (file)
@@ -1,5 +1,5 @@
 /* Portability declarations.  Requires sys/types.h.
-   Copyright (C) 1988 Free Software Foundation
+   Copyright (C) 1988, 1992 Free Software Foundation
 
 This file is part of GNU Tar.
 
@@ -17,11 +17,22 @@ You should have received a copy of the GNU General Public License
 along with GNU Tar; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include "pathmax.h"
-
+/* AIX requires this to be the first thing in the file. */
 #ifdef __GNUC__
 #define alloca __builtin_alloca
-#endif
+#else /* not __GNUC__ */
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else /* not HAVE_ALLOCA_H */
+#ifdef _AIX
+ #pragma alloca
+#else /* not _AIX */
+char *alloca ();
+#endif /* not _AIX */
+#endif /* not HAVE_ALLOCA_H */
+#endif /* not __GNUC__ */
+
+#include "pathmax.h"
 
 #ifdef _POSIX_VERSION
 #include <sys/wait.h>
@@ -51,7 +62,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        major(dev)              (dev)
 #define        minor(dev)              (dev)
 typedef long off_t;
-#endif /* __MSDOS__ */
+#endif /* __MSDOS__ */
 
 #if defined(__STDC__) || defined(__TURBOC__)
 #define PTR void *
@@ -82,11 +93,17 @@ typedef long off_t;
 #endif
 #undef HAVE_MAJOR
 
-#if defined(STDC_HEADERS) || defined(USG)
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
 #include <string.h>
 #if !defined(__MSDOS__) && !defined(STDC_HEADERS)
 #include <memory.h>
 #endif
+#ifdef index
+#undef index
+#endif
+#ifdef rindex
+#undef rindex
+#endif
 #define index strchr
 #define rindex strrchr
 #define bcopy(s, d, n) memcpy(d, s, n)
@@ -99,17 +116,17 @@ typedef long off_t;
 #if defined(STDC_HEADERS)
 #include <stdlib.h>
 #else
-char *malloc(), *realloc();
-char *getenv();
+char *malloc (), *realloc ();
+char *getenv ();
 #endif
 
 #ifndef _POSIX_VERSION
 #ifdef __MSDOS__
 #include <io.h>
-#else                          /* !__MSDOS__ */
-off_t lseek();
-#endif                         /* !__MSDOS__ */
-char *getcwd();
+#else /* !__MSDOS__ */
+off_t lseek ();
+#endif /* !__MSDOS__ */
+char *getcwd ();
 #endif /* !_POSIX_VERSION */
 
 #ifndef NULL
@@ -158,16 +175,41 @@ char *getcwd();
 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
 #define        S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
 #endif
-#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
+#if !defined(S_ISMPB) && defined(S_IFMPB)      /* V7 */
 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
 #endif
-#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
+#if !defined(S_ISNWK) && defined(S_IFNWK)      /* HP/UX */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
-#if !defined(S_ISCTG) && defined(S_IFCTG) /* contiguous file */
+#if !defined(S_ISCTG) && defined(S_IFCTG)      /* contiguous file */
 #define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
 #endif
 #if !defined(S_ISVTX)
 #define S_ISVTX 0001000
 #endif
+
+#ifdef __MSDOS__
+#include "msd_dir.h"
+#define NLENGTH(direct) ((direct)->d_namlen)
+
+#else /* not __MSDOS__ */
+
+#if defined(DIRENT) || defined(_POSIX_VERSION)
+#include <dirent.h>
+#define NLENGTH(direct) (strlen((direct)->d_name))
+#else /* not (DIRENT or _POSIX_VERSION) */
+#define dirent direct
+#define NLENGTH(direct) ((direct)->d_namlen)
+#ifdef SYSNDIR
+#include <sys/ndir.h>
+#endif /* SYSNDIR */
+#ifdef SYSDIR
+#include <sys/dir.h>
+#endif /* SYSDIR */
+#ifdef NDIR
+#include <ndir.h>
+#endif /* NDIR */
+#endif /* DIRENT or _POSIX_VERSION */
+
+#endif /* not __MSDOS__ */
This page took 0.023273 seconds and 4 git commands to generate.