Annotation of coherent/g/usr/lib/ncurses/lib_napms.c, revision 1.1.1.1

1.1       root        1: /*********************************************************************
                      2: *                         COPYRIGHT NOTICE                           *
                      3: **********************************************************************
                      4: *        This software is copyright (C) 1992 by Udo Munk             *
                      5: *                                                                    *
                      6: *        Permission is granted to reproduce and distribute           *
                      7: *        this file by any means so long as no fee is charged         *
                      8: *        above a nominal handling fee and so long as this            *
                      9: *        notice is always included in the copies.                    *
                     10: *                                                                    *
                     11: *        Other rights are reserved except as explicitly granted      *
                     12: *        by written permission of the author.                        *
                     13: *                Udo Munk                                           *
                     14: *                Oberstr. 21                                        *
                     15: *                4040 Neuss 1                                       *
                     16: *                Germany                                            *
                     17: *                                                                    *
                     18: *                [email protected]                                   *
                     19: *********************************************************************/
                     20: 
                     21: /*
                     22: **     lib_napms.c
                     23: **
                     24: **     Sleep for some millisecounds
                     25: **
                     26: ** $Log:       lib_napms.c,v $
                     27:  * Revision 1.5  93/04/12  14:13:54  bin
                     28:  * Udo: third color update
                     29:  * 
                     30:  * Revision 1.0  92/11/26  21:47:38  munk
                     31:  * Initial version
                     32:  * 
                     33: **
                     34: */
                     35: 
                     36: #ifdef RCSHDR
                     37: static char RCSid[] =
                     38:        "$Header: /src386/usr/lib/ncurses/RCS/lib_napms.c,v 1.5 93/04/12 14:13:54 bin Exp Locker: bin $";
                     39: #endif
                     40: 
                     41: #include <poll.h>
                     42: 
                     43: int napms(timeout)
                     44: int timeout;
                     45: {
                     46:        int             n;
                     47:        struct pollfd   fda[1];
                     48:        
                     49:        if (timeout < 1)
                     50:                return(0);
                     51:        fda[0].fd = -1;
                     52:        n = poll((struct pollfd*) &fda[0], 1, timeout);
                     53:        return(n < 0 ? n : timeout); 
                     54: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.