All of lore.kernel.org
 help / color / mirror / Atom feed
From: ozgur@goosey.org (Ozgur)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Header organization/separation rule in kernel
Date: Mon, 11 Dec 2017 00:38:08 +0300	[thread overview]
Message-ID: <1583791512941888@web44o.yandex.ru> (raw)
In-Reply-To: <20171210213122.GA19494@kroah.com>

Hello,

11.12.2017, 00:32, "Greg KH" <greg@kroah.com>:
> On Sun, Dec 10, 2017 at 11:21:46PM +0800, Shiyao MA wrote:
>> ?Hi,
>>
>> ?I wonder the header separation rule in kernel.
>> ?To make this question concrete, for example, let's targeting genetlink.h
>>
>> ?It can be found in:
>>
>> ?http://elixir.free-electrons.com/linux/latest/source/include/net/genetlink.h
>> ?http://elixir.free-electrons.com/linux/latest/source/include/linux/genetlink.h
>> ?http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/genetlink.h
>>
>> ?so basically three parts, in uapi, linux/genetlink.h, and net/genetlink.h.
>>
>> ?I understand the necessity of uapi, but why divide the genetlink.h in
>> ?linux and the net folder?
>> ?What's the benefit of such separation?

hm, I think if you use a diff and you would see the why different header file.
for example you development a network card driver and you not be use to linux kernel genetlink header file.

use to network side genetlink.h.

So please check:

#ifndef __NET_GENERIC_NETLINK_H
#define __NET_GENERIC_NETLINK_H

#ifndef __LINUX_GENERIC_NETLINK_H
#define __LINUX_GENERIC_NETLINK_H

#ifndef _UAPI__LINUX_GENERIC_NETLINK_H
#define _UAPI__LINUX_GENERIC_NETLINK_H

they are like the assets that separate and address each others.

> Some things are only for the networking subsystem, and some things are
> for any other part of the kernel.
>
> Hope this helps,
>
> greg k-h

Regards,

Ozgur

>

      reply	other threads:[~2017-12-10 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-10 15:21 Header organization/separation rule in kernel Shiyao MA
2017-12-10 21:31 ` Greg KH
2017-12-10 21:38   ` Ozgur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1583791512941888@web44o.yandex.ru \
    --to=ozgur@goosey.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.