[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] fd / fcntl / ioctl mm



On Thu, 22 Mar 2001 09:03:50 +0100 (CET), Martin Bertilsson Haagen wrote:
>Hej jag löste problemet, men inte på det viset som jag ville. Så här
>gjorde jag.

>  do{
>    read(fd, &c, 1);

Husk altid at checke return code fra systemkald. Jeg har set for mange
programmer som ender med at bruge 100% cpu tid på at lave read(), får 0 bytes
eller -1 for fejl, og læser igen og igen indtil de får en \n eller lignende :)

I øvrigt tror jeg at du kun kan lave det med ICANON på en tty eller pty
(pseudo terminal).

Som altid vil jeg anbefale Richard Steven's "Advanced Programming in the UNIX
Environment".


-- 
=======================================================================
<sslug@sslug>           Herlev, Denmark       Software Designer
<URL:http://www.andreasen.org/>       <*>         LASAT^WEicon Networks
=======================================================================


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *