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

grantpt.3p (2900B)


  1. '\" et
  2. .TH GRANTPT "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. grantpt
  12. \(em grant access to the slave pseudo-terminal device
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. int grantpt(int \fIfildes\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIgrantpt\fR()
  23. function shall change the mode and ownership of the slave pseudo-terminal
  24. device associated with its master pseudo-terminal counterpart. The
  25. .IR fildes
  26. argument is a file descriptor that refers to a master
  27. pseudo-terminal device. The user ID of the slave shall be set to the real
  28. UID of the calling process and the group ID shall be set to an unspecified
  29. group ID. The permission mode of the slave pseudo-terminal shall be set to
  30. readable and writable by the owner, and writable by the group.
  31. .P
  32. The behavior of the
  33. \fIgrantpt\fR()
  34. function is unspecified if the application has installed a signal
  35. handler to catch SIGCHLD signals.
  36. .SH "RETURN VALUE"
  37. Upon successful completion,
  38. \fIgrantpt\fR()
  39. shall return 0; otherwise, it shall return \-1 and set
  40. .IR errno
  41. to indicate the error.
  42. .SH ERRORS
  43. The
  44. \fIgrantpt\fR()
  45. function may fail if:
  46. .TP
  47. .BR EACCES
  48. The corresponding slave pseudo-terminal device could not be accessed.
  49. .TP
  50. .BR EBADF
  51. The
  52. .IR fildes
  53. argument is not a valid open file descriptor.
  54. .TP
  55. .BR EINVAL
  56. The
  57. .IR fildes
  58. argument is not associated with a master pseudo-terminal device.
  59. .LP
  60. .IR "The following sections are informative."
  61. .SH EXAMPLES
  62. None.
  63. .SH "APPLICATION USAGE"
  64. None.
  65. .SH RATIONALE
  66. See the RATIONALE section for
  67. .IR "\fIposix_openpt\fR\^(\|)".
  68. .SH "FUTURE DIRECTIONS"
  69. None.
  70. .SH "SEE ALSO"
  71. .IR "\fIopen\fR\^(\|)",
  72. .IR "\fIposix_openpt\fR\^(\|)",
  73. .IR "\fIptsname\fR\^(\|)",
  74. .IR "\fIunlockpt\fR\^(\|)"
  75. .P
  76. The Base Definitions volume of POSIX.1\(hy2017,
  77. .IR "\fB<stdlib.h>\fP"
  78. .\"
  79. .SH COPYRIGHT
  80. Portions of this text are reprinted and reproduced in electronic form
  81. from IEEE Std 1003.1-2017, Standard for Information Technology
  82. -- Portable Operating System Interface (POSIX), The Open Group Base
  83. Specifications Issue 7, 2018 Edition,
  84. Copyright (C) 2018 by the Institute of
  85. Electrical and Electronics Engineers, Inc and The Open Group.
  86. In the event of any discrepancy between this version and the original IEEE and
  87. The Open Group Standard, the original IEEE and The Open Group Standard
  88. is the referee document. The original Standard can be obtained online at
  89. http://www.opengroup.org/unix/online.html .
  90. .PP
  91. Any typographical or formatting errors that appear
  92. in this page are most likely
  93. to have been introduced during the conversion of the source files to
  94. man page format. To report such errors, see
  95. https://www.kernel.org/doc/man-pages/reporting_bugs.html .