Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1056)

Side by Side Diff: third_party/tcmalloc/chromium/src/base/linux_syscall_support.h

Issue 14859005: Support Android in MallocHook for mmap, munmap and mremap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed digit's comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2005-2008, Google Inc. 1 /* Copyright (c) 2005-2008, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 #include <errno.h> 148 #include <errno.h>
149 #include <signal.h> 149 #include <signal.h>
150 #include <stdarg.h> 150 #include <stdarg.h>
151 #include <stddef.h> 151 #include <stddef.h>
152 #include <stdint.h> 152 #include <stdint.h>
153 #include <string.h> 153 #include <string.h>
154 #include <sys/ptrace.h> 154 #include <sys/ptrace.h>
155 #include <sys/resource.h> 155 #include <sys/resource.h>
156 #include <sys/time.h> 156 #include <sys/time.h>
157 #include <sys/types.h> 157 #include <sys/types.h>
158 #if defined(__ANDROID__)
159 #include <sys/syscall.h>
160 #include <sys/linux-syscalls.h>
161 #else
158 #include <syscall.h> 162 #include <syscall.h>
163 #endif
159 #include <unistd.h> 164 #include <unistd.h>
160 #include <linux/unistd.h> 165 #include <linux/unistd.h>
161 #include <endian.h> 166 #include <endian.h>
162 167
163 #ifdef __mips__ 168 #ifdef __mips__
164 /* Include definitions of the ABI currently in use. */ 169 /* Include definitions of the ABI currently in use. */
165 #include <sgidefs.h> 170 #include <sgidefs.h>
166 #endif 171 #endif
167 172
168 #endif 173 #endif
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 long st_mtime_; 469 long st_mtime_;
465 long st_mtime_nsec_; 470 long st_mtime_nsec_;
466 long st_ctime_; 471 long st_ctime_;
467 long st_ctime_nsec_; 472 long st_ctime_nsec_;
468 int st_blksize; 473 int st_blksize;
469 int st_blocks; 474 int st_blocks;
470 int st_pad4[14]; 475 int st_pad4[14];
471 }; 476 };
472 #endif 477 #endif
473 478
479 // ulong is not defined in Android while used to define __llseek.
480 #if defined(__ANDROID__)
481 typedef unsigned long int ulong;
482 #endif
483
474 484
475 /* Definitions missing from the standard header files */ 485 /* Definitions missing from the standard header files */
476 #ifndef O_DIRECTORY 486 #ifndef O_DIRECTORY
477 #if defined(__arm__) 487 #if defined(__arm__)
478 #define O_DIRECTORY 0040000 488 #define O_DIRECTORY 0040000
479 #else 489 #else
480 #define O_DIRECTORY 0200000 490 #define O_DIRECTORY 0200000
481 #endif 491 #endif
482 #endif 492 #endif
483 #ifndef PR_GET_DUMPABLE 493 #ifndef PR_GET_DUMPABLE
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 #if defined(__x86_64__) || \ 1964 #if defined(__x86_64__) || \
1955 defined(__arm__) || \ 1965 defined(__arm__) || \
1956 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) 1966 (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32)
1957 LSS_INLINE _syscall4(pid_t, wait4, pid_t, p, 1967 LSS_INLINE _syscall4(pid_t, wait4, pid_t, p,
1958 int*, s, int, o, 1968 int*, s, int, o,
1959 struct kernel_rusage*, r) 1969 struct kernel_rusage*, r)
1960 LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){ 1970 LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){
1961 return LSS_NAME(wait4)(pid, status, options, 0); 1971 return LSS_NAME(wait4)(pid, status, options, 0);
1962 } 1972 }
1963 #endif 1973 #endif
1964 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) 1974 #if (defined(__i386__) || defined(__x86_64__) || defined(__arm__)) && \
1975 !defined(__ANDROID__)
1965 LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m) 1976 LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m)
1966 #endif 1977 #endif
1967 LSS_INLINE int LSS_NAME(sigemptyset)(struct kernel_sigset_t *set) { 1978 LSS_INLINE int LSS_NAME(sigemptyset)(struct kernel_sigset_t *set) {
1968 memset(&set->sig, 0, sizeof(set->sig)); 1979 memset(&set->sig, 0, sizeof(set->sig));
1969 return 0; 1980 return 0;
1970 } 1981 }
1971 1982
1972 LSS_INLINE int LSS_NAME(sigfillset)(struct kernel_sigset_t *set) { 1983 LSS_INLINE int LSS_NAME(sigfillset)(struct kernel_sigset_t *set) {
1973 memset(&set->sig, -1, sizeof(set->sig)); 1984 memset(&set->sig, -1, sizeof(set->sig));
1974 return 0; 1985 return 0;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 return rc; 2269 return rc;
2259 } 2270 }
2260 #endif 2271 #endif
2261 2272
2262 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) 2273 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
2263 } 2274 }
2264 #endif 2275 #endif
2265 2276
2266 #endif 2277 #endif
2267 #endif 2278 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698