00001 #ifndef WORK_QUEUE_PROCESS_H
00002 #define WORK_QUEUE_PROCESS_H
00003
00004 #include "work_queue.h"
00005 #include "timestamp.h"
00006
00007 #include <unistd.h>
00008 #include <sys/types.h>
00009 #include <sys/resource.h>
00010
00011 #define NONE 0
00012 #define DOCKER 1
00013 #define DOCKER_PRESERVE 2
00014 #define UMBRELLA 3
00015
00016 #define MAX_BUFFER_SIZE 4096
00017
00018
00019
00020
00021
00022
00023 struct work_queue_process {
00024 pid_t pid;
00025 int task_status;
00026 int exit_status;
00027
00028 struct rusage rusage;
00029 timestamp_t execution_start;
00030 timestamp_t execution_end;
00031
00032 char *sandbox;
00033
00034 char *output_file_name;
00035 int output_fd;
00036
00037 struct work_queue_task *task;
00038
00039 char container_id[MAX_BUFFER_SIZE];
00040 };
00041
00042 struct work_queue_process * work_queue_process_create( int taskid );
00043 pid_t work_queue_process_execute( struct work_queue_process *p, int container_mode, ... );
00044
00045 void work_queue_process_kill( struct work_queue_process *p );
00046 void work_queue_process_delete( struct work_queue_process *p);
00047
00048 #endif