logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

tcsetpgrp.3p (3489B)


  1. '\" et
  2. .TH TCSETPGRP "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. tcsetpgrp
  12. \(em set the foreground process group ID
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. int tcsetpgrp(int \fIfildes\fP, pid_t \fIpgid_id\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. If the process has a controlling terminal,
  22. \fItcsetpgrp\fR()
  23. shall set the foreground process group ID associated with the terminal
  24. to
  25. .IR pgid_id .
  26. The application shall ensure that the file associated with
  27. .IR fildes
  28. is the controlling terminal of the calling process and the controlling
  29. terminal is currently associated with the session of the calling
  30. process. The application shall ensure that the value of
  31. .IR pgid_id
  32. matches a process group ID of a process in the same session as the
  33. calling process.
  34. .P
  35. Attempts to use
  36. \fItcsetpgrp\fR()
  37. from a process which is a member of a background process group on a
  38. .IR fildes
  39. associated with its controlling terminal shall cause the process group
  40. to be sent a SIGTTOU signal. If the calling thread is blocking SIGTTOU
  41. signals or the process is ignoring SIGTTOU signals, the process shall
  42. be allowed to perform the operation, and no signal is sent.
  43. .SH "RETURN VALUE"
  44. Upon successful completion, 0 shall be returned. Otherwise, \-1
  45. shall be returned and
  46. .IR errno
  47. set to indicate the error.
  48. .SH ERRORS
  49. The
  50. \fItcsetpgrp\fR()
  51. function shall fail if:
  52. .TP
  53. .BR EBADF
  54. The
  55. .IR fildes
  56. argument is not a valid file descriptor.
  57. .TP
  58. .BR EINVAL
  59. This implementation does not support the value in the
  60. .IR pgid_id
  61. argument.
  62. .TP
  63. .BR EIO
  64. The process group of the writing process is orphaned, the calling thread
  65. is not blocking SIGTTOU, and the process is not ignoring SIGTTOU.
  66. .TP
  67. .BR ENOTTY
  68. The calling process does not have a controlling terminal, or the file
  69. is not the controlling terminal, or the controlling terminal is no
  70. longer associated with the session of the calling process.
  71. .TP
  72. .BR EPERM
  73. The value of
  74. .IR pgid_id
  75. is a value supported by the implementation, but does not match the
  76. process group ID of a process in the same session as the calling
  77. process.
  78. .LP
  79. .IR "The following sections are informative."
  80. .SH EXAMPLES
  81. None.
  82. .SH "APPLICATION USAGE"
  83. None.
  84. .SH RATIONALE
  85. None.
  86. .SH "FUTURE DIRECTIONS"
  87. None.
  88. .SH "SEE ALSO"
  89. .IR "\fItcgetpgrp\fR\^(\|)"
  90. .P
  91. The Base Definitions volume of POSIX.1\(hy2017,
  92. .IR "\fB<sys_types.h>\fP",
  93. .IR "\fB<unistd.h>\fP"
  94. .\"
  95. .SH COPYRIGHT
  96. Portions of this text are reprinted and reproduced in electronic form
  97. from IEEE Std 1003.1-2017, Standard for Information Technology
  98. -- Portable Operating System Interface (POSIX), The Open Group Base
  99. Specifications Issue 7, 2018 Edition,
  100. Copyright (C) 2018 by the Institute of
  101. Electrical and Electronics Engineers, Inc and The Open Group.
  102. In the event of any discrepancy between this version and the original IEEE and
  103. The Open Group Standard, the original IEEE and The Open Group Standard
  104. is the referee document. The original Standard can be obtained online at
  105. http://www.opengroup.org/unix/online.html .
  106. .PP
  107. Any typographical or formatting errors that appear
  108. in this page are most likely
  109. to have been introduced during the conversion of the source files to
  110. man page format. To report such errors, see
  111. https://www.kernel.org/doc/man-pages/reporting_bugs.html .