コード例 #1
0
ファイル: write-boundary.c プロジェクト: fintano/PintOS
void
test_main (void) 
{
  int handle;
  int byte_cnt;
  char *sample_p;

  sample_p = copy_string_across_boundary (sample);

  CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");

  byte_cnt = write (handle, sample_p, sizeof sample - 1);
  //printf(" %d \n ", byte_cnt);
  if (byte_cnt != sizeof sample - 1){
    fail ("write() returned %d instead of %zu", byte_cnt, sizeof sample - 1);
  }
}
コード例 #2
0
ファイル: exec-bound.c プロジェクト: AndyMoreland/pinto-beans
void
test_main (void) 
{
  wait (exec (copy_string_across_boundary("child-args arg1 arg2")));
}
コード例 #3
0
void
test_main (void) 
{
  msg ("create(\"quux.dat\"): %d",
       create (copy_string_across_boundary ("quux.dat"), 0));
}