Skip to content

Reconsider usages of gethostbyname_r() #15531

Open
@Girgias

Description

@Girgias

Description

According to some sources, this function is obsolete and should be replaced with:

Applications should use getaddrinfo(3), getnameinfo(3), and gai_strerror(3) instead.

Moreover, getting rid of them would allow us to get remove some conditionally defined globals:

php-src/ext/standard/file.h

Lines 106 to 110 in 69d9c12

#ifdef HAVE_GETHOSTBYNAME_R
struct hostent tmp_host_info;
char *tmp_host_buf;
size_t tmp_host_buf_len;
#endif

Initially found while working on #15511

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions