1 .TH LDAP_RESULT 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-1999 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_result \- Wait for the result of an LDAP operation
13 int ldap_result(ld, msgid, all, timeout, result)
17 struct timeval *timeout;
37 routine is used to wait for and return the result of
38 an operation previously initiated by one of the LDAP asynchronous
39 operation routines (e.g.,
42 etc.). Those routines all return -1 in case of error, and an
43 invocation identifier upon successful initiation of the operation. The
44 invocation identifier is picked by the library and is guaranteed to be
45 unique across the LDAP session. It can be used to request the result
46 of a specific operation from
48 through the \fImsgid\fP parameter.
52 routine will block or not, depending upon the setting
53 of the \fItimeout\fP parameter.
54 If timeout is not a NULL pointer, it specifies a maximum
55 interval to wait for the selection to complete. If timeout
56 is a NULL pointer, the select blocks indefinitely. To
57 effect a poll, the timeout argument should be a non-NULL
58 pointer, pointing to a zero-valued timeval structure. See
62 If the result of a specific operation is required, \fImsgid\fP should
63 be set to the invocation identifier returned when the operation was
64 initiated, otherwise LDAP_RES_ANY should be supplied. The \fIall\fP
65 parameter only has meaning for search responses and is used to select
66 whether a single entry of the search response should be returned, or
67 all results of the search should be returned.
69 A search response is made up of zero or
70 more search entries followed by a search result. If \fIall\fP is set
71 to 0, search entries will be returned one at a time as they come in,
74 If it's set to 1, the search
75 response will only be returned in its entirety, i.e., after all entries
76 and the final search result have been received.
78 Upon success, the type of the result received is returned and the
79 \fIresult\fP parameter will contain the result of the operation. This
80 result should be passed to the LDAP parsing routines,
81 .BR ldap_first_entry (3)
82 and friends, for interpretation.
84 The possible result types returned are:
87 #define LDAP_RES_BIND 0x61L
88 #define LDAP_RES_SEARCH_ENTRY 0x64L
89 #define LDAP_RES_SEARCH_RESULT 0x65L
90 #define LDAP_RES_MODIFY 0x67L
91 #define LDAP_RES_ADD 0x69L
92 #define LDAP_RES_DELETE 0x6bL
93 #define LDAP_RES_MODRDN 0x6dL
94 #define LDAP_RES_COMPARE 0x6fL
99 routine is used to free the memory allocated for
103 .BR ldap_search_s (3)
104 and friends. It takes
105 a pointer to the result to be freed and returns the type of the
110 routine returns the type of a message.
114 routine returns the message id of a message.
117 returns -1 if something bad happens, and zero if the
118 timeout specified was exceeded.
124 This routine dynamically allocates memory for results that it receives.
125 The memory can be freed by the caller using
133 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
135 is derived from University of Michigan LDAP 3.3 Release.