lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5036A182.7030707@gmail.com>
Date:	Thu, 23 Aug 2012 15:32:50 -0600
From:	David Ahern <dsahern@...il.com>
To:	Pekka Enberg <penberg@...nel.org>,
	Bernhard Rosenkraenzer <bernhard.rosenkranzer@...aro.org>
CC:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCHv2 1/1] perf: Port to Android

On 8/23/12 2:51 PM, Pekka Enberg wrote:
>> +#ifdef ANDROID
>> +/* While stdlib.h has a prototype for it,
>> +   Bionic doesn't actually implement on_exit() */
>> +#ifndef ATEXIT_MAX
>> +#define ATEXIT_MAX 32
>> +#endif
>> +static int __on_exit_count = 0;
>> +typedef void (*on_exit_func_t)(int, void*);
>> +static on_exit_func_t __on_exit_funcs[ATEXIT_MAX];
>> +static void *__on_exit_args[ATEXIT_MAX];
>> +static int __exitcode = 0;
>> +static void __handle_on_exit_funcs();
>> +static int on_exit(on_exit_func_t function, void *arg);
>> +#define exit(x) (exit)(__exitcode = (x))
>> +
>> +static int on_exit(on_exit_func_t function, void *arg) {
>> +       if(__on_exit_count == ATEXIT_MAX)
>> +               return ENOMEM;
>> +       else if(__on_exit_count == 0)
>> +               atexit(__handle_on_exit_funcs);
>> +       __on_exit_funcs[__on_exit_count] = function;
>> +       __on_exit_args[__on_exit_count++] = arg;
>> +       return 0;
>> +}
>> +
>> +static void __handle_on_exit_funcs() {
>> +       for(int i=0; i<__on_exit_count; i++) {
>> +               __on_exit_funcs[i](__exitcode, __on_exit_args[i]);
>> +       }
>> +}
>> +#endif
>> +

Why not add support for the missing functions (on_exit, getsid, psignal 
and getline) to Bionic instead of perf?


>> diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
>> index 0f99f39..77c5ced 100644
>> --- a/tools/perf/util/util.h
>> +++ b/tools/perf/util/util.h
>> @@ -70,15 +70,19 @@
>>   #include <sys/socket.h>
>>   #include <sys/ioctl.h>
>>   #include <sys/select.h>
>> +#ifndef ANDROID
>>   #include <netinet/in.h>
>>   #include <netinet/tcp.h>
>>   #include <arpa/inet.h>
>> +#endif
>>   #include <netdb.h>

netinet/*, arpa/inet.h,netdb.h and sys/socket.h can be removed from util.h

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ