[PULL wayland] fd leak checks and a socket fallback

Kristian Høgsberg krh at bitplanet.net
Mon Apr 23 01:35:35 PDT 2012


On Mon, Apr 23, 2012 at 4:22 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Sun, 22 Apr 2012 13:04:32 +0200
> Thiago Macieira <thiago.macieira at intel.com> wrote:
>
>> On sexta-feira, 20 de abril de 2012 16.46.52, Pekka Paalanen wrote:
>> > Hi Kristian,
>> >
>> > finally I am getting the test framework up for my OS wrappers. I added
>> > automatic fd leak checks, and helpers for checking fd leaks through
>> > exec(). They have their sanity tests.
>> >
>> > The other feature in this series is the fallback for socket() and
>> > SOCK_CLOEXEC flag, which is not supported in Bionic. It comes with
>> > tests for both normal use and a forced fallback hack.
>> >
>> > If this series looks acceptable, I can clean up the rest of my OS
>> > wrappers and write tests for them.
>>
>> Can I urge you to try the following first:
>>
>> #ifndef SOCK_CLOEXEC
>> # define SOCK_CLOEXEC 02000000
>> #endif
>
> Kristian,
>
> do you think the above approach would nicer instead of the #ifdef I
> have now?

Yeah, if that works (that is, if the kernel has the support and it's
just libc that's lacking), we should try that before falling back.

Kristian

>> And tell the bionic maintainers that this macro and O_CLOEXEC and other
>> similar system calls (pipe2, dup3, accept4) are a must in any thread-safe
>> software. We really need them.
>>
>> The accept4 system call, the last one of them to be introduced, came about in
>> kernel 2.6.28, the other ones in 2.6.27.
>>
>> PS: if you're reading this and you want to run Wayland on your non-Linux
>> system, you should also add those to your OS. Yesterday.
>
> Hi Thiago,
>
> you speak with the voice of reason. Unfortunately, I doubt reason or
> sanity is something to be strongly associated with Android. I'm not
> ready take on such battle for now.
>
>
> Thanks,
> pq


More information about the wayland-devel mailing list