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

gethostname.3p (2300B)


  1. '\" et
  2. .TH GETHOSTNAME "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. gethostname
  12. \(em get name of current host
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <unistd.h>
  17. .P
  18. int gethostname(char *\fIname\fP, size_t \fInamelen\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIgethostname\fR()
  23. function shall return the standard host name for the current machine.
  24. The
  25. .IR namelen
  26. argument shall specify the size of the array pointed to by the
  27. .IR name
  28. argument. The returned name shall be null-terminated, except that if
  29. .IR namelen
  30. is an insufficient length to hold the host name, then the returned name
  31. shall be truncated and it is unspecified whether the returned name is
  32. null-terminated.
  33. .P
  34. Host names are limited to
  35. {HOST_NAME_MAX}
  36. bytes.
  37. .SH "RETURN VALUE"
  38. Upon successful completion, 0 shall be returned; otherwise, \-1 shall
  39. be returned.
  40. .SH ERRORS
  41. No errors are defined.
  42. .LP
  43. .IR "The following sections are informative."
  44. .SH "EXAMPLES"
  45. None.
  46. .SH "APPLICATION USAGE"
  47. None.
  48. .SH "RATIONALE"
  49. None.
  50. .SH "FUTURE DIRECTIONS"
  51. None.
  52. .SH "SEE ALSO"
  53. .IR "\fIgethostid\fR\^(\|)",
  54. .IR "\fIuname\fR\^(\|)"
  55. .P
  56. The Base Definitions volume of POSIX.1\(hy2017,
  57. .IR "\fB<unistd.h>\fP"
  58. .\"
  59. .SH COPYRIGHT
  60. Portions of this text are reprinted and reproduced in electronic form
  61. from IEEE Std 1003.1-2017, Standard for Information Technology
  62. -- Portable Operating System Interface (POSIX), The Open Group Base
  63. Specifications Issue 7, 2018 Edition,
  64. Copyright (C) 2018 by the Institute of
  65. Electrical and Electronics Engineers, Inc and The Open Group.
  66. In the event of any discrepancy between this version and the original IEEE and
  67. The Open Group Standard, the original IEEE and The Open Group Standard
  68. is the referee document. The original Standard can be obtained online at
  69. http://www.opengroup.org/unix/online.html .
  70. .PP
  71. Any typographical or formatting errors that appear
  72. in this page are most likely
  73. to have been introduced during the conversion of the source files to
  74. man page format. To report such errors, see
  75. https://www.kernel.org/doc/man-pages/reporting_bugs.html .