File: fstest3.lua

package info (click to toggle)
lua-ljsyscall 0.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,732 kB
  • sloc: ansic: 434; sh: 59; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- this is a simple port of the fstest.c from buildrump.sh just to show it works

-- version with no loading of S to check for accidental leakage

local oldassert = assert
local function assert(cond, s)
  return oldassert(cond, tostring(s)) -- annoyingly, assert does not call tostring!
end

local R = require "syscall.rump.init".init("vfs", "fs.kernfs")

print("init")

assert(R.mkdir("/kern", "0700"))

print("mkdir")

assert(R.mount("kernfs", "/kern"))

print("mount")

local fd = assert(R.open("/kern/version"))

print("open")

local str = assert(fd:read(nil, 1024))
print("kernel version is " .. str)
assert(fd:close())

assert(R.reboot())