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

Side by Side Diff: sandbox/linux/seccomp/debug.cc

Issue 164373: Fix seccomp sandbox for gcc44 (Closed)
Patch Set: Created 11 years, 4 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 | sandbox/linux/seccomp/sandbox.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef NDEBUG 1 #ifndef NDEBUG
2 2
3 #include "debug.h" 3 #include "debug.h"
4 4
5 namespace playground { 5 namespace playground {
6 6
7 bool Debug::enabled_; 7 bool Debug::enabled_;
8 int Debug::numSyscallNames_; 8 int Debug::numSyscallNames_;
9 const char **Debug::syscallNames_; 9 const char **Debug::syscallNames_;
10 std::map<int, std::string> Debug::syscallNamesMap_; 10 std::map<int, std::string> Debug::syscallNamesMap_;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void Debug::syscall(int sysnum, const char* msg, int call) { 141 void Debug::syscall(int sysnum, const char* msg, int call) {
142 // This function gets called from the system call wrapper. Avoid calling 142 // This function gets called from the system call wrapper. Avoid calling
143 // any library functions that themselves need system calls. 143 // any library functions that themselves need system calls.
144 if (enabled_) { 144 if (enabled_) {
145 const char *sysname = NULL; 145 const char *sysname = NULL;
146 if (sysnum >= 0 && sysnum < numSyscallNames_) { 146 if (sysnum >= 0 && sysnum < numSyscallNames_) {
147 sysname = syscallNames_[sysnum]; 147 sysname = syscallNames_[sysnum];
148 } 148 }
149 char unnamed[40] = "Unnamed syscall #"; 149 char unnamed[40] = "Unnamed syscall #";
150 if (!sysname) { 150 if (!sysname) {
151 itoa(strrchr(sysname = unnamed, '\000'), sysnum); 151 itoa(const_cast<char*>(strrchr(sysname = unnamed, '\000')), sysnum);
152 } 152 }
153 #if defined(__NR_socketcall) || defined(__NR_ipc) 153 #if defined(__NR_socketcall) || defined(__NR_ipc)
154 char extra[40]; 154 char extra[40];
155 *extra = '\000'; 155 *extra = '\000';
156 #if defined(__NR_socketcall) 156 #if defined(__NR_socketcall)
157 if (sysnum == __NR_socketcall) { 157 if (sysnum == __NR_socketcall) {
158 static const char* socketcall_name[] = { 158 static const char* socketcall_name[] = {
159 0, "socket", "bind", "connect", "listen", "accept", "getsockname", 159 0, "socket", "bind", "connect", "listen", "accept", "getsockname",
160 "getpeername", "socketpair", "send", "recv", "sendto","recvfrom", 160 "getpeername", "socketpair", "send", "recv", "sendto","recvfrom",
161 "shutdown", "setsockopt", "getsockopt", "sendmsg", "recvmsg", 161 "shutdown", "setsockopt", "getsockopt", "sendmsg", "recvmsg",
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 *s-- = *start; 216 *s-- = *start;
217 *start++ = ch; 217 *start++ = ch;
218 } 218 }
219 219
220 return ret; 220 return ret;
221 } 221 }
222 222
223 } // namespace 223 } // namespace
224 224
225 #endif // NDEBUG 225 #endif // NDEBUG
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp/sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698