Skip to content

IBMi build broken due to missing realpath() #16209

Closed
@andrewkirillov-ibm

Description

@andrewkirillov-ibm

I did this

Compile 8.12.0 on IBM i V7R4M0 system, with SSL enabled. Got the following errors:

CZM1001:  VLS_SCACHE__819.c, 367.23: CZM0304(10) No function prototype given for "realpath".
CZM1003:  VLS_SCACHE__819.c, 367.21: CZM0196(30) Initialization between types "char*" and "int" is not allowed.
..
CZS0601:  Module VLS_SCACHE is not created because statement errors occurred.

The issue is introduced by the following commit:
fa0ccd9

Here lib/vtls/vtls_scache.c was introduced, which uses _fullpath() on Windows and realpath() on all other platforms. IBMi system header, however, do not provide realpath() or its replacement.

I expected the following

Clean build

curl/libcurl version

8.12.0

operating system

OS400 V7R4M0

Activity

andrewkirillov-ibm

andrewkirillov-ibm commented on Feb 6, 2025

@andrewkirillov-ibm
ContributorAuthor

As IBMi does not provide realpath() or a replacement for it, a fix could be to change #ifdefs

From

#ifdef _WIN32
#else
#endif

to

#ifdef _WIN32
#elif !defined(__OS400__)
#endif

It will the fall back to return Curl_dyn_addf(buf, ":%s-%s", name, path); by default.

added a commit that references this issue on Feb 6, 2025
3ba5c96
added a commit that references this issue on Feb 7, 2025
c0d38f5
added a commit that references this issue on Apr 26, 2025
c741279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @vszakats@andrewkirillov-ibm

      Issue actions

        IBMi build broken due to missing realpath() · Issue #16209 · curl/curl