Commit 7345eec
committed
Avoid repeating original argv[0]
resolves #6
binfmt-dispatcher gets typically registered to binfmt-misc with flags `POCF`.
- `P` will preserve the original argv[0] used
- `O` will give the resolved binary (e.g. after symlink derefence) as an open file in fd 3
- but we can't use it as-is as FEX (at least) doesn't support taking "pathname" (execve) as an open file descriptor.
- `C` and `F` are irrelevant here.
To support properly binary file already open as fd 3, FEX needs to be patched to use
`fexecve(3, argv, env)` kind of call when requested, it doesn't appear to support it yet.
Signed-off-by: Fabrice A. Marie <[email protected]>1 parent c195c9e commit 7345eec
1 file changed
+4
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
| |||
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
159 | | - | |
160 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
| |||
0 commit comments