File: fstest.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 (19 lines) | stat: -rw-r--r-- 454 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
-- this is a simple port of the fstest.c from buildrump.sh just to show it works

local S = require "syscall" -- your OS functions

S.setenv("RUMP_VERBOSE", "1")

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

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

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

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

assert(R.reboot())