Skip to content

Commit

Permalink
libc.j: sleep and fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 15, 2010
1 parent aaebd41 commit 670c3f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc.j
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libc = dlopen("libc")

sleep(s::Scalar) = ccall(dlsym(libc,"usleep"), Uint32, (Uint32,), uint32(round(s*1e6)))
fork() = ccall(dlsym(libc,"fork"), Int32, ())
1 change: 1 addition & 0 deletions prim.j
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
typealias Nullable{T} Union(T,())
typealias Index Int32
typealias Size Int32
typealias String Array{Uint8,1}

(<:)(T::Type, S::Type) = subtype(T,S)
(:>)(T::Type, S::Type) = subtype(S,T)
Expand Down
1 change: 1 addition & 0 deletions start.j
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ load("dequeue.j")
#load("tree.j")
load("array.j")
load("mathfunctions.j")
load("libc.j")

0 comments on commit 670c3f7

Please sign in to comment.