Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Remote Shared Memory Library Functionsrsm_memseg_get_pollfd(3RSM)


NAME

 rsm_memseg_get_pollfd, rsm_memseg_release_pollfd - get or release a poll descriptor

SYNOPSIS

 
cc [flags...] file... -lrsm [library...]
#include <rsmapi.h> 
int rsm_memseg_get_pollfd(void *memseg, struct pollfd *fd);
 int rsm_memseg_release_pollfd(void *memseg);

DESCRIPTION

 

The rsm_memseg_get_pollfd() and rsm_memseg_release_pollfd() functions provide an alternative to rsm_intr_signal_wait(3RSM); the waiting process may multiplex event waiting using the poll(2) function after first obtaining a poll descriptor using rsm_memseg_get_pollfd(). The descriptor may subsequently be released using rsm_memseg_release_pollfd().

As a result of a call rsm_memseg_get_pollfd(), the specified pollfd structure is initialized with a descriptor for the specified segment (memseg) and the event generated by rsm_intr_signal_post(3RSM). Either an export segment handle or an import segment handle may be type cast to a void pointer. The pollfd argument may subsequently be used with the poll(2) function to wait for the event. If memseg references an export segment, the segment must be currently published. If memseg references an import segment, the segment must be connected.

The rsm_memseg_reslease_pollfd() function decrements the reference count of the pollfd structure associated with the specified segment. A segment unpublish, destroy or unmap operation will fail if the reference count is non-zero.

RETURN VALUES

 

Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error.

ERRORS

 

The rsm_memseg_get_pollfd() and rsm_memseg_release_pollfd() function can return the following errors:

RSMERR_BAD_SEG_HNDL
Invalid segment handle.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface StabilityEvolving
MT-LevelMT-Safe

SEE ALSO

 

poll(2), rsm_intr_signal_post(3RSM), attributes(5)


SunOS 5.9Go To TopLast Changed 8 Jun 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.