summaryrefslogtreecommitdiff
path: root/src/critical/classic/dd.c
blob: 17454cc7f247ebbec73601272018e5fb66f79316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdbool.h>

void random_data_linux(char sym_drive[16], bool random) {
    char command[55]; 
    if (random) {
        sprintf(command, "dd if=/dev/urandom of=%s bs=1024 count=1024", sym_drive);
    } else {
        sprintf(command, "dd if=/dev/zero of=%s bs=1024 count=1024", sym_drive);
    }
    system(command);
}