| OLD | NEW |
| 1 diff --git a/Include/datetime.h b/Include/datetime.h | 1 diff --git a/Include/datetime.h b/Include/datetime.h |
| 2 --- a/Include/datetime.h | 2 --- a/Include/datetime.h |
| 3 +++ b/Include/datetime.h | 3 +++ b/Include/datetime.h |
| 4 @@ -169,6 +169,8 @@ typedef struct { | 4 @@ -169,6 +169,8 @@ typedef struct { |
| 5 | 5 |
| 6 #ifdef Py_BUILD_CORE | 6 #ifdef Py_BUILD_CORE |
| 7 | 7 |
| 8 +#define PyDataTime_STATIC 1 | 8 +#define PyDataTime_STATIC 1 |
| 9 + | 9 + |
| 10 /* Macros for type checking when building the Python core. */ | 10 /* Macros for type checking when building the Python core. */ |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 +int uname(struct utsname *buf) | 165 +int uname(struct utsname *buf) |
| 166 +{ | 166 +{ |
| 167 + sprintf(buf->sysname, "NaCl"); | 167 + sprintf(buf->sysname, "NaCl"); |
| 168 + return 0; | 168 + return 0; |
| 169 +} | 169 +} |
| 170 +#endif | 170 +#endif |
| 171 + | 171 + |
| 172 int | 172 int |
| 173 main(int argc, char **argv) | 173 main(int argc, char **argv) |
| 174 { | 174 { |
| 175 diff --git a/Modules/readline.c b/Modules/readline.c |
| 176 --- a/Modules/readline.c |
| 177 +++ b/Modules/readline.c |
| 178 @@ -1051,8 +1051,12 @@ setup_readline(readlinestate *mod_state) |
| 179 |
| 180 /* Wrapper around GNU readline that handles signals differently. */ |
| 181 |
| 182 - |
| 183 -#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) |
| 184 +/* |
| 185 + * Don't use the select()-based readline under Native Client. While select() |
| 186 + * is available and compile and link time it will fail at runtime under sel_ldr |
| 187 + * since there is no IRT/syscall implemenation of select(). |
| 188 + */ |
| 189 +#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) && !defined(__native_clie
nt__) |
| 190 |
| 191 static char *completed_input_string; |
| 192 static void |
| 175 diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c | 193 diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c |
| 176 --- a/Modules/signalmodule.c | 194 --- a/Modules/signalmodule.c |
| 177 +++ b/Modules/signalmodule.c | 195 +++ b/Modules/signalmodule.c |
| 178 @@ -29,7 +29,7 @@ | 196 @@ -29,7 +29,7 @@ |
| 179 # define PYPTHREAD_SIGMASK | 197 # define PYPTHREAD_SIGMASK |
| 180 #endif | 198 #endif |
| 181 | 199 |
| 182 -#if defined(PYPTHREAD_SIGMASK) && defined(HAVE_PTHREAD_H) | 200 -#if defined(PYPTHREAD_SIGMASK) && defined(HAVE_PTHREAD_H) |
| 183 +#if (defined(PYPTHREAD_SIGMASK) || defined(HAVE_PTHREAD_KILL)) && defined(HAVE_
PTHREAD_H) | 201 +#if (defined(PYPTHREAD_SIGMASK) || defined(HAVE_PTHREAD_KILL)) && defined(HAVE_
PTHREAD_H) |
| 184 # include <pthread.h> | 202 # include <pthread.h> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 handles[nhandles].ino = statb.st_ino; | 276 handles[nhandles].ino = statb.st_ino; |
| 259 } | 277 } |
| 260 } | 278 } |
| 261 +#endif | 279 +#endif |
| 262 | 280 |
| 263 dlopenflags = PyThreadState_GET()->interp->dlopenflags; | 281 dlopenflags = PyThreadState_GET()->interp->dlopenflags; |
| 264 | 282 |
| 265 diff --git a/Python/fileutils.c b/Python/fileutils.c | 283 diff --git a/Python/fileutils.c b/Python/fileutils.c |
| 266 --- a/Python/fileutils.c | 284 --- a/Python/fileutils.c |
| 267 +++ b/Python/fileutils.c | 285 +++ b/Python/fileutils.c |
| 268 @@ -707,6 +707,12 @@ set_inheritable(int fd, int inheritable, int raise, int *at
omic_flag_works) | 286 @@ -599,6 +599,12 @@ get_inheritable(int fd, int raise) |
| 287 |
| 288 flags = fcntl(fd, F_GETFD, 0); |
| 289 if (flags == -1) { |
| 290 +#if defined(__native_client__) && !defined(__GLIBC__) |
| 291 + /* When running under NaCl within the sel_ldr this fcntl() will always |
| 292 + fail. However we don't want to completely remove this block since |
| 293 + fcntl() is emulated using nacl_io when running within chrome. */ |
| 294 + return 0; |
| 295 +#endif |
| 296 if (raise) |
| 297 PyErr_SetFromErrno(PyExc_OSError); |
| 298 return -1; |
| 299 @@ -707,6 +713,12 @@ set_inheritable(int fd, int inheritable, int raise, int *at
omic_flag_works) |
| 269 /* slow-path: fcntl() requires two syscalls */ | 300 /* slow-path: fcntl() requires two syscalls */ |
| 270 flags = fcntl(fd, F_GETFD); | 301 flags = fcntl(fd, F_GETFD); |
| 271 if (flags < 0) { | 302 if (flags < 0) { |
| 272 +#if defined(__native_client__) && !defined(__GLIBC__) | 303 +#if defined(__native_client__) && !defined(__GLIBC__) |
| 273 + /* When running under NaCl within the sel_ldr this fcntl() will always
fail. | 304 + /* When running under NaCl within the sel_ldr this fcntl() will always |
| 274 + i However we don't want to completely remove this block since fcntl()
is | 305 + fail. However we don't want to completely remove this block since |
| 275 + emulated using nacl_io when running within chrome. */ | 306 + fcntl() is emulated using nacl_io when running within chrome. */ |
| 276 + return 0; | 307 + return 0; |
| 277 +#endif | 308 +#endif |
| 278 if (raise) | 309 if (raise) |
| 279 PyErr_SetFromErrno(PyExc_OSError); | 310 PyErr_SetFromErrno(PyExc_OSError); |
| 280 return -1; | 311 return -1; |
| 281 diff --git a/Python/getversion.c b/Python/getversion.c | 312 diff --git a/Python/getversion.c b/Python/getversion.c |
| 282 --- a/Python/getversion.c | 313 --- a/Python/getversion.c |
| 283 +++ b/Python/getversion.c | 314 +++ b/Python/getversion.c |
| 284 @@ -8,8 +8,8 @@ | 315 @@ -8,8 +8,8 @@ |
| 285 const char * | 316 const char * |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 OpenUNIX*|UnixWare*) | 473 OpenUNIX*|UnixWare*) |
| 443 @@ -2155,7 +2167,7 @@ then | 474 @@ -2155,7 +2167,7 @@ then |
| 444 LINKFORSHARED="-Wl,-E -Wl,+s";; | 475 LINKFORSHARED="-Wl,-E -Wl,+s";; |
| 445 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; | 476 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; |
| 446 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; | 477 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 447 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; | 478 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 448 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";; | 479 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 449 # -u libsys_s pulls in all symbols in libsys | 480 # -u libsys_s pulls in all symbols in libsys |
| 450 Darwin/*) | 481 Darwin/*) |
| 451 LINKFORSHARED="$extra_undefs -framework CoreFoundation" | 482 LINKFORSHARED="$extra_undefs -framework CoreFoundation" |
| OLD | NEW |