![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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);
}
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|