const correctness for dl*()
This commit is contained in:
parent
18d1eb6776
commit
9822c98d98
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31342
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: link.h,v 1.13 1997/05/07 20:00:00 eivind Exp $
|
* $Id: link.h,v 1.14 1997/08/02 04:56:43 jdp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -175,21 +175,21 @@ struct so_debug {
|
|||||||
* to crt0.
|
* to crt0.
|
||||||
*/
|
*/
|
||||||
struct ld_entry {
|
struct ld_entry {
|
||||||
void *(*dlopen) __P((char *, int)); /* NONE */
|
void *(*dlopen) __P((const char *, int)); /* NONE */
|
||||||
int (*dlclose) __P((void *)); /* NONE */
|
int (*dlclose) __P((void *)); /* NONE */
|
||||||
void *(*dlsym) __P((void *, char *)); /* NONE */
|
void *(*dlsym) __P((void *, const char *)); /* NONE */
|
||||||
char *(*dlerror) __P((void)); /* NONE */
|
const char *(*dlerror) __P((void)); /* NONE */
|
||||||
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
||||||
void *(*dlsym3) __P((void *, char *, void *)); /* HAS_DLSYM3 */
|
void *(*dlsym3) __P((void *, const char *, void *)); /* HAS_DLSYM3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dl*() prototypes.
|
* dl*() prototypes.
|
||||||
*/
|
*/
|
||||||
extern void *dlopen __P((char *, int));
|
extern void *dlopen __P((const char *, int));
|
||||||
extern int dlclose __P((void *));
|
extern int dlclose __P((void *));
|
||||||
extern void *dlsym __P((void *, char *));
|
extern void *dlsym __P((void *, const char *));
|
||||||
extern char *dlerror __P((void));
|
extern const char *dlerror __P((void));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: crt0.c,v 1.29 1997/02/22 14:57:44 peter Exp $
|
* $Id: crt0.c,v 1.30 1997/08/02 04:56:33 jdp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -265,9 +265,9 @@ __do_dynamic_link ()
|
|||||||
if (ldso_version == -1) {
|
if (ldso_version == -1) {
|
||||||
_PUTMSG("ld.so failed");
|
_PUTMSG("ld.so failed");
|
||||||
if (ld_entry != NULL) {
|
if (ld_entry != NULL) {
|
||||||
char *msg = (ld_entry->dlerror)();
|
const char *msg = (ld_entry->dlerror)();
|
||||||
if(msg != NULL) {
|
if(msg != NULL) {
|
||||||
char *endp;
|
const char *endp;
|
||||||
_PUTMSG(": ");
|
_PUTMSG(": ");
|
||||||
for(endp = msg; *endp != '\0'; ++endp)
|
for(endp = msg; *endp != '\0'; ++endp)
|
||||||
; /* Find the end */
|
; /* Find the end */
|
||||||
@ -290,7 +290,7 @@ __do_dynamic_link ()
|
|||||||
|
|
||||||
void *
|
void *
|
||||||
dlopen(name, mode)
|
dlopen(name, mode)
|
||||||
char *name;
|
const char *name;
|
||||||
int mode;
|
int mode;
|
||||||
{
|
{
|
||||||
if (ld_entry == NULL)
|
if (ld_entry == NULL)
|
||||||
@ -312,7 +312,7 @@ void *fd;
|
|||||||
void *
|
void *
|
||||||
dlsym(fd, name)
|
dlsym(fd, name)
|
||||||
void *fd;
|
void *fd;
|
||||||
char *name;
|
const char *name;
|
||||||
{
|
{
|
||||||
if (ld_entry == NULL)
|
if (ld_entry == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -325,7 +325,7 @@ char *name;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
dlerror()
|
dlerror()
|
||||||
{
|
{
|
||||||
if (ld_entry == NULL)
|
if (ld_entry == NULL)
|
||||||
@ -398,7 +398,7 @@ _getenv(name)
|
|||||||
|
|
||||||
void *
|
void *
|
||||||
dlopen(name, mode)
|
dlopen(name, mode)
|
||||||
char *name;
|
const char *name;
|
||||||
int mode;
|
int mode;
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -414,13 +414,13 @@ void *fd;
|
|||||||
void *
|
void *
|
||||||
dlsym(fd, name)
|
dlsym(fd, name)
|
||||||
void *fd;
|
void *fd;
|
||||||
char *name;
|
const char *name;
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
dlerror()
|
dlerror()
|
||||||
{
|
{
|
||||||
return "Service unavailable";
|
return "Service unavailable";
|
||||||
|
@ -51,9 +51,9 @@
|
|||||||
#define RTLD_NEXT ((void *) -1)
|
#define RTLD_NEXT ((void *) -1)
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
void *dlopen __P((char *, int));
|
void *dlopen __P((const char *, int));
|
||||||
void *dlsym __P((void *, char *));
|
void *dlsym __P((void *, const char *));
|
||||||
char *dlerror __P((void));
|
const char *dlerror __P((void));
|
||||||
int dlclose __P((void *));
|
int dlclose __P((void *));
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Fd #include <dlfcn.h>
|
.Fd #include <dlfcn.h>
|
||||||
.Ft void *
|
.Ft void *
|
||||||
.Fn dlopen "char *path" "int mode"
|
.Fn dlopen "const char *path" "int mode"
|
||||||
.Ft void *
|
.Ft void *
|
||||||
.Fn dlsym "void *handle" "char *symbol"
|
.Fn dlsym "void *handle" "const char *symbol"
|
||||||
.Ft char *
|
.Ft const char *
|
||||||
.Fn dlerror "void"
|
.Fn dlerror "void"
|
||||||
.Ft int
|
.Ft int
|
||||||
.Fn dlclose "void *handle"
|
.Fn dlclose "void *handle"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: link.h,v 1.13 1997/05/07 20:00:00 eivind Exp $
|
* $Id: link.h,v 1.14 1997/08/02 04:56:43 jdp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -175,21 +175,21 @@ struct so_debug {
|
|||||||
* to crt0.
|
* to crt0.
|
||||||
*/
|
*/
|
||||||
struct ld_entry {
|
struct ld_entry {
|
||||||
void *(*dlopen) __P((char *, int)); /* NONE */
|
void *(*dlopen) __P((const char *, int)); /* NONE */
|
||||||
int (*dlclose) __P((void *)); /* NONE */
|
int (*dlclose) __P((void *)); /* NONE */
|
||||||
void *(*dlsym) __P((void *, char *)); /* NONE */
|
void *(*dlsym) __P((void *, const char *)); /* NONE */
|
||||||
char *(*dlerror) __P((void)); /* NONE */
|
const char *(*dlerror) __P((void)); /* NONE */
|
||||||
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
||||||
void *(*dlsym3) __P((void *, char *, void *)); /* HAS_DLSYM3 */
|
void *(*dlsym3) __P((void *, const char *, void *)); /* HAS_DLSYM3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dl*() prototypes.
|
* dl*() prototypes.
|
||||||
*/
|
*/
|
||||||
extern void *dlopen __P((char *, int));
|
extern void *dlopen __P((const char *, int));
|
||||||
extern int dlclose __P((void *));
|
extern int dlclose __P((void *));
|
||||||
extern void *dlsym __P((void *, char *));
|
extern void *dlsym __P((void *, const char *));
|
||||||
extern char *dlerror __P((void));
|
extern const char *dlerror __P((void));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: link.h,v 1.13 1997/05/07 20:00:00 eivind Exp $
|
* $Id: link.h,v 1.14 1997/08/02 04:56:43 jdp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -175,21 +175,21 @@ struct so_debug {
|
|||||||
* to crt0.
|
* to crt0.
|
||||||
*/
|
*/
|
||||||
struct ld_entry {
|
struct ld_entry {
|
||||||
void *(*dlopen) __P((char *, int)); /* NONE */
|
void *(*dlopen) __P((const char *, int)); /* NONE */
|
||||||
int (*dlclose) __P((void *)); /* NONE */
|
int (*dlclose) __P((void *)); /* NONE */
|
||||||
void *(*dlsym) __P((void *, char *)); /* NONE */
|
void *(*dlsym) __P((void *, const char *)); /* NONE */
|
||||||
char *(*dlerror) __P((void)); /* NONE */
|
const char *(*dlerror) __P((void)); /* NONE */
|
||||||
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
void (*dlexit) __P((void)); /* HAS_DLEXIT */
|
||||||
void *(*dlsym3) __P((void *, char *, void *)); /* HAS_DLSYM3 */
|
void *(*dlsym3) __P((void *, const char *, void *)); /* HAS_DLSYM3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dl*() prototypes.
|
* dl*() prototypes.
|
||||||
*/
|
*/
|
||||||
extern void *dlopen __P((char *, int));
|
extern void *dlopen __P((const char *, int));
|
||||||
extern int dlclose __P((void *));
|
extern int dlclose __P((void *));
|
||||||
extern void *dlsym __P((void *, char *));
|
extern void *dlsym __P((void *, const char *));
|
||||||
extern char *dlerror __P((void));
|
extern const char *dlerror __P((void));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user