@@ -117,18 +117,22 @@ modules so that embedders need not implement all of it.
117
117
118
118
Read command-line argument data.
119
119
120
- The sizes of the buffers should match that returned by [ ` __wasi_args_sizes_get() ` ] ( #args_sizes_get ) .
121
-
122
120
Inputs:
123
121
124
122
- <a href =" #args_get.argv " name =" args_get.argv " ></a ><code >char \*\* <strong >argv</strong ></code >
125
123
126
124
A pointer to a buffer to write the argument pointers.
127
125
126
+ The count of elements for the buffer should be at least the value of ` argc ` returned by [ ` __wasi_args_sizes_get() ` ] ( #args_sizes_get ) .
127
+
128
+ The caller of ` __wasi_args_get() ` is responsible for allocating an additional element for a terminating NULL pointer, if necessary.
129
+
128
130
- <a href =" #args_get.argv_buf " name =" args_get.argv_buf " ></a ><code >char \* <strong >argv\_ buf</strong ></code >
129
131
130
132
A pointer to a buffer to write the argument string data.
131
133
134
+ The size of this buffer should be the value of ` argv_buf_size ` returned by [ ` __wasi_args_sizes_get() ` ] ( #args_sizes_get ) .
135
+
132
136
### <a href =" #args_sizes_get " name =" args_sizes_get " ></a >` __wasi_args_sizes_get() `
133
137
134
138
Return command-line argument data sizes.
@@ -192,21 +196,25 @@ Outputs:
192
196
193
197
Read environment variable data.
194
198
195
- The sizes of the buffers should match that returned by [ ` __wasi_environ_sizes_get() ` ] ( #environ_sizes_get ) .
196
-
197
199
Inputs:
198
200
199
201
- <a href =" #environ_get.environ " name =" environ_get.environ " ></a ><code >char \*\* <strong >environ</strong ></code >
200
202
201
203
A pointer to a buffer to write the environment variable pointers.
202
204
205
+ The count of elements for the buffer should be at least the value of ` environ_count ` returned by [ ` __wasi_environ_sizes_get() ` ] ( #environ_sizes_get ) .
206
+
207
+ The caller of ` __wasi_environ_get() ` is responsible for allocating an additional element for a terminating NULL pointer, if necessary.
208
+
203
209
- <a href =" #environ_get.environ_buf " name =" environ_get.environ_buf " ></a ><code >char \* <strong >environ\_ buf</strong ></code >
204
210
205
211
A pointer to a buffer to write the environment variable string data.
206
212
213
+ The size of this buffer should be the value of ` environ_buf_size ` returned by [ ` __wasi_environ_sizes_get() ` ] ( #environ_sizes_get ) .
214
+
207
215
### <a href =" #environ_sizes_get " name =" environ_sizes_get " ></a >` __wasi_environ_sizes_get() `
208
216
209
- Return command-line argument data sizes.
217
+ Return enviroment variable data sizes.
210
218
211
219
Outputs:
212
220
0 commit comments