[Bug 215769] man 2 vfork() does not document corner case when PID == 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=215769

--- Comment #4 from Коренберг Марк (socketpair@xxxxxxxxx) ---
#define _GNU_SOURCE 1
#include <stdio.h>
#include <sched.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <err.h>

#ifndef CLONE_NEWTIME
#define CLONE_NEWTIME   0x00000080
#endif

int main (void)
{
  if (unshare (CLONE_NEWTIME))  err (EXIT_FAILURE, "UNSHARE_NEWTIME");

  pid_t pid;
  switch (pid=vfork ())
  {
  case 0:
    _exit(0);
  case -1:
    err(EXIT_FAILURE, "vfork BUG");
  default:
    waitpid(pid, NULL, 0);
  }
  return 0;
}

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux