1 /* System dependent declarations. Requires sys/types.h.
2 Copyright (C) 1992 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
24 #define rindex strrchr
27 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
30 #define bzero(s, n) memset ((s), 0, (n))
52 #ifndef _POSIX_VERSION
53 #if defined(__MSDOS__) && !defined(__GNUC__)
59 /* Since major is a function on SVR4, we can't use `ifndef major'. */
61 #include <sys/mkdev.h>
65 #ifdef MAJOR_IN_SYSMACROS
66 #include <sys/sysmacros.h>
70 #ifdef major /* Might be defined in sys/types.h. */
75 #define major(dev) (((dev) >> 8) & 0xff)
76 #define minor(dev) ((dev) & 0xff)
77 #define makedev(ma, mi) (((ma) << 8) | (mi))
81 #if defined(__MSDOS__) || defined(_POSIX_VERSION) || defined(HAVE_FCNTL_H)
94 #ifdef __EMX__ /* gcc on OS/2. */
119 #define CONSOLE "/dev/tty"
121 #define CONSOLE "con"
124 #if defined(__MSDOS__) && !defined(__GNUC__)
129 /* On most systems symlink() always creates links with rwxrwxrwx
130 protection modes, but on some (HP/UX 8.07; I think maybe DEC's OSF
131 on MIPS too) symlink() uses the value of umask, so links' protection modes
132 aren't always rwxrwxrwx. There doesn't seem to be any way to change
133 the modes of a link (no system call like, say, lchmod() ), it seems
134 the only way to set the modes right is to set umask before calling
137 #ifndef SYMLINK_USES_UMASK
138 #define UMASKED_SYMLINK(name1,name2,mode) symlink(name1,name2)
140 #define UMASKED_SYMLINK(name1,name2,mode) umasked_symlink(name1,name2,mode)
141 #endif /* SYMLINK_USES_UMASK */