File: setsid.c

package info (click to toggle)
mobyle 1.5.5%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,288 kB
  • sloc: python: 22,709; makefile: 35; sh: 33; ansic: 10; xml: 6
file content (16 lines) | stat: -rw-r--r-- 301 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv) {

  /* Make this process a group leader */
  (void)setsid();

  /* Execute the real command */
  if (argc > 1) {
    execvp(argv[1], argv+1);
  } else {
    fprintf(stderr, "%s missing arguments\n", argv[0]);
  }

  return 1; }