Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/sagemath/pari/src/patches/01-pipes.patch
1070 views
1
WASM doesn't have popen or pipes, since you can't even create other processes.
2
So #ifdef UNIX is obviously not enough.
3
We just patch the use of this to disable
4
it explicitly. Also the fallback code
5
returns NULL instead of 0, so we fix that.
6
7
8
--- native/src/language/es.c 2022-10-30 09:07:08
9
+++ wasm/src/language/es.c 2023-02-02 13:59:56
10
@@ -3315,6 +3315,8 @@
11
# define O_RDONLY 0
12
#endif
13
14
+#undef HAVE_PIPES
15
+
16
pariFILE *
17
newfile(FILE *f, const char *name, int type)
18
{
19
@@ -4990,7 +4992,7 @@
20
{
21
#ifndef HAVE_PIPES
22
pari_err(e_ARCH,"pipes");
23
- return NULL;/*LCOV_EXCL_LINE*/
24
+ return 0; //NULL;/*LCOV_EXCL_LINE*/
25
#else
26
FILE *f;
27
check_secure(s);
28
29