mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
freestanding: sys_getuid, sys_waitid; minimal fork check; remove bare.S
This commit is contained in:

committed by
Alexander Medvednikov

parent
39655a7d9b
commit
a9aaa13a09
@ -1,20 +1,7 @@
|
||||
fn syscall5(number, arg1, arg2, arg3, arg4, arg5 voidptr) voidptr
|
||||
|
||||
fn write(fd int, data voidptr, nbytes int) int {
|
||||
return syscall5(
|
||||
1, // SYS_write
|
||||
fd,
|
||||
data,
|
||||
nbytes,
|
||||
0, // ignored
|
||||
0 // ignored
|
||||
)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
write(1, c'hello\n', 6)
|
||||
s := 'test string'
|
||||
write(1, s.str, s.len)
|
||||
sys_write(1, 'hello\n'.str, 6)
|
||||
s := 'test string\n'
|
||||
sys_write(1, s.str, u64(s.len))
|
||||
a := s[0]
|
||||
println("Hello freestanding!")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user