Changeset 18770
- Timestamp:
- 09/04/08 00:22:47 (5 years ago)
- Location:
- lang/cplusplus/fcgi-v8/trunk
- Files:
-
- 3 added
- 1 modified
- 1 moved
-
Makefile (modified) (1 diff)
-
Sconstruct (added)
-
examples (added)
-
examples/fork.js (added)
-
posix.cc (moved) (moved from lang/cplusplus/fcgi-v8/trunk/syscall-linux.cc) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/fcgi-v8/trunk/Makefile
r18750 r18770 1 1 #!/bin/sh 2 STANDARDOBJS=util.o core.o syscall-linux.o2 STANDARDOBJS=util.o core.o posix.o 3 3 LIBDIR=../v8/ 4 4 INCDIR=../v8/src/ -
lang/cplusplus/fcgi-v8/trunk/posix.cc
r18750 r18770 4 4 #include <sys/types.h> 5 5 #include <stdlib.h> 6 #include <unistd.h> 6 7 7 8 v8::Handle<v8::Value> Mkdir(const v8::Arguments& args) { … … 22 23 } 23 24 24 void setup_syscall(v8::Handle<v8::ObjectTemplate> target) { 25 target->Set(v8::String::New("mkdir"), v8::FunctionTemplate::New(Mkdir)); 26 target->Set(v8::String::New("getenv"), v8::FunctionTemplate::New(GetEnv)); 25 v8::Handle<v8::Value> Fork(const v8::Arguments& args) { 26 v8::HandleScope handle_scope; 27 pid_t pid = fork(); 28 return v8::Integer::New(pid); 27 29 } 28 30 31 v8::Handle<v8::Value> Sleep(const v8::Arguments& args) { 32 v8::HandleScope handle_scope; 33 sleep( args[1]->Int32Value() || 0 ); 34 return v8::Undefined(); 35 } 36 37 void setup_syscall(v8::Handle<v8::ObjectTemplate> target) { 38 target->Set(v8::String::New("mkdir"), v8::FunctionTemplate::New(Mkdir)); 39 target->Set(v8::String::New("fork"), v8::FunctionTemplate::New(Fork)); 40 target->Set(v8::String::New("getenv"), v8::FunctionTemplate::New(GetEnv)); 41 target->Set(v8::String::New("sleep"), v8::FunctionTemplate::New(Sleep)); 42 } 43
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)