SETSID.2
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 1k
Category:

OS Develop

Development Platform:

WINDOWS

  1. .TH SETSID 2
  2. .SH NAME
  3. setsid, getpgrp - create process group, get process group id
  4. .SH SYNOPSIS
  5. .ft B
  6. .nf
  7. #include <sys/types.h>
  8. #include <unistd.h>
  9. pid_t setsid(void)
  10. pid_t getpgrp(void)
  11. .fi
  12. .ft P
  13. .SH DESCRIPTION
  14. .B Setsid()
  15. creates a new session if the calling process is not already a session
  16. leader.  The calling process becomes the session leader of a new process
  17. group and the process group ID of this new process group will be equal to
  18. the process ID of the new session leader.  The process group ID is inherited
  19. on a
  20. .BR fork() .
  21. .PP
  22. .B Getpgrp()
  23. returns the process group ID of the calling process.
  24. .SH "SEE ALSO"
  25. .BR kill (2),
  26. .BR termios (3),
  27. .BR tty (4).
  28. .SH DIAGNOSTICS
  29. .B Setsid()
  30. returns the new process group ID on success, or -1 with
  31. .B errno
  32. set to
  33. .B EPERM
  34. if the process is already a session leader.
  35. .SH AUTHOR
  36. Kees J. Bot (kjb@cs.vu.nl)