1ldap_result(3LDAP)          LDAP Library Functions          ldap_result(3LDAP)
2
3
4

NAME

6       ldap_result, ldap_msgfree - wait for and return LDAP operation result
7

SYNOPSIS

9       cc[ flag... ] file... -lldap[ library... ]
10       #include <lber.h>
11       #include <ldap.h>
12
13       int ldap_result(LDAP *ld, int msgid, int all,
14            struct timeval *timeout, LDAPMessage **result);
15
16
17       int ldap_msgfree(LDAPMessage *msg);
18
19

DESCRIPTION

21       The ldap_result() function is used to wait for and return the result of
22       an operation previously initiated by one of the LDAP asynchronous oper‐
23       ation  functions  ,  for  example,  ldap_search(3LDAP),  and  ldap_mod‐
24       ify(3LDAP). Those functions all return  −1 in case  of  error,  and  an
25       invocation  identifier upon successful initiation of the operation. The
26       invocation identifier is picked by the library and is guaranteed to  be
27       unique  across  the LDAP session.  It can be used to request the result
28       of a specific operation from ldap_result() through the msgid parameter.
29
30
31       The ldap_result() function will block or not, depending upon  the  set‐
32       ting  of  the  timeout  parameter. If timeout is not a null pointer, it
33       specifies a  maximum interval to wait for the  selection  to  complete.
34       If timeout is a null pointer, the select blocks indefinitely. To effect
35       a poll, the timeout argument should be a non-null pointer, pointing  to
36       a zero-valued timeval structure.  See select(3C) for further details.
37
38
39       If  the result of a specific operation is required, msgid should be set
40       to the invocation identifier returned when the operation was initiated,
41       otherwise  LDAP_RES_ANY should be supplied.  The all parameter only has
42       meaning for search responses and is used to  select  whether  a  single
43       entry  of the search response should be returned, or all results of the
44       search should be returned.
45
46
47       A search response is made up of zero or more search entries followed by
48       a  search  result.  If all is set to 0, search entries will be returned
49       one at a  time  as  they  come  in,  by  means  of  separate  calls  to
50       ldap_result().  If  it  is set to a non-zero value, the search response
51       will only be returned in its entirety, that is, after all  entries  and
52       the final search result have been received.
53
54
55       Upon  success,  the  type  of  the  result received is returned and the
56       result parameter will contain the result of the operation.  This result
57       should    be    passed    to   the   LDAP   parsing   functions,   (see
58       ldap_first_entry(3LDAP)) for interpretation.
59
60
61       The possible result types returned are:
62
63         #define LDAP_RES_BIND          0x61L
64         #define LDAP_RES_SEARCH_ENTRY  0x64L
65         #define LDAP_RES_SEARCH_RESULT 0x65L
66         #define LDAP_RES_MODIFY        0x67L
67         #define LDAP_RES_ADD           0x69L
68         #define LDAP_RES_DELETE        0x6bL
69         #define LDAP_RES_MODRDN        0x6dL
70         #define LDAP_RES_COMPARE       0x6fL
71
72
73
74       The ldap_msgfree() function is used to free the memory allocated for  a
75       result  by ldap_result() or ldap_search_s(3LDAP) functions.  It takes a
76       pointer to the result to be freed and returns the type of  the  message
77       it freed.
78

ERRORS

80       The  ldap_result()  function returns −1 on error and 0 if the specified
81       timeout was exceeded.
82

ATTRIBUTES

84       See attributes(5) for a description of the following attributes:
85
86
87
88
89       ┌─────────────────────────────┬─────────────────────────────┐
90       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
91       │Availability                 │SUNWcsl (32-bit)             │
92       │                             │SUNWcslx (64-bit)            │
93       │Interface Stability          │Committed                    │
94       └─────────────────────────────┴─────────────────────────────┘
95

SEE ALSO

97       select(1), ldap(3LDAP), ldap_search(3LDAP) , attributes(5)
98

NOTES

100       The  ldap_result()  function  allocates  memory  for  results  that  it
101       receives.  The memory can be freed by calling ldap_msgfree(3LDAP).
102
103
104
105SunOS 5.11                        31 Mar 2009               ldap_result(3LDAP)
Impressum