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

ptsname.3p (3085B)


  1. '\" et
  2. .TH PTSNAME "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. ptsname
  12. \(em get name of the slave pseudo-terminal device
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. char *ptsname(int \fIfildes\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIptsname\fR()
  23. function shall return the name of the slave pseudo-terminal device
  24. associated with a master pseudo-terminal device. The
  25. .IR fildes
  26. argument is a file descriptor that refers to the master device. The
  27. \fIptsname\fR()
  28. function shall return a pointer to a string containing the pathname
  29. of the corresponding slave device.
  30. .P
  31. The
  32. \fIptsname\fR()
  33. function need not be thread-safe.
  34. .SH "RETURN VALUE"
  35. Upon successful completion,
  36. \fIptsname\fR()
  37. shall return a pointer to a string which is the name of the
  38. pseudo-terminal slave device. Upon failure,
  39. \fIptsname\fR()
  40. shall return a null pointer and may set
  41. .IR errno .
  42. This could occur if
  43. .IR fildes
  44. is an invalid file descriptor or if the slave device name does not
  45. exist in the file system.
  46. .P
  47. The application shall not modify the string returned. The returned
  48. pointer might be invalidated or the string content might be overwritten
  49. by a subsequent call to
  50. \fIptsname\fR().
  51. The returned pointer and the string content might also be invalidated
  52. if the calling thread is terminated.
  53. .SH ERRORS
  54. The
  55. \fIptsname\fR()
  56. function may fail if:
  57. .TP
  58. .BR EBADF
  59. The
  60. .IR fildes
  61. argument is not a valid file descriptor.
  62. .TP
  63. .BR ENOTTY
  64. The file associated with the
  65. .IR fildes
  66. argument is not a master pseudo-terminal device.
  67. .LP
  68. .IR "The following sections are informative."
  69. .SH EXAMPLES
  70. None.
  71. .SH "APPLICATION USAGE"
  72. None.
  73. .SH RATIONALE
  74. See the RATIONALE section for
  75. .IR "\fIposix_openpt\fR\^(\|)".
  76. .SH "FUTURE DIRECTIONS"
  77. None.
  78. .SH "SEE ALSO"
  79. .IR "\fIgrantpt\fR\^(\|)",
  80. .IR "\fIopen\fR\^(\|)",
  81. .IR "\fIposix_openpt\fR\^(\|)",
  82. .IR "\fIttyname\fR\^(\|)",
  83. .IR "\fIunlockpt\fR\^(\|)"
  84. .P
  85. The Base Definitions volume of POSIX.1\(hy2017,
  86. .IR "\fB<stdlib.h>\fP"
  87. .\"
  88. .SH COPYRIGHT
  89. Portions of this text are reprinted and reproduced in electronic form
  90. from IEEE Std 1003.1-2017, Standard for Information Technology
  91. -- Portable Operating System Interface (POSIX), The Open Group Base
  92. Specifications Issue 7, 2018 Edition,
  93. Copyright (C) 2018 by the Institute of
  94. Electrical and Electronics Engineers, Inc and The Open Group.
  95. In the event of any discrepancy between this version and the original IEEE and
  96. The Open Group Standard, the original IEEE and The Open Group Standard
  97. is the referee document. The original Standard can be obtained online at
  98. http://www.opengroup.org/unix/online.html .
  99. .PP
  100. Any typographical or formatting errors that appear
  101. in this page are most likely
  102. to have been introduced during the conversion of the source files to
  103. man page format. To report such errors, see
  104. https://www.kernel.org/doc/man-pages/reporting_bugs.html .