Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   issues at MORE prompt in running "ps" command on crash from within another C program (http://www.linux-archive.org/crash-utility/653931-issues-more-prompt-running-ps-command-crash-within-another-c-program.html)

Nayna Jain 04-08-2012 03:47 PM

issues at MORE prompt in running "ps" command on crash from within another C program
 
Hi,
I am trying to provide a console from within Eclipse IDE for crash.This way they can execute commands on crash prompt from within Eclipse.
To make this work, first I tried to write a simple C program which invokes crash from within the program on a tty.
It uses forkpty for this purpose and then execv the crash.
It works fine, crash prompt is reached.few commands having small outputs works fine.
But commands like ps which works along with "more" to do paging of output has issue.
When it stops at the line of MORE.. expecting input from user like SPACE, q, b etc., it doesn't recognize it directly.I have to type SPACE and then ENTER. q and then ENTER.What termios setting is required to make it work ? Can someone please help with this issue ? How do I make it recognize SPACE, q , at MORE prompt.?

--
Courage is not the absence of fear but rather the judgment that
something is more important than fear. The brave may not live forever
but the cautious do not live at all. -- The Princess Diaries



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Adrien Kunysz 04-09-2012 02:08 PM

issues at MORE prompt in running "ps" command on crash from within another C program
 
On Sun, Apr 8, 2012 at 4:47 PM, Nayna Jain <jainnayna@gmail.com> wrote:
> Hi,
>
> I am trying to provide a console from within Eclipse IDE for crash.
> This way they can execute commands on crash prompt from within Eclipse.
>
> To make this work, first I tried to write a simple C program which invokes
> crash from within the program on a tty.
> It uses forkpty for this purpose and then execv the crash.
>
> It works fine, crash prompt is reached.
> few commands having small outputs works fine.
>
> But commands like ps which works along with "more" to do paging of output
> has issue.
> When it stops at the line of MORE.. expecting input from user like SPACE, q,
> b etc., it doesn't recognize it directly.
> I have to type SPACE and then ENTER. q and then ENTER.
> What termios setting is required to make it work ? Can someone please help
> with this issue ? How do I make it recognize SPACE, q , at MORE prompt.?

I think you are looking for ~ICANNON.

> --
> Courage is not the absence of fear but rather the judgment that something is
> more important than fear. The brave may not live forever but the cautious do
> not live at all. -- The Princess Diaries
>
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Nayna Jain 04-09-2012 02:19 PM

issues at MORE prompt in running "ps" command on crash from within another C program
 
HI Andrien,
Thanks !!
I tried this on STDIN but doesn' work.I should apply this on STDIN_FILE or STDOUT_FILE or STDERR_FILE ?Currently what I have done is -

struct termios stdin_term_settings;* * * * tcgetattr(STDIN_FILENO, &stdin_term_settings);* * * * stdin_term_settings.c_lflag &= ~ECHO & ~ICANON;* * * * tcsetattr(STDIN_FILENO, TCSANOW, &stdin_term_settings);

But this is not working... At MORE prompt it still doesn't recognize SPACE. What I am doing wrong ?
Thanks & Regards,* * *- Nayna

On Mon, Apr 9, 2012 at 7:38 PM, Adrien Kunysz <adk@acunu.com> wrote:

On Sun, Apr 8, 2012 at 4:47 PM, Nayna Jain <jainnayna@gmail.com> wrote:

> Hi,

>

> I am trying to provide a console from within Eclipse IDE for crash.

> This way they can execute commands on crash prompt from within Eclipse.

>

> To make this work, first I tried to write a simple C program which invokes

> crash from within the program on a tty.

> It uses forkpty for this purpose and then execv the crash.

>

> It works fine, crash prompt is reached.

> few commands having small outputs works fine.

>

> But commands like ps which works along with "more" to do paging of output

> has issue.

> When it stops at the line of MORE.. expecting input from user like SPACE, q,

> b etc., it doesn't recognize it directly.

> I have to type SPACE and then ENTER. q and then ENTER.

> What termios setting is required to make it work ? Can someone please help

> with this issue ? How do I make it recognize SPACE, q , at MORE prompt.?



I think you are looking for ~ICANNON.



> --

> Courage is not the absence of fear but rather the judgment that something is

> more important than fear. The brave may not live forever but the cautious do

> not live at all. -- The Princess Diaries

>

>

> --

> Crash-utility mailing list

> Crash-utility@redhat.com

> https://www.redhat.com/mailman/listinfo/crash-utility

>



--

Crash-utility mailing list

Crash-utility@redhat.com

https://www.redhat.com/mailman/listinfo/crash-utility



--
Courage is not the absence of fear but rather the judgment that
something is more important than fear. The brave may not live forever
but the cautious do not live at all. -- The Princess Diaries



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.