File: zfs.helper.cpp

package info (click to toggle)
etbemon 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,624 kB
  • sloc: perl: 18,038; cpp: 546; sh: 428; ansic: 407; makefile: 71
file content (18 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

int main(int argc, char **argv)
{
  if(argc != 2)
  {
    fprintf(stderr, "ERROR: Must specify pool name of ZFS filesystem\n");
    return 1;
  }
  char * const child_args[] = { "/sbin/zpool", "status", argv[1], NULL };
  execv(child_args[0], child_args);
  fprintf(stderr, "ERROR: Can't execute %s\n", child_args[0]);
  return 1;
}