]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/lib/ZPending.c
r4254@bucket (orig r244): kcr | 2008-01-20 14:40:42 -0500
[1ts-debian.git] / zephyr / lib / ZPending.c
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It contains source for the ZPending function.
3  *
4  *      Created by:     Robert French
5  *
6  *      $Id$
7  *
8  *      Copyright (c) 1987 by the Massachusetts Institute of Technology.
9  *      For copying and distribution information, see the file
10  *      "mit-copyright.h". 
11  */
12
13 #ifndef lint
14 static char rcsid_ZPending_c[] = "$Id$";
15 #endif
16
17 #include <internal.h>
18
19 int
20 ZPending(void)
21 {
22         int retval;
23         
24         if (ZGetFD() < 0) {
25                 errno = ZERR_NOPORT;
26                 return (-1);
27         }
28         
29         if ((retval = Z_ReadEnqueue()) != ZERR_NONE) {
30                 errno = retval;
31                 return (-1);
32         } 
33         
34         return(ZQLength());
35 }