lkml.org 
[lkml]   [1998]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Header files and interfaces
   Date: Tue, 23 Jun 1998 08:02:54 -0400
From: Raul Miller <rdm@test.legislate.com>

There's two ways of dealing with ioctls which are present on only newer
kernels:

(a) at runtime, deal with the error that occurs when you try to run a
missing ioctl,

(b) at compile time (or design time) leave out support for such ioctls.

Most of the time (a) is a superior approach (if the ioctl had any value
at all), however (b) has a rather elegant simplicity.

Probably the best approach to (b), though, is documentation which
includes for each ioctl a bit of its history (when it first appeared,
historically similar mechanisms).

The right answer, actually, is to do both. I tend to write programs
that do both runtime and compile time checking, so that if a program is
built with a newer kernel and then run on an older kernel, so that the
program can print an understandable error message (or perhaps use a
workaround if practical) if the kernel which the program is running
under doesn't support that particular ioctl.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.047 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site