[BusyBox] [patch] Cleanup for libbb/loop.c

Erik Andersen andersen at codepoet.org
Tue Nov 16 20:18:18 UTC 2004


On Tue Nov 16, 2004 at 06:51:39AM -0600, Rob Landley wrote:
> P.S.  Why are we including kernel_types.h in a userspace program
> at all?  Anybody know?

Because we need to define structure which communicates
between the kernel and user space.

> --- busybox/busybox/libbb/loop.c	2004-08-16 04:36:28.000000000 -0400
> +++ lfs/newbuild/lfs/tools/sources/busybox-new/libbb/loop.c	2004-11-16 05:50:57.000000000 -0500
> @@ -19,6 +19,9 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
>   */
>  
> +#include <asm/posix_types.h>
> +#include <linux/loop.h>


No no no no no no no no no!

Rule #1: Never ever include kernel header files in user space.
Rule #2: See Rule #1
Rule #3: See Rule #2


 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the busybox mailing list