am cd6748cd: Merge "Clean up various warnings in bionic."
* commit 'cd6748cdd7bcab702fe0bf6de943eb832f4fb762': Clean up various warnings in bionic.
This commit is contained in:
commit
d4c049e023
@ -67,13 +67,11 @@ libc_common_src_files := \
|
|||||||
bionic/md5.c \
|
bionic/md5.c \
|
||||||
bionic/memmem.c \
|
bionic/memmem.c \
|
||||||
bionic/memswap.c \
|
bionic/memswap.c \
|
||||||
bionic/name_mem.c \
|
|
||||||
bionic/pathconf.c \
|
bionic/pathconf.c \
|
||||||
bionic/perror.c \
|
bionic/perror.c \
|
||||||
bionic/ptsname.c \
|
bionic/ptsname.c \
|
||||||
bionic/ptsname_r.c \
|
bionic/ptsname_r.c \
|
||||||
bionic/pututline.c \
|
bionic/pututline.c \
|
||||||
bionic/reboot.c \
|
|
||||||
bionic/recv.c \
|
bionic/recv.c \
|
||||||
bionic/sched_cpualloc.c \
|
bionic/sched_cpualloc.c \
|
||||||
bionic/sched_cpucount.c \
|
bionic/sched_cpucount.c \
|
||||||
@ -212,6 +210,7 @@ libc_bionic_src_files := \
|
|||||||
bionic/abort.cpp \
|
bionic/abort.cpp \
|
||||||
bionic/access.cpp \
|
bionic/access.cpp \
|
||||||
bionic/assert.cpp \
|
bionic/assert.cpp \
|
||||||
|
bionic/__bionic_name_mem.cpp \
|
||||||
bionic/bionic_time_conversions.cpp \
|
bionic/bionic_time_conversions.cpp \
|
||||||
bionic/brk.cpp \
|
bionic/brk.cpp \
|
||||||
bionic/chmod.cpp \
|
bionic/chmod.cpp \
|
||||||
@ -268,6 +267,7 @@ libc_bionic_src_files := \
|
|||||||
bionic/ptrace.cpp \
|
bionic/ptrace.cpp \
|
||||||
bionic/raise.cpp \
|
bionic/raise.cpp \
|
||||||
bionic/readlink.cpp \
|
bionic/readlink.cpp \
|
||||||
|
bionic/reboot.cpp \
|
||||||
bionic/rename.cpp \
|
bionic/rename.cpp \
|
||||||
bionic/rmdir.cpp \
|
bionic/rmdir.cpp \
|
||||||
bionic/sbrk.cpp \
|
bionic/sbrk.cpp \
|
||||||
|
@ -28,26 +28,23 @@
|
|||||||
|
|
||||||
#include "private/bionic_name_mem.h"
|
#include "private/bionic_name_mem.h"
|
||||||
|
|
||||||
/*
|
#include <sys/prctl.h>
|
||||||
* Local definitions of custom prctl arguments to set a vma name in some kernels
|
|
||||||
*/
|
// Local definitions of custom prctl arguments to set a vma name in some kernels.
|
||||||
#define BIONIC_PR_SET_VMA 0x53564d41
|
#define BIONIC_PR_SET_VMA 0x53564d41
|
||||||
#define BIONIC_PR_SET_VMA_ANON_NAME 0
|
#define BIONIC_PR_SET_VMA_ANON_NAME 0
|
||||||
|
|
||||||
/*
|
// Names a region of memory. The name is expected to show up in /proc/pid/maps
|
||||||
* Names a region of memory. The name is expected to show up in /proc/pid/maps
|
// and /proc/pid/smaps. There is no guarantee that it will work, and if it
|
||||||
* and /proc/pid/smaps. There is no guarantee that it will work, and it if it
|
// does work it is likely to only work on memory that was allocated with
|
||||||
* does work it is likely to only work on memory that was allocated with
|
// mmap(MAP_ANONYMOUS), and only on regions that are page aligned. name should
|
||||||
* mmap(MAP_ANONYMOUS), and only on regions that are page aligned. name should
|
// be a pointer to a string that is valid for as long as the memory is mapped,
|
||||||
* be a pointer to a string that is valid for as long as the memory is mapped,
|
// preferably a compile-time constant string.
|
||||||
* preferably a compile-time constant string.
|
//
|
||||||
*
|
// Returns -1 on error and sets errno. If it returns an error naming page
|
||||||
* Returns -1 on error and sets errno. If it returns an error naming page
|
// aligned anonymous memory the kernel doesn't support naming, and an alternate
|
||||||
* aligned anonymous memory the kernel doesn't support naming, and an alternate
|
// method of naming memory should be used (like ashmem).
|
||||||
* method of naming memory should be used (like ashmem).
|
|
||||||
*/
|
int __bionic_name_mem(void* addr, size_t len, const char* name) {
|
||||||
int __bionic_name_mem(void *addr, size_t len, const char *name)
|
return prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME, addr, len, name);
|
||||||
{
|
|
||||||
return prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME,
|
|
||||||
addr, len, name);
|
|
||||||
}
|
}
|
@ -25,10 +25,12 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/reboot.h>
|
#include <sys/reboot.h>
|
||||||
|
|
||||||
int reboot (int mode)
|
extern "C" int __reboot(int, int, int, void*);
|
||||||
{
|
|
||||||
return __reboot( LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, mode, NULL );
|
int reboot(int mode) {
|
||||||
|
return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, mode, NULL);
|
||||||
}
|
}
|
@ -25,6 +25,7 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _BIONIC_NAME_MEM_H
|
#ifndef _BIONIC_NAME_MEM_H
|
||||||
#define _BIONIC_NAME_MEM_H
|
#define _BIONIC_NAME_MEM_H
|
||||||
|
|
||||||
@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
int __bionic_name_mem(void *addr, size_t len, const char *name);
|
int __bionic_name_mem(void* addr, size_t len, const char* name);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
@ -47,4 +47,8 @@
|
|||||||
/* This one is only needed as long as we have a mix of OpenBSD and FreeBSD stdio. */
|
/* This one is only needed as long as we have a mix of OpenBSD and FreeBSD stdio. */
|
||||||
#define _sseek __sseek
|
#define _sseek __sseek
|
||||||
|
|
||||||
|
/* This is in BSD's <stdlib.h>. */
|
||||||
|
#include <stdint.h>
|
||||||
|
extern uint32_t arc4random_uniform(uint32_t upper_bound);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
#include <time.h>
|
||||||
#include "private/arpa_nameser.h"
|
#include "private/arpa_nameser.h"
|
||||||
|
|
||||||
#define ISC_FORMAT_PRINTF(a,b) __printflike(a,b)
|
#define ISC_FORMAT_PRINTF(a,b) __printflike(a,b)
|
||||||
|
@ -23,4 +23,7 @@
|
|||||||
#define __strong_reference(sym,aliassym) \
|
#define __strong_reference(sym,aliassym) \
|
||||||
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
|
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
|
||||||
|
|
||||||
|
/* digittoint is in BSD's <ctype.h>. */
|
||||||
|
int digittoint(char ch);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user