Skip to content

Export shadowhook_get_init_errno from the shared library - #121

Open
dajiaohuang wants to merge 1 commit into
bytedance:devfrom
dajiaohuang:fix/120-export-init-errno
Open

Export shadowhook_get_init_errno from the shared library#121
dajiaohuang wants to merge 1 commit into
bytedance:devfrom
dajiaohuang:fix/120-export-init-errno

Conversation

@dajiaohuang

Copy link
Copy Markdown

This PR fixes #120

Problem

shadowhook_get_init_errno is declared in the public native header and implemented by the library, but the shared-library version script does not export it. Native clients therefore cannot link this public API through libshadowhook.so.

Changes

  • Add shadowhook_get_init_errno to the global export list.
  • Reference the API from the existing systest library so its native link step guards the export.

Verification

  • Ran a source consistency check that verifies the declaration, definition, single export-map entry, and systest link reference.
  • Ran git diff --check.

The Android native build was not run locally because this Windows environment has no Android SDK, NDK, or repository-required CMake installation.

@caikelun

Copy link
Copy Markdown
Member

Thanks. Please update your PR: keep only the changes to shadowhook/src/main/cpp/shadowhook.map.txt.

(I don't think it is necessary to specifically test the shadowhook_get_init_errno function in systest/src/main/cpp/systest.c; systest.c is intended for testing the hooking and interception of common system functions.)

@dajiaohuang
dajiaohuang force-pushed the fix/120-export-init-errno branch from 83f7043 to 9cadf00 Compare August 24, 2026 14:42
@dajiaohuang

Copy link
Copy Markdown
Author

Updated in 9cadf00: I removed the systest.c change, so the PR now changes only shadowhook/src/main/cpp/shadowhook.map.txt.

Validation:

  • source consistency check confirmed one declaration, one definition, and one export-map entry for shadowhook_get_init_errno
  • git diff --check upstream/dev...HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants