I will test too soon, well, gustavo can do it :)
Enviado do meu iPhone
> Em 12 de out. de 2023, à(s) 19:22, Alan C. Assis escreveu:
>
> Did you try popen() ?
>
> https://stackoverflow.com/questions/43116/how-can-i-run-an-external-program-from-c-and-parse-its-output
>
> Look the example at ap
Wow! Maybe sprintf, right ?
Enviado do meu iPhone
> Em 12 de out. de 2023, à(s) 18:31, Gregory Nutt
> escreveu:
>
>
>> On 10/12/2023 3:26 PM, MIGUEL ALEXANDRE WISINTAINER wrote:
>> Some idea how to capture the data returned by exec ?
>
> exec does really return any data other than an int st
Did you try popen() ?
https://stackoverflow.com/questions/43116/how-can-i-run-an-external-program-from-c-and-parse-its-output
Look the example at apps/examples/popen
BR,
Alan
On 10/12/23, MIGUEL ALEXANDRE WISINTAINER wrote:
> Some idea how to capture the data returned by exec ?
>
> Enviado do
Here is some history and justification for the naming.
Uros Platise created the built-in tasks in 2012 and provided the
naming. I would have preferred another name to avoid the conflicts.
The meaning of external only makes sense with respect what is internal.
If you are think from the persp
On 10/12/2023 3:26 PM, MIGUEL ALEXANDRE WISINTAINER wrote:
Some idea how to capture the data returned by exec ?
exec does really return any data other than an int status code which
only indicates if the task was correctly started.
If you want some text output, you would have to add instrum
Some idea how to capture the data returned by exec ?
Enviado do meu iPhone
> Em 12 de out. de 2023, à(s) 18:16, Alan C. Assis escreveu:
>
> Hi Greg,
>
>> On 10/12/23, Gregory Nutt wrote:
>>
>>> On 10/12/2023 2:18 PM, Alan C. Assis wrote:
>>> The execv on Linux also fails when we can an buil
Hi Greg,
On 10/12/23, Gregory Nutt wrote:
>
> On 10/12/2023 2:18 PM, Alan C. Assis wrote:
>> The execv on Linux also fails when we can an builtin program, try it:
>
> You are right, but the semantics are really confusing. In Bash,
> commands that are included inside of Bash are called built-in c
thank you Gregory
De: Gregory Nutt
Enviado: quinta-feira, 12 de outubro de 2023 21:06
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet ?
On 10/12/2023 2:18 PM, Alan C. Assis wrote:
> The execv on Linux also fails when we can an builtin program, try
On 10/12/2023 2:18 PM, Alan C. Assis wrote:
The execv on Linux also fails when we can an builtin program, try it:
You are right, but the semantics are really confusing. In Bash,
commands that are included inside of Bash are called built-in commands
and you cannot execute them. We ignore t
On 10/12/2023 2:05 PM, Alan C. Assis wrote:
Ah ok, I tested using the original code with "ls" instead "/bin/ls"
and the result as similar to NuttX: didn't print anything.
That is a different problem; it did not find ls. On linux, use /execvp/
instead of /execv //or //execve/. With execve, y
i just compiled i2c tools first...
De: Gregory Nutt
Enviado: quinta-feira, 12 de outubro de 2023 20:51
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet ?
On 10/12/2023 2:31 PM, MIGUEL ALEXANDRE WISINTAINER wrote:
> I can run (execv) i2c from hello
ss is
specified, that address will be re-used until it is changed.
WARNING:
o The I2C dev command may have bad side effects on your I2C devices.
Use only at your own risk.
nsh>
De: Gregory Nutt
Enviado: quinta-feira, 12 de outubro de 2023 20:51
Para: dev
On 10/12/2023 2:31 PM, MIGUEL ALEXANDRE WISINTAINER wrote:
I can run (execv) i2c from hello 🙂
works!
Now Gustavo can you this TIP to make work the PCA/PCF GPIO extender 🙂
Thanks!
nsh> hello
Executing 1 /bin/i2c
Usage: i2c [arguments]
Where is one of:
There are several
De: Alan C. Assis
Enviado: quinta-feira, 12 de outubro de 2023 20:05
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet ?
Ah ok, I tested using the original code with "ls" instead "/bin/ls"
and the result as similar to NuttX: didn't print anything.
I discov
ot because it is easy! But because we thought it was easy!
> nsh>
>
> Just used the DEBUG to find-out the issue, the debug binary loader
> said exactly what was the issue.
>
> BR,
>
> Alan
>
> On 10/12/23, MIGUEL ALEXANDRE WISINTAINER wrote:
>> 1 hour ago,
binary loader
said exactly what was the issue.
BR,
Alan
On 10/12/23, MIGUEL ALEXANDRE WISINTAINER wrote:
> 1 hour ago, not 1 year ago🙂
>
> De: MIGUEL ALEXANDRE WISINTAINER
> Enviado: quinta-feira, 12 de outubro de 2023 19:07
> Para: dev@nuttx.a
when have time, test there Alan
De: Alan C. Assis
Enviado: quinta-feira, 12 de outubro de 2023 18:48
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet ?
Hi Miguel,
I suggest you to try first in the Linux.
NuttX should give you the same result ;-)
BR
1 hour ago, not 1 year ago🙂
De: MIGUEL ALEXANDRE WISINTAINER
Enviado: quinta-feira, 12 de outubro de 2023 19:07
Para: dev@nuttx.apache.org
Assunto: RE: execv obsolet ?
yes, i already had done that 1 year ago
ubuntu@DESKTOP-GRCNLV8:~$ nano hello_main.c
ubuntu
intf("Executing 1 %s \n", args[0]);
execv(args[0], args);
}
De: Alan C. Assis
Enviado: quinta-feira, 12 de outubro de 2023 18:48
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet ?
Hi Miguel,
I suggest you to try first in the Linux.
Nutt
> #endif
> {
>
> if (argc < 2)
> {
> static char * const args[2] =
> {
> "ls",
> NULL
> };
>
> execv(args[0], args);
> }
> De: Xiang Xiao
> Enviado: quinta-feira, 12 de outubro de 2023 18:08
> Para: dev@nuttx.apache
, char *argv[])
#endif
{
if (argc < 2)
{
static char * const args[2] =
{
"ls",
NULL
};
execv(args[0], args);
}
De: Xiang Xiao
Enviado: quinta-feira, 12 de outubro de 2023 18:08
Para: dev@nuttx.apache.org
Assunto: Re: execv obsolet
you need enable CONFIG_LIBC_EXECFUNCS:
https://github.com/apache/nuttx/blob/master/libs/libc/unistd/lib_execv.c#L29
On Fri, Oct 13, 2023 at 1:59 AM MIGUEL ALEXANDRE WISINTAINER <
tcpipc...@hotmail.com> wrote:
> #include
> #include
> #include
> #include
>
> #ifdef CONFIG_BUILD_KERNEL
> int mai
#include
#include
#include
#include
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int hello_main(int argc, char *argv[])
#endif
{
if (argc < 2)
{
static char * const args[2] =
{
"/bin/ls",
NULL
};
execv(args[0], args);
}
23 matches
Mail list logo