Skip to content

Add abort () to jerry-libc #141

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

Merged
merged 1 commit into from
Jun 2, 2015
Merged

Add abort () to jerry-libc #141

merged 1 commit into from
Jun 2, 2015

Conversation

akosthekiss
Copy link
Member

Added declaration and implementations of void abort (void) to
jerry-libc. As the linux implementation relies on the getpid
syscall - which has no arguments - syscall_0 implementations
have been added as well.

libc_fatal has been adapted to use the new abort function
instead of exit. This also made the definition of
LIBC_FATAL_ERROR_EXIT_CODE unnecessary.

Finally, the syscall fatal error message was fixed.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu

@akosthekiss
Copy link
Member Author

@ruben-ayrapetyan mentioned in #134 that abort might be prefered over __builtin_trap so this patch does the groundlaying work in jerry-libc, which had no implementation for that hitherto.

@ruben-ayrapetyan
Copy link
Contributor

Looks good to me

@egavrin egavrin added the enhancement An improvement label Jun 2, 2015
@egavrin egavrin added this to the ECMA builtins milestone Jun 2, 2015
@egavrin egavrin self-assigned this Jun 2, 2015
@@ -48,18 +48,35 @@ LIBC_UNREACHABLE_STUB_FOR (int raise (int sig_no __attr_unused___))
#define LIBC_EXIT_ON_ERROR(syscall_ret_val) \
if ((syscall_ret_val) < 0) \
{ \
libc_fatal ("Syscall successful", __FILE__, __FUNCTION__, __LINE__); \
libc_fatal ("Syscall unsuccessful", __FILE__, __FUNCTION__, __LINE__); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both messages are confusing, maybe just
libc_fatal ("Syscall", __FILE__, __FUNCTION__, __LINE__);?

Added declaration and implementations of `void abort (void)` to
jerry-libc. As the linux implementation relies on the `getpid`
syscall - which has no arguments - `syscall_0` implementations
have been added as well.

`libc_fatal` has been adapted to use the new `abort` function
instead of `exit`. This also made the definition of
`LIBC_FATAL_ERROR_EXIT_CODE` unnecessary.

Finally, the syscall fatal error message was fixed.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
@akosthekiss
Copy link
Member Author

Updated according to comment

@egavrin
Copy link
Contributor

egavrin commented Jun 2, 2015

Great, make push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants