[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: some more JOBS



On Fri, Aug 10, 2001 at 04:56:12PM +0200, Steinar Hamre wrote:
> No, no, no!

Yes! :)

> This #ifdef OS used in this way is hell to maintain as soon as more
> than two operating system is to be supported.  In addition different
> versions of the same OS would support different sets of filesystems!
> A much better approach in cases like this, would be:

Indeed.  However, it is questionable if the small set of common filesystems
warrants a unification of this code.

I like your approach, but it only shines if you also map the different type
ids on the systems to the same symbol, like this:

#ifdef UFS_SUPER_MAGIC
#define FSTYPE_UFS UFS_SUPER_MAGIC
#endif

etc.

If you truly want to fix this code, you should get the POSIX standard
extended so that it defines interfaces to check if a certain fstype
number is a supported filesystem type and what string (name) it maps to.

Marcus



Reply to: