akaros/tests/testclone.c
<<
>>
Prefs
   1/* Copyright (c) 2014 The Regents of the University of California
   2 * Barret Rhoden <brho@cs.berkeley.edu>
   3 * See LICENSE for details.
   4 *
   5 * Send in the clones. */
   6
   7#include <stdio.h>
   8#include <stdlib.h>
   9#include <unistd.h>
  10
  11#include <fcntl.h>
  12
  13#include <sys/types.h>
  14#include <unistd.h>
  15        
  16int main(int argc, char** argv) 
  17{
  18        int iter = 1000;
  19        char *name = "/net/tcp/clone";
  20
  21        if (argc > 1)
  22                iter = atoi(argv[1]);
  23        if (argc > 2)
  24                name = argv[2];
  25        while (iter--) {
  26                int fd;
  27                fd = open(name, O_RDWR, 0666);
  28                if (fd < 0) {
  29                        perror(name);
  30                        exit(-1);
  31                }
  32        }
  33} 
  34