Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@daniel-levin
Copy link
Contributor

@daniel-levin daniel-levin commented Sep 30, 2025

Porting wild to other unixes should not be terribly difficult. This PR solves the first problem I encountered. The exit.c libc-like shim should use syscall number 1 on __sun derivatives i.e. Illumos. I was baffled when I ran 01_trivial under the debugger and the exit syscall appeared to have no effect. The only difference between that code and the working code is this fix. That is, the instruction at 0x401394:

000000000040138d <exit_syscall>:
  40138d:       55                      push   %rbp
  40138e:       48 89 e5                mov    %rsp,%rbp
  401391:       89 7d fc                mov    %edi,-0x4(%rbp)
  401394:       b8 01 00 00 00          mov    $0x1,%eax
  401399:       8b 7d fc                mov    -0x4(%rbp),%edi
  40139c:       0f 05                   syscall
  40139e:       90                      nop
  40139f:       5d                      pop    %rbp
  4013a0:       c3                      ret

@davidlattimore davidlattimore merged commit 2391beb into davidlattimore:main Sep 30, 2025
19 checks passed
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