mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
os_linux.v
This commit is contained in:
parent
1dadf9d966
commit
d1b8d34dd5
7 changed files with 84 additions and 27 deletions
17
vlib/os/bare/bare_example_linux.v
Normal file
17
vlib/os/bare/bare_example_linux.v
Normal file
|
@ -0,0 +1,17 @@
|
|||
fn syscall5(number, arg1, arg2, arg3, arg4, arg5 voidptr) voidptr
|
||||
|
||||
fn write(fd int, data voidptr, nbytes u64) int {
|
||||
return syscall5(
|
||||
1, // SYS_write
|
||||
fd,
|
||||
data,
|
||||
nbytes,
|
||||
0, // ignored
|
||||
0 // ignored
|
||||
)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
write(1, c'hallo\n', 6)
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue