qgetfd man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



qgetfd(3G)							    qgetfd(3G)

NAME
     qgetfd - get the read file descriptor associated with the event queue

C SPECIFICATION
     long qgetfd(void)

PARAMETERS
     none

FUNCTION RETURN VALUE
     The returned function value is the read file descriptor associated with
     the event queue.  If there is an error, the returned value is a negative
     integer whose absolute value is an error value defined in <errno.h>.

DESCRIPTION
     qgetfd returns the read file descriptor associated with the event queue.
     The file descriptor can then be used with the select(2) system call.

EXAMPLE
     The following example (presented in pseudo-code; not to be typed
     verbatim) is suggested for reading events off of the GL queue using
     select(2):

	  FD_ZERO(&readfds);
	  if ((glfd = qgetfd()) < 0) {
	      printf("bad file descriptor %d0, glfd);
	      exit(-1);
	  }
	  for (;;) {
	      while (qtest()) {
		  .
		  .
		  blkqread()
		  .
		  .
	      }
	      /* Make sure all GL rendering which may be acting as a prompt or
	       * cue for the user has completed before checking for a response
	       * from the user.
	       */
	      gflush();
	      FD_SET(glfd,&readfds);	   /* select with qgetfd descriptor   */
	      FD_SET(,);		   /* select with others descriptors  */
	      .
	      nfound = select (,&readfds,,,);
	      if (FD_ISSET(glfd,&readfds)) /* process queue events	      */
	       continue;
	      if (FD_ISSET(,)) {	   /* process other then queue events */
	       .
	       .
	      }
	  }

									Page 1

qgetfd(3G)							    qgetfd(3G)

     The example provides two important pieces of advice. First, use blkqread
     instead of multiple qreads because it is more efficient.  Second, to
     ensure the proper behavior of select, call qtest before and after you
     call select. When select indicates data is available on the file
     descriptor, there may not be GL event data to read.  Similarly, there is
     a condition where select would block, but data is available. The use of
     qtest before and after select guards against this.

SEE ALSO
     qread, gflush, select(2) (in the Programmer's Reference Manual)

NOTES
     This routine is available only in immediate mode.

BUGS
     The file descriptor returned by qgetfd will not be detected as ready for
     reading by the system call select(2) when TIMER events are inserted into
     the queue.	 Instead, one should use the timeout feature of select(2) to
     achieve the same functionality.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net