- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- terminal $QIO test for read
Operating System - OpenVMS
1753883
Members
7523
Online
108809
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2011 05:52 AM
тАО02-28-2011 05:52 AM
Re: terminal $QIO test for read
Dear Hein,
thank you very much for code example.
If the
sys$qiow(efn,ttchan,IO$_SENSEMODE|IO$M_TYPEAHDCNT,&iosb, 0,0, &vkbuff,0,0,0,0,0);
be able to sleep while nothing to read vkbuff.number is equal to 0 this should be very great.
But it returns immediately.
thank you very much for code example.
If the
sys$qiow(efn,ttchan,IO$_SENSEMODE|IO$M_TYPEAHDCNT,&iosb, 0,0, &vkbuff,0,0,0,0,0);
be able to sleep while nothing to read vkbuff.number is equal to 0 this should be very great.
But it returns immediately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2011 06:59 AM
тАО02-28-2011 06:59 AM
Re: terminal $QIO test for read
>> If the ...IO$_SENSEMODE|IO$M_TYPEAHDCNT ...
be able to sleep while nothing to read
Ah, now I understand your question better.
I was only answering the first question
>> I'm need to check if terminal have something to read.
That's exactly what the sensemode does but not what you want, nor as others pointed out what you want to use as it leads to polling algorithms.
>> Mailbox driver has a good IO$M_READATTN
Yes, that warn but takes no action.
This is not available in the terminal driver.
The closest thing is the OUTBAND setmode, but that initiated with selected control characters. Not generic.
And I suppose you could issue a 1 byte read with AST, but then that byte will be in the buffer. That becomes awkward quickly.
You'll probably want to create a wrappers to be able to give a 'read_terminal' routine which does not actually do a qio, but returns the data from a qio which already completed.
You can decide whether the program processes each read completely before issuing the next, or just keeps on reading fulling multiple buffers if need be.
As John indicated it is often handy to use SYS$DCLAST to get the show rolling. Probably passing control block parameter with IOSB and buffer and whatever else is handy to keep all context pointed to in one parameter.
The IOSB is needed if you do fancy terminator handling.... but for anything fancy yo may want to look at SMG or similar.
Cheers,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2011 10:16 AM
тАО02-28-2011 10:16 AM
Re: terminal $QIO test for read
If that's the actual C code being tested, consider adding return status and IOSB status checks into the C code.
Status checks are a defensive coding technique that often helps track the triggers of errors, and can provide an effective means of avoiding a application stackdump when something gets tangled and trips on an earlier and unhandled error within the application.
Also consider moving away from hard-coding a static EFN (and particularly not using an EF that the lib$get_ef call "owns" and can pass out) and moving to an allocated event flag or (for something akin to this case) to ENF$C_ENF "don't care" event flag, too.
ENF$C_ENF is defined in EFNDEF.H
Status checks are a defensive coding technique that often helps track the triggers of errors, and can provide an effective means of avoiding a application stackdump when something gets tangled and trips on an earlier and unhandled error within the application.
Also consider moving away from hard-coding a static EFN (and particularly not using an EF that the lib$get_ef call "owns" and can pass out) and moving to an allocated event flag or (for something akin to this case) to ENF$C_ENF "don't care" event flag, too.
ENF$C_ENF is defined in EFNDEF.H
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP