Commit | Line | Data |
---|---|---|
66a734b3 WJ |
1 | Portability of the new file(1) command. |
2 | @(#) $Header: PORTING,v 1.6 87/11/08 23:03:41 ian Exp $ | |
3 | ||
4 | Read this file only if the program doesn't compile on your system. | |
5 | ||
6 | I have tried to make a program that doesn't need any command-line | |
7 | defines (-D) to specify what version of UNIX is in use, | |
8 | by using the definitions available in the system #include | |
9 | files. For example, the lstat(2) call is normally found in | |
10 | 4BSD systems, but might be grafted into some other variant | |
11 | of UNIX. If it's done right (ie., using the same definitions), | |
12 | my program will compile and work correctly. Look at the #ifdefs | |
13 | to see how it's done. | |
14 | ||
15 | I've also tried to include all the non-portable library routines | |
16 | I used (getopt, str*). Non-portable here means `not in every | |
17 | reasonably standard UNIX out there: V7, System V, 4BSD'. | |
18 | ||
19 | There is one area that just might cause problems. On System | |
20 | V, they moved the definition of major() and minor() out of | |
21 | <sys/types.h> into <sys/sysmacros.h>. Hence, if major isn't | |
22 | defined after including types.h, I automatically include sys/sysmacros.h. | |
23 | This will work for 99% of the systems out there. ONLY if you | |
24 | have a system in which neither types.h nor sysmacros.h defines | |
25 | `major' will this automatic include fail (I hope). On such | |
26 | systems, you will get a compilation error in trying to compile | |
27 | a warning message. Please do the following: | |
28 | ||
29 | 1) change the appropriate (2nd) #include at the start of | |
30 | fsmagic.c | |
31 | and 2) let me know the name of the system, the release number, | |
32 | and the name of the header file that *does* include | |
33 | this "standard" definition. | |
34 | ||
35 | If you are running the old Ritchie PDP-11 C compiler or | |
36 | some other compiler that doesn't know about `void', you will have | |
37 | to un-comment-out the definition of `void=int' in the Makefile. | |
38 | ||
39 | Other than this, there should be no portability problems, | |
40 | but one never knows these days. Please let me know of any | |
41 | other problems you find porting to a UNIX system. I don't much | |
42 | care for non-UNIX systems but will collect widely-used magic | |
43 | numbers for them as well as for UNIX systems. | |
44 | ||
45 | Ian Darwin | |
46 | Toronto, Canada |