work_queue_process.h
00001 #ifndef WORK_QUEUE_PROCESS_H
00002 #define WORK_QUEUE_PROCESS_H
00003
00004 #include "work_queue.h"
00005 #include "timestamp.h"
00006 #include "path_disk_size_info.h"
00007
00008 #include <unistd.h>
00009 #include <sys/types.h>
00010 #include <sys/resource.h>
00011
00012 #define NONE 0
00013 #define DOCKER 1
00014 #define DOCKER_PRESERVE 2
00015 #define UMBRELLA 3
00016
00017 #define MAX_BUFFER_SIZE 4096
00018
00019
00020
00021
00022
00023
00024 struct work_queue_process {
00025 pid_t pid;
00026 int task_status;
00027 int exit_status;
00028
00029 struct rusage rusage;
00030 timestamp_t execution_start;
00031 timestamp_t execution_end;
00032
00033 char *sandbox;
00034
00035 char *output_file_name;
00036 int output_fd;
00037
00038 struct work_queue_task *task;
00039
00040
00041 int64_t disk;
00042 int loop_mount;
00044
00045 int64_t sandbox_size;
00046 int64_t sandbox_file_count;
00047
00048
00049 struct path_disk_size_info *disk_measurement_state;
00050
00051 char container_id[MAX_BUFFER_SIZE];
00052 };
00053
00054 struct work_queue_process * work_queue_process_create( struct work_queue_task *task, int disk_allocation );
00055 pid_t work_queue_process_execute( struct work_queue_process *p, int container_mode, ... );
00056
00057 void work_queue_process_kill( struct work_queue_process *p );
00058 void work_queue_process_delete( struct work_queue_process *p );
00059 void work_queue_process_compute_disk_needed( struct work_queue_process *p );
00060
00061 int work_queue_process_measure_disk(struct work_queue_process *p, int max_time_on_measurement);
00062
00063 #endif