From: Ian Darwin Date: Sun, 8 Nov 1987 23:03:41 +0000 (+0000) Subject: Be more charitable and more equitable. X-Git-Tag: FILE3_27~349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a576ecc807aac86b01c795acf6afe1055f8c325;p=file Be more charitable and more equitable. --- diff --git a/src/PORTING b/src/PORTING index 8430b25e..e247f0a9 100644 --- a/src/PORTING +++ b/src/PORTING @@ -1,17 +1,31 @@ -Portability of the new file(1) command: +Portability of the new file(1) command. +@(#) $Header: /home/glen/git/file/cvs/file/src/Attic/PORTING,v 1.5 1987/11/08 23:03:41 ian Exp $ Read this file only if the program doesn't compile on your system. -I had hoped to be able to make a file command that -didn't have any system-dependant #ifdefs, no special libraries, -etc., etc. I went to some lengths to include all the non-portable -library routines I used (getopt, str*). Well, System V shot me down. -They moved the definition of major() and minor() out of -into . So, if major isn't defined after including types.h, -I AUTOMATICALLY include sys/sysmacros.h. ONLY if you have a system in which -neither types.h nor sysmacros.h defines `major' will this automatic include -fail (I hope). On such systems, you will get a compilation -error in trying to compile a warning message. Please do the following: +I have tried to make a file command that doesn't need any command-line +defines (-D) to specify what version of UNIX is in use. I do +this by using the definitions available in the system #include +files. For example, the lstat(2) call is normally found in +4BSD systems, but might be grafted into some other variant +of UNIX. If it's done right (ie., using the same definitions), +my program will compile and work correctly. Look at the #ifdefs +to see how it's done. + +I've also tried to include all the non-portable library routines +I used (getopt, str*). Non-portable here means `not in every +reasonably standard UNIX out there: V7, System V, 4BSD'. + +There is one area that just might cause problems. On System +V, they moved the definition of major() and minor() out of + into . Hence, if major isn't +defined after including types.h, I automatically include sys/sysmacros.h. +This will work for 99% of the systems out there. ONLY if you +have a system in which neither types.h nor sysmacros.h defines +`major' will this automatic include fail (I hope). On such +systems, you will get a compilation error in trying to compile +a warning message. Please do the following: + 1) change the appropriate (2nd) #include at the start of fsmagic.c and 2) let me know the name of the system, the release number,