-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Rather than using __attribute__((constructor)), which is called early in the program's initialization sequence (before the call to main), make the library be a readline(3) replacement, and call dlsym(RTLD_NEXT, "readline") after injecting the AI query behavior.
This will avoid the problem where with GNU awk ai-cli-lib calls malloc(3) before the awk code has called the required pma_init(3), thus leading to a fatal malloc(3) failure. This proposal was inspired by Terence Kelly's suggestion to avoid calling constructor-like functions before main.
Metadata
Metadata
Assignees
Labels
No labels