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

strncmp.3p (2661B)


  1. '\" et
  2. .TH STRNCMP "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. strncmp
  12. \(em compare part of two strings
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <string.h>
  17. .P
  18. int strncmp(const char *\fIs1\fP, const char *\fIs2\fP, size_t \fIn\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIstrncmp\fR()
  27. function shall compare not more than
  28. .IR n
  29. bytes (bytes that follow a NUL character are not compared) from the array
  30. pointed to by
  31. .IR s1
  32. to the array pointed to by
  33. .IR s2 .
  34. .P
  35. The sign of a non-zero return value is determined by the sign of the
  36. difference between the values of the first pair of bytes (both
  37. interpreted as type
  38. .BR "unsigned char" )
  39. that differ in the strings being compared.
  40. .SH "RETURN VALUE"
  41. Upon successful completion,
  42. \fIstrncmp\fR()
  43. shall return an integer greater than, equal to, or less than 0, if the
  44. possibly null-terminated array pointed to by
  45. .IR s1
  46. is greater than, equal to, or less than the possibly null-terminated
  47. array pointed to by
  48. .IR s2
  49. respectively.
  50. .SH ERRORS
  51. No errors are defined.
  52. .LP
  53. .IR "The following sections are informative."
  54. .SH EXAMPLES
  55. None.
  56. .SH "APPLICATION USAGE"
  57. None.
  58. .SH RATIONALE
  59. None.
  60. .SH "FUTURE DIRECTIONS"
  61. None.
  62. .SH "SEE ALSO"
  63. .IR "\fIstrcmp\fR\^(\|)"
  64. .P
  65. The Base Definitions volume of POSIX.1\(hy2017,
  66. .IR "\fB<string.h>\fP"
  67. .\"
  68. .SH COPYRIGHT
  69. Portions of this text are reprinted and reproduced in electronic form
  70. from IEEE Std 1003.1-2017, Standard for Information Technology
  71. -- Portable Operating System Interface (POSIX), The Open Group Base
  72. Specifications Issue 7, 2018 Edition,
  73. Copyright (C) 2018 by the Institute of
  74. Electrical and Electronics Engineers, Inc and The Open Group.
  75. In the event of any discrepancy between this version and the original IEEE and
  76. The Open Group Standard, the original IEEE and The Open Group Standard
  77. is the referee document. The original Standard can be obtained online at
  78. http://www.opengroup.org/unix/online.html .
  79. .PP
  80. Any typographical or formatting errors that appear
  81. in this page are most likely
  82. to have been introduced during the conversion of the source files to
  83. man page format. To report such errors, see
  84. https://www.kernel.org/doc/man-pages/reporting_bugs.html .