- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Redirect program I/O to /dev/console in C
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
04-21-2003 11:57 AM
04-21-2003 11:57 AM
Redirect program I/O to /dev/console in C
Any ideas??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2003 12:46 AM
04-22-2003 12:46 AM
Re: Redirect program I/O to /dev/console in C
fd = open(/usr/console
sprintf(fd, "%d",i);
sscanf(fd,"%d",&i);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2003 02:56 AM
04-22-2003 02:56 AM
Re: Redirect program I/O to /dev/console in C
int open(const char *path, int oflag)
oflag can be O_RDWR for read and write.
len = write(int fildes, const void *buf, size_t nbyte);
len is actual number of bytes written.
len = read(int fildes, void *buf, size_t nbyte);
len is actual number of bytes read.
Regards
VJ.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2003 04:31 AM
04-22-2003 04:31 AM
Re: Redirect program I/O to /dev/console in C
But if you are loggined on it, you can easy use the standard file descriptors ( stdin 0, stdout 1, stderr 2). Funtions like getc(), fgets() would be used sucessful if you start your program on console, or any other terminal.
___
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2003 04:48 AM
04-22-2003 04:48 AM
Re: Redirect program I/O to /dev/console in C
The initiated program will put the error on a que where "daemon" will pick it up & display to console.
I get an error trying to open O_RDWR but O_WRONLY opens OK but sprintf & sscanf don't yield any results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2003 04:49 AM
04-22-2003 04:49 AM
Re: Redirect program I/O to /dev/console in C
The initiating program will put the error on a que where "daemon" will pick it up & display to console.
I get an error trying to open O_RDWR but O_WRONLY opens OK but sprintf & sscanf don't yield any results