qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platf


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platform
Date: Tue, 6 Oct 2015 06:13:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/06/2015 03:47 AM, Stefan Hajnoczi wrote:
> On Sat, Oct 03, 2015 at 12:44:14PM +0800, Houcheng Lin wrote:
>> diff --git a/configure b/configure
>> index d7c24cd..cda88c1 100755

>> +++ b/include/qemu/osdep.h
>> @@ -74,6 +74,14 @@ typedef unsigned int            uint_fast16_t;
>>  typedef signed int              int_fast16_t;
>>  #endif
>>  
>> +#ifdef CONFIG_ANDROID
>> +/*
>> + * For include the basename prototyping in android.
>> + */
>> +#include <libgen.h>
> 
> Files that use basename(3) should include libgen.h.  Why include it
> here?

What is using basename(3)? POSIX gives basename(3) a worthless contract
- it is free to return non-thread-safe storage.  Also, it is not
portable to Windows-style drive-letters, so I consider any code using
<libgen.h> to already be suspect.

If you are already writing code to be ported to both Unixy and windows
systems, you are better off rolling your own alternative to basename (or
better, using something else that has already rolled a portable version
for you - while I know gnulib does that, we aren't using gnulib; but I
assume glib has something along those lines even though I haven't looked
for it).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]