]>
Dogcows Code - chaz/tar/blob - src/port.h
55d1c66ebc7886484b238128045ae80b3fe7fea8
1 /* Portability declarations. Requires sys/types.h.
2 Copyright (C) 1988 Free Software Foundation
4 This file is part of GNU Tar.
6 GNU Tar is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Tar is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Tar; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 #else /* !_POSIX_VERSION */
25 #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
26 #define WIFSIGNALED(w) (((w) & 0xff) != 0x7f && ((w) & 0xff) != 0)
27 #define WIFEXITED(w) (((w) & 0xff) == 0)
29 #define WSTOPSIG(w) (((w) >> 8) & 0xff)
30 #define WTERMSIG(w) ((w) & 0x7f)
31 #define WEXITSTATUS(w) (((w) >> 8) & 0xff)
32 #endif /* _POSIX_VERSION */
36 #define WIFCOREDUMPED(w) (((w) & 0x80) != 0)
40 /* missing things from sys/stat.h */
46 #define makedev(ma, mi) ((ma << 8) | mi)
47 #define major(dev) (dev)
48 #define minor(dev) (dev)
50 #endif /* __MSDOS__ */
52 #if defined(__STDC__) || defined(__TURBOC__)
59 /* Since major is a function on SVR4, we can't just use `ifndef major'. */
60 #ifdef major /* Might be defined in sys/types.h. */
64 #if !defined(HAVE_MAJOR) && defined(MAJOR_IN_MKDEV)
65 #include <sys/mkdev.h>
69 #if !defined(HAVE_MAJOR) && defined(MAJOR_IN_SYSMACROS)
70 #include <sys/sysmacros.h>
75 #define major(dev) (((dev) >> 8) & 0xff)
76 #define minor(dev) ((dev) & 0xff)
77 #define makedev(maj, min) (((maj) << 8) | (min))
81 #if defined(STDC_HEADERS) || defined(USG)
83 #if !defined(__MSDOS__) && !defined(STDC_HEADERS)
87 #define rindex strrchr
88 #define bcopy(s, d, n) memcpy(d, s, n)
89 #define bzero(s, n) memset(s, 0, n)
95 #if defined(STDC_HEADERS)
98 char *malloc(), *realloc();
102 #ifndef _POSIX_VERSION
105 #else /* !__MSDOS__ */
107 #endif /* !__MSDOS__ */
109 #endif /* !_POSIX_VERSION */
131 #include <sys/stat.h>
132 #ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */
133 #define mode_t unsigned short
135 #if !defined(S_ISBLK) && defined(S_IFBLK)
136 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
138 #if !defined(S_ISCHR) && defined(S_IFCHR)
139 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
141 #if !defined(S_ISDIR) && defined(S_IFDIR)
142 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
144 #if !defined(S_ISREG) && defined(S_IFREG)
145 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
147 #if !defined(S_ISFIFO) && defined(S_IFIFO)
148 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
149 #define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
151 #if !defined(S_ISLNK) && defined(S_IFLNK)
152 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
154 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
155 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
157 #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
158 #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
159 #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
161 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
162 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
164 #if !defined(S_ISCTG) && defined(S_IFCTG) /* contiguous file */
165 #define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
167 #if !defined(S_ISVTX)
168 #define S_ISVTX 0001000
This page took 0.04236 seconds and 4 git commands to generate.