[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 04/19] bsd-user: Clean up includes
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 04/19] bsd-user: Clean up includes |
Date: |
Fri, 27 Jan 2023 14:54:30 +0000 |
On Thu, 19 Jan 2023 at 14:42, Warner Losh <imp@bsdimp.com> wrote:
>
> Also, why didn't you move sys/resource.h and other such files
> to os-dep.h? I'm struggling to understand the rules around what
> is or isn't included where?
The rough rule of thumb is that if some OS needs a compatibility
fixup or workaround for a system header (eg not every mmap.h
defines MAP_ANONYMOUS; on Windows unistd.h has to come before
time.h) then we put that header include and the compat workaround
into osdep.h. This avoids "only fails on obscure platform" issues
where somebody puts a header include into some specific .c file
but not the compat workaround, and it works on the Linux host
that most people develop and test on and we only find the
problem later.
There's also no doubt some includes there for historical
reasons, and some which really are "everybody needs these"
convenience ones. But we should probably not add new
includes to osdep.h unless they fall into the "working around
system header issues" bucket.
thanks
-- PMM
- [PATCH v4 12/19] target/hexagon: Clean up includes, (continued)
- [PATCH v4 12/19] target/hexagon: Clean up includes, Markus Armbruster, 2023/01/19
- [PATCH v4 11/19] net: Clean up includes, Markus Armbruster, 2023/01/19
- [PATCH v4 04/19] bsd-user: Clean up includes, Markus Armbruster, 2023/01/19
- Re: [PATCH v4 04/19] bsd-user: Clean up includes,
Peter Maydell <=
- Re: [PATCH v4 04/19] bsd-user: Clean up includes, Michael S. Tsirkin, 2023/01/27
- Re: [PATCH v4 04/19] bsd-user: Clean up includes, Michael S. Tsirkin, 2023/01/28
- Re: [PATCH v4 04/19] bsd-user: Clean up includes, Markus Armbruster, 2023/01/30
[PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h, Markus Armbruster, 2023/01/19
Re: [PATCH v4 16/19] Fix non-first inclusions of qemu/osdep.h, Juan Quintela, 2023/01/29