[Vm-dev] ucontext.h or sys/ucontext.h

Tobias Pape Das.Linux at gmx.de
Wed Apr 29 20:52:24 UTC 2020


Hi Stes
> On 25.04.2020, at 14:45, stes <stes at telenet.be> wrote:
> 
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> 
> Minor technical issue.
> 
> Regarding platforms/unix/vm/include_ucontext.h
> 
> Solaris has a #include <sys/ucontext.h> so the build was working,
> but some versions adhere to the "Single Unix Specification v2" (SUS v2).
> 
> According to some info (I'm no expert in this) this is Solaris 7/8
> 
>           SUSv2        superset of SUS extended      Solaris 7
>                        to support POSIX.1b-1993,
>                        POSIX.1c-1996, and ISO/IEC
>                        9899 (C Standard)
>                        Amendment 1
> 
> Now that standard speficies that you can #include <ucontext.h>
> instead of #include <sys/ucontext.h>
> 
> Also see
> https://pubs.opengroup.org/onlinepubs/7908799/xsh/ucontext.h.html
> 
> I've added a small #ifdef __sun fix to use #include <ucontext.h> in the 
> Solaris case.
> 
> Alternatively perhaps the configure script could check for the
> existence of the <ucontext.h> header file ...

Thanks for pointing that out.

Meanwhile I found this: https://github.com/torproject/tor/blob/master/m4/pc_from_ucontext.m4
which suggests that simply using <ucontext.h> is not the best idea, funnily enough because of 
OSX (which is the only SUSv2 Unix I've ever used...)

We could use an updated version (https://github.com/gperftools/gperftools/blob/master/m4/pc_from_ucontext.m4)
and derive this information automatically.

what do you all think?


> 
> Unfortunately the #include's that the program issues,
> does have obviously major impact on the behaviour of the VM.
> 
> Another issue one of the fixes I submitted in the sunos branch is
> 
> or was :
> 
>  # include <sys/file.h> /* FASYNC or ioctl FIOASYNC will be issued  */
> 
> in the file platforms/unix/vm/aio.c
> 
> The issue there (completely unrelated to the ucontext.h issue) is that
> that header file determines how the code in aio.c works
> 
> Because in aio.c there is code
> 
> #if defined(O_ASYNC)
> #elif defined(FASYNC)
> #elif defined(FIOASYNC)
> 
> great care about the configuration of header files (#include) is needed.

Sorry, I have no Idea about that one.

Best regards
	-Tobias

> 
> Perhaps also in the case of aio.c this could be dealt with in the configure
> script.
> 
> The configure script could also in that case try to figure out what
> the correct #include is, but it has major impact of course on the
> behavior of the VM ...
> 
> David Stes
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iQEcBAEBCAAGBQJepDBDAAoJEAwpOKXMq1Mab1oH/iGxCG89bwpvE2PxVyAbRVkR
> LRPoT0t9GZydOr4qWHCGl13DOLvUUfLXH4vkSD1VHCC0Qlnxir9xwgIxSL1mDxpJ
> KhEOyddTwnfaALNiwJ9bU3HA5pRMwH1U9eCHhUdUJHXcx4YL9dt/zG9bIMwx+Z3y
> x92YqEqJ99qDeYPJ9Ap6KzRMC5/QgHxQWbS5GP1WrqpwzHbUtv7Y/sdXGtOVYfE2
> VKHEoCR+yHZjnige1kVF+WejDEvyFG+65ScicEFDfCXB7yXTHpxrkAbNkp2gO1xM
> PXnCe25yn6rj861N2ndmnL61iMk4rzqNMomDkaG+KT7CYa6bJdPMeHiXNOkZgxg=
> =IsL8
> -----END PGP SIGNATURE-----





More information about the Vm-dev mailing list