r253351 implicit definition of 'critical_exit'.

Sergey Kandaurov pluknet at gmail.com
Mon Jul 15 14:56:48 UTC 2013


On 15 July 2013 18:01, Ian FREISLICH <ianf at clue.co.za> wrote:
> Hi
>
> Recent change:
> -----
> # svn log ./sys/sys/sf_buf.h |less
> ------------------------------------------------------------------------
> r253351 | ae | 2013-07-15 08:16:57 +0200 (Mon, 15 Jul 2013) | 6 lines
>
> Introduce new structure sfstat for collecting sendfile's statistics
> and remove corresponding fields from struct mbstat. Use PCPU counters
> and SFSTAT_INC() macro for update these statistics.
> -----
>
> Includes sys/counter.h in sys/sf_buf.h.  sys/counter.h uses macros
> defined in sys/systm.h resulting in implicit definitions of
> critical_exit and others and then errors in conflicting types for
> critical_exit later when sys/system.h is includd _after_ sys/sf_buf.h
> in sys/i386/i386/uio_machdep.c.
>
> I haven't checked amd64 yet, but this patch fixes the build:
>
> Index: /usr/src/sys/i386/i386/uio_machdep.c
> ===================================================================
> --- /usr/src/sys/i386/i386/uio_machdep.c        (revision 253361)
> +++ /usr/src/sys/i386/i386/uio_machdep.c        (working copy)
> @@ -44,8 +44,8 @@
>  #include <sys/mutex.h>
>  #include <sys/proc.h>
>  #include <sys/sched.h>
> +#include <sys/systm.h>
>  #include <sys/sf_buf.h>
> -#include <sys/systm.h>
>  #include <sys/uio.h>
>
>  #include <vm/vm.h>
>
> However, sys/system.h coul equally be included in sys/sf_buf.h
> before sys/counter.h.  I don't know which is the correct fix.

AFAIK, this is because systm.h isn't properly sorted here
(also in amd64 and probably others).
It should go right after sys/param.h.

-- 
wbr,
pluknet


More information about the freebsd-current mailing list