LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2009, 11:51 PM   #1
mrsq
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Thumbs up Ignoring MODEM control commands on pty driver.


i am using the pty driver to communicate between 2 processes. on the master side i am creating a master pty and in the slave side, i am using the slave name to create the slave file descriptor.

On the master side i am trying the ioctl TIOCMGET comamnd for modem control, which is not valid for a pty driver. so i am getting the ioctl failure.

But is there any way, i can ignore the TIOCMGET call and return ioctl success.

Sample Code given below:


int devfd;
char slave[12];
int status = 0;

pid = forkpty(&devfd,slave,NULL,NULL);

status = grantpt(devfd);
if (status != -1)
status = unlockpt(devfd);


status = ioctl(devfd, TIOCMGET,&arg);
printf("ioctl21 TIOCMGET status =%d, errno = %d\n",status,errno);

--- Here i get the status as -1 and errno = 22 (EINVAL).

--- can anybode help me in getting this sattus as 0, for this pty. I dont want any modem commands, only i want the ioctl to succeed.

--Many thanks

Last edited by mrsq; 09-02-2009 at 11:52 PM. Reason: corrected TIOCMGET command!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vpn poptop - CTRL: PTY read or GRE write failed (pty,gre)=(5,6) dezeque Linux - Networking 9 08-26-2016 10:39 AM
Fedora 7 Live "ACPI Warning (tbfadt 0360): Ignoring BIOS FADT rl C-state control... svarmido Linux - Software 2 07-17-2007 06:30 PM
cruise control " Warning: -configfile=/cruisecontrol.xml not understood. Ignoring." emailssent Linux - Networking 0 02-28-2005 03:11 AM
pppd: pty [ usb speedtocuh modem] edM Slackware 10 01-31-2005 05:13 PM
Extra commands in modem Cii Linux - Hardware 0 07-31-2003 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration