mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-01-14 13:12:05 +05:30
C: jokes/brexit.c: simplify, fix SIGSEGV
Fix the indentation
This commit is contained in:
parent
2001b310d7
commit
2ab2a332a1
@ -7,22 +7,23 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
__attribute__((naked)) __attribute__((noreturn)) _Noreturn void Brexit(void);
|
__attribute__((noreturn)) _Noreturn void Brexit(void);
|
||||||
|
|
||||||
__attribute__((naked))
|
|
||||||
__attribute__((noreturn))
|
__attribute__((noreturn))
|
||||||
_Noreturn
|
_Noreturn
|
||||||
void Brexit(void) {
|
void Brexit(void) {
|
||||||
__asm__ volatile (
|
asm volatile (
|
||||||
"movl $0x7F, %%ebx\n\t"
|
"movl $0x7F, %%ebx\n\t"
|
||||||
"movl $1, %%eax\n\t"
|
"movl $1, %%eax\n\t"
|
||||||
"int $0x80"
|
"int $0x80"
|
||||||
:
|
:
|
||||||
:
|
:
|
||||||
: "eax", "ebx"
|
: "eax", "ebx"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
for (;;); // https://stackoverflow.com/a/15964365
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
Brexit();
|
Brexit();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user