nuttx/libs/libc/dlfcn/lib_dladdr.c
Huang Qi f714669da4 dlfcn: Add stub for dladdr
Implement a stub for dladdr() to avoid build errors
with some applications that use dladdr().

The API definition is from:
1. https://man7.org/linux/man-pages/man3/dladdr.3.html
2. https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/dladdr.html

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-07-26 14:39:10 -03:00

43 lines
1.6 KiB
C

/****************************************************************************
* libs/libc/dlfcn/lib_dladdr.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <errno.h>
#include <dlfcn.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: dladdr
****************************************************************************/
int dladdr(const FAR void *addr, FAR Dl_info *info)
{
set_errno(ENOTSUP);
return 0;
}