Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to override syscalls #21429

Closed
pavlohamov opened this issue Dec 16, 2019 · 0 comments · Fixed by #21430
Closed

Impossible to override syscalls #21429

pavlohamov opened this issue Dec 16, 2019 · 0 comments · Fixed by #21430
Labels
area: Minimal libc Minimal C Standard Library bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@pavlohamov
Copy link
Contributor

Can't override System V syscalls by my own implementation

  1. Configure project: CONFIG_NEWLIB_LIBC=y
  2. add trace into:zephyr/lib/libc/newlib/libc-hooks.c
 int _open(const char *name, int mode)
 {
+       printk(" %s '%s' %d\n", __FUNCTION__, name, mode);
  1. add into main()
    FILE *f = fopen("file", "r+");
  2. run it.
    So far so good
  3. try implement your own "open"
  4. lib/libc/newlib/libc-hooks.c:190: multiple definition of `_open';

Expected behavior
libc-hooks.c expected to have weak aliases

Impact
All syscall users

Environment (please complete the following information):

  • Ubuntu 18 x64
  • Toolchain: Zephyr
  • Commit SHA f95a7fa
@pavlohamov pavlohamov added the bug The issue is a bug, or the PR is fixing a bug label Dec 16, 2019
@aescolar aescolar added the area: Minimal libc Minimal C Standard Library label Dec 17, 2019
@jhedberg jhedberg added has-pr priority: low Low impact/importance bug labels Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Minimal libc Minimal C Standard Library bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants