Skip to content

Missing/misplaced MVS prototypes: loadenv, tzset, __exit, __svc99 #5

Description

@mgrossmann

Several libc370 runtime routines are linkable on MVS but have no usable public prototype, so consumers get implicit-declaration warnings and must declare them locally. Surfaced while building httplua (mvslovers/httplua, worked around in commit a804a8f).

Functions with no public header

Function Suggested header Notes
int loadenv(const char *ddname) clibenv.h Loads env vars from a DD (e.g. dd:SYSENV); used by CGI programs.
void tzset(void) time.h POSIX; time.h currently declares time/localtime/mktime/etc. but not tzset.
void __exit(int rc) clibcrt.h (or stdlib.h) Runtime exit.

__svc99 is guarded under #ifdef MUSIC

mvssupa.h declares int __svc99(void *rb); only inside #ifdef MUSIC:

#ifdef MUSIC
int __system(...);
int __textlc(void);
int __svc99(void *rb);
#else
int __system(int req_type, size_t pgm_len, char *pgm, size_t parm_len, char *parm);
...
#endif

SVC 99 (dynamic allocation) is an MVS service, so on MVS (the #else branch)
the prototype is missing. It should be available outside the MUSIC guard.

Impact

The functions link fine (libc370 defines them); only the prototypes are absent,
which trips -Wimplicit-declaration in consumers. Adding the prototypes lets
httplua (and any future consumer) drop its local extern declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions