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

tcgetpgrp.3p (2745B)


  1. '\" et
  2. .TH TCGETPGRP "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. tcgetpgrp
  12. \(em get the foreground process group ID
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. pid_t tcgetpgrp(int \fIfildes\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fItcgetpgrp\fR()
  23. function shall return the value of the process group ID of the
  24. foreground process group associated with the terminal.
  25. .P
  26. If there is no foreground process group,
  27. \fItcgetpgrp\fR()
  28. shall return a value greater than 1 that does not match the process
  29. group ID of any existing process group.
  30. .P
  31. The
  32. \fItcgetpgrp\fR()
  33. function is allowed from a process that is a member of a background
  34. process group; however, the information may be subsequently changed by
  35. a process that is a member of a foreground process group.
  36. .SH "RETURN VALUE"
  37. Upon successful completion,
  38. \fItcgetpgrp\fR()
  39. shall return the value of the process group ID of the foreground
  40. process associated with the terminal. Otherwise, \-1 shall be
  41. returned and
  42. .IR errno
  43. set to indicate the error.
  44. .SH ERRORS
  45. The
  46. \fItcgetpgrp\fR()
  47. function shall fail if:
  48. .TP
  49. .BR EBADF
  50. The
  51. .IR fildes
  52. argument is not a valid file descriptor.
  53. .TP
  54. .BR ENOTTY
  55. The calling process does not have a controlling terminal, or the file
  56. is not the controlling terminal.
  57. .LP
  58. .IR "The following sections are informative."
  59. .SH EXAMPLES
  60. None.
  61. .SH "APPLICATION USAGE"
  62. None.
  63. .SH RATIONALE
  64. None.
  65. .SH "FUTURE DIRECTIONS"
  66. None.
  67. .SH "SEE ALSO"
  68. .IR "\fIsetsid\fR\^(\|)",
  69. .IR "\fIsetpgid\fR\^(\|)",
  70. .IR "\fItcsetpgrp\fR\^(\|)"
  71. .P
  72. The Base Definitions volume of POSIX.1\(hy2017,
  73. .IR "\fB<sys_types.h>\fP",
  74. .IR "\fB<unistd.h>\fP"
  75. .\"
  76. .SH COPYRIGHT
  77. Portions of this text are reprinted and reproduced in electronic form
  78. from IEEE Std 1003.1-2017, Standard for Information Technology
  79. -- Portable Operating System Interface (POSIX), The Open Group Base
  80. Specifications Issue 7, 2018 Edition,
  81. Copyright (C) 2018 by the Institute of
  82. Electrical and Electronics Engineers, Inc and The Open Group.
  83. In the event of any discrepancy between this version and the original IEEE and
  84. The Open Group Standard, the original IEEE and The Open Group Standard
  85. is the referee document. The original Standard can be obtained online at
  86. http://www.opengroup.org/unix/online.html .
  87. .PP
  88. Any typographical or formatting errors that appear
  89. in this page are most likely
  90. to have been introduced during the conversion of the source files to
  91. man page format. To report such errors, see
  92. https://www.kernel.org/doc/man-pages/reporting_bugs.html .