ldap_get_lderrno() function gets information about the last error that occurred for an LDAP operation. You can also call this function to get error codes for functions that do not return errors (such as ldap_next_attribute()).
For more information, see "Getting Information About the Error" on page 72.
#include <ldap.h>
int ldap_get_lderrno( LDAP *ld, char **m, char **s );
ld |
Connection handle, which is a pointer to an |
m |
In the event of an |
s |
matched. (See "Receiving the Portion of the DN Matching an Entry" on page 73 for details.)
#include <ldap.h>
LDAP *ld;
char *dn = "uid=bjensen, ou=People, o=Airius.com";
LDAPMod **list_of_attrs;
char *matched;
int rc;
...
if ( ldap_add_s( ld, dn, list_of_attrs ) != LDAP_SUCCESS ) {rc = ldap_get_lderrno( ld, &matched, NULL );
return( rc );
}
...In the example above, if no organizational unit named New Department exists, the
matched variable is set to:
o=Airius.com
ldap_err2string(), ldap_perror(), ldap_result2error(), ldap_set_lderrno().
Last Updated: 10/01/98 17:06:23