Mercurial > hg > xemacs-beta
comparison src/hftctl.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | 376386a54a3c |
children |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
18 /* */ | 18 /* */ |
19 /* Does the following: */ | 19 /* Does the following: */ |
20 /* 1. determines if fildes is pty */ | 20 /* 1. determines if fildes is pty */ |
21 /* does normal ioctl it is not */ | 21 /* does normal ioctl it is not */ |
22 /* 2. places fildes into raw mode */ | 22 /* 2. places fildes into raw mode */ |
23 /* 3. converts ioctl arguments to datastream */ | 23 /* 3. converts ioctl arguments to data stream */ |
24 /* 4. waits for 2 secs for acknowledgement before */ | 24 /* 4. waits for 2 secs for acknowledgement before */ |
25 /* timing out. */ | 25 /* timing out. */ |
26 /* 5. places response in callers buffer ( just like */ | 26 /* 5. places response in callers buffer ( just like */ |
27 /* ioctl. */ | 27 /* ioctl. */ |
28 /* 6. returns fildes to its original mode */ | 28 /* 6. returns fildes to its original mode */ |
257 while ((*p.c != 0x1b) && i) /* scan for next ESC */ | 257 while ((*p.c != 0x1b) && i) /* scan for next ESC */ |
258 { ++p.c; --i; } /* if any */ | 258 { ++p.c; --i; } /* if any */ |
259 | 259 |
260 (i ? memcpy (&ack, p.c, i) : 0); /* if any left over, then move */ | 260 (i ? memcpy (&ack, p.c, i) : 0); /* if any left over, then move */ |
261 p.ack = &ack; /* ESC to front of ack struct */ | 261 p.ack = &ack; /* ESC to front of ack struct */ |
262 p.c += i; /* skip over whats been read */ | 262 p.c += i; /* skip over what's been read */ |
263 i = sizeof (ack) - i; /* set whats left to be read */ | 263 i = sizeof (ack) - i; /* set what's left to be read */ |
264 } /***** TRY AGAIN */ | 264 } /***** TRY AGAIN */ |
265 | 265 |
266 alarm(0); /* ACK VTD received, reset alrm*/ | 266 alarm(0); /* ACK VTD received, reset alrm*/ |
267 signal (SIGALRM, sav_alrm); /* reset signal */ | 267 signal (SIGALRM, sav_alrm); /* reset signal */ |
268 | 268 |