The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Traps and Interrupts Legend986 UNIX for Dummies Questions & Answers 3 10-02-2007 12:30 PM
Interrupts problems By_Jam UNIX for Advanced & Expert Users 2 03-28-2007 03:44 AM
How to bind interrupts on a specific CPU urbale UNIX for Advanced & Expert Users 1 03-10-2006 01:09 PM
Awk- catching the last two chars Gerry405 UNIX for Dummies Questions & Answers 9 11-22-2005 06:23 AM
Does unix use interrupts? Frank_M Filesystems, Disks and Memory 6 09-18-2002 08:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-19-2005
toughguy2handle toughguy2handle is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 5
catching interrupts

hey i have been facing a problem,can you tell me if we can catch ctrl d in unix i have tried and sucessfully catched and disabled ctrl-c and ctrl -z but am not sure if we can do the same for CTRL-D, so got any clue mail on he forum or ...i mean c programming in Unix thats what i am working on

Last edited by Perderabo; 09-19-2005 at 03:41 PM.. Reason: Remove email address
  #2 (permalink)  
Old 09-19-2005
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
You're not supposed to ask for solutions to be sent by email; when someone searches for this here, they'll only find it if someone posts it.

Ctrl-D isn't a signal, it causes stdin to report EOF. Like so:
Code:
#include <unistd.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
  char buf[512];
  while(!feof(stdin))
    fgets(buf,512,stdin);

  fprintf(stderr,"Ctrl-D or EOF\n");

  return(0);
}
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0