All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seung-Woo Kim <sw0312.kim@samsung.com>
To: Niclas Zeising <zeising@daemonic.se>
Cc: eric.engestrom@intel.com, Seung-Woo Kim <sw0312.kim@samsung.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] xf86drm: only include <sys/sysctl.h> for FreeBSD build case
Date: Fri, 10 Jan 2020 09:52:56 +0900	[thread overview]
Message-ID: <5E17CAE8.7090601@samsung.com> (raw)
In-Reply-To: <94d436b2-b4e0-3414-a2fc-9d58e5ad4c07@daemonic.se>

Hi

On 2020년 01월 10일 00:28, Niclas Zeising wrote:
> On 2020-01-09 16:18, Jani Nikula wrote:
>> On Thu, 09 Jan 2020, Seung-Woo Kim <sw0312.kim@samsung.com> wrote:
>>> The <sys/sysctl.h> header is only required FreeBSD and GNU libc
>>> 2.30 starts to warn about Linux specific <sys/sysctl.h> header
>>> deprecation. Only include <sys/sysctl.h> for FreeBSD.
>>>
>>> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
>>> ---
>>>   xf86drmMode.c |    2 ++
>>>   1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/xf86drmMode.c b/xf86drmMode.c
>>> index 207d7be..ff1d31d 100644
>>> --- a/xf86drmMode.c
>>> +++ b/xf86drmMode.c
>>> @@ -42,9 +42,11 @@
>>>   #include <stdint.h>
>>>   #include <stdlib.h>
>>>   #include <sys/ioctl.h>
>>> +#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
>>>   #ifdef HAVE_SYS_SYSCTL_H
>>
>> Not that I know anything about this, but shouldn't you instead fix
>> HAVE_SYS_SYSCTL_H definition in configure stage to only be enabled on
>> FreeBSD?
>>
>> BR,
>> Jani.
>>
>>>   #include <sys/sysctl.h>
>>>   #endif
>>> +#endif /* defined (__FreeBSD__) || defined (__FreeBSD_kernel__) */
>>>   #include <stdio.h>
>>>   #include <stdbool.h>
>>
> 
> Hi!
> This fix looks OK on FreeBSD (I haven't had time to test), however, as
> has been pointed out, perhaps the change should go into the meson build
> script or configure instead.

Ok, I will try to fix in build side instead of include itself.

> I don't know if other OSes (other BSDs primarily) need this as well. I'm
> pretty sure it's needed on DragonflyBSD at least.
> Perhaps keep the include for everything except Linux for the time being?

As far as I checked, sysctlbyname() called only with FreeBSD build flag
is only function defined in <sys/sysctl.h> at least for xf86drmMode.c,
but I missed something. The header deprecation is done from Linux, so it
seems fine removing the header include only for Linux.

Best Regards,
- Seung-Woo Kim

> Regards

-- 
Seung-Woo Kim
Samsung Research
--

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-01-10  0:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200109092903epcas1p49de22b4892ff4c6e205fb098c83c76ae@epcas1p4.samsung.com>
2020-01-09  9:32 ` [PATCH] xf86drm: only include <sys/sysctl.h> for FreeBSD build case Seung-Woo Kim
2020-01-09 15:18   ` Jani Nikula
2020-01-09 15:28     ` Niclas Zeising
2020-01-10  0:52       ` Seung-Woo Kim [this message]
2020-01-10  0:47     ` Seung-Woo Kim
     [not found] <CGME20200110042734epcas1p1a80d5c2c9dd1fb3c2be7bb869cdc4311@epcas1p1.samsung.com>
2020-01-10  4:30 ` [PATCH libdrm] meson.build: Don't detect <sys/sysctl.h> header for linux Seung-Woo Kim
2020-01-29  9:53   ` Eric Engestrom
2020-03-29 21:05     ` Eric Engestrom

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=5E17CAE8.7090601@samsung.com \
    --to=sw0312.kim@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric.engestrom@intel.com \
    --cc=zeising@daemonic.se \
    /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.