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

sem_getvalue.3p (2801B)


  1. '\" et
  2. .TH SEM_GETVALUE "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. sem_getvalue
  12. \(em get the value of a semaphore
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <semaphore.h>
  17. .P
  18. int sem_getvalue(sem_t *restrict \fIsem\fP, int *restrict \fIsval\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIsem_getvalue\fR()
  23. function shall update the location referenced by the
  24. .IR sval
  25. argument to have the value of the semaphore referenced by
  26. .IR sem
  27. without affecting the state of the semaphore. The updated value
  28. represents an actual semaphore value that occurred at some unspecified
  29. time during the call, but it need not be the actual value of the
  30. semaphore when it is returned to the calling process.
  31. .P
  32. If
  33. .IR sem
  34. is locked, then the object to which
  35. .IR sval
  36. points shall either be set to zero or to a negative number whose
  37. absolute value represents the number of processes waiting for the
  38. semaphore at some unspecified time during the call.
  39. .SH "RETURN VALUE"
  40. Upon successful completion, the
  41. \fIsem_getvalue\fR()
  42. function shall return a value of zero. Otherwise, it shall return
  43. a value of \-1 and set
  44. .IR errno
  45. to indicate the error.
  46. .SH ERRORS
  47. The
  48. \fIsem_getvalue\fR()
  49. function may fail if:
  50. .TP
  51. .BR EINVAL
  52. The
  53. .IR sem
  54. argument does not refer to a valid semaphore.
  55. .LP
  56. .IR "The following sections are informative."
  57. .SH EXAMPLES
  58. None.
  59. .SH "APPLICATION USAGE"
  60. None.
  61. .SH RATIONALE
  62. None.
  63. .SH "FUTURE DIRECTIONS"
  64. None.
  65. .SH "SEE ALSO"
  66. .IR "\fIsemctl\fR\^(\|)",
  67. .IR "\fIsemget\fR\^(\|)",
  68. .IR "\fIsemop\fR\^(\|)",
  69. .IR "\fIsem_post\fR\^(\|)",
  70. .IR "\fIsem_timedwait\fR\^(\|)",
  71. .IR "\fIsem_trywait\fR\^(\|)"
  72. .P
  73. The Base Definitions volume of POSIX.1\(hy2017,
  74. .IR "\fB<semaphore.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 .