Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

.\"	$NetBSD: _ksem.2,v 1.2 2015/11/29 21:38:10 wiz Exp $
.\"
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd November 30, 2015
.Dt _KSEM 2
.Os
.Sh NAME
.Nm _ksem ,
.Nm _ksem_init ,
.Nm _ksem_open ,
.Nm _ksem_close ,
.Nm _ksem_unlink ,
.Nm _ksem_destroy ,
.Nm _ksem_getvalue ,
.Nm _ksem_post ,
.Nm _ksem_wait ,
.Nm _ksem_timedwait ,
.Nm _ksem_trywait
.Nd back-end implementation for POSIX semaphores
.Sh SYNOPSIS
.In sys/ksem.h
.Ft int
.Fn _ksem_init "int value" "intptr_t *idp"
.Ft int
.Fn _ksem_open "const char *name" "int oflag" "mode_t mode" "unsigned int value" "intptr_t *idp"
.Ft int
.Fn _ksem_close "intptr_t id"
.Ft int
.Fn _ksem_unlink "const char *name"
.Ft int
.Fn _ksem_destroy "intptr_t id"
.Ft int
.Fn _ksem_getvalue "intptr_t id" "unsigned int *value"
.Ft int
.Fn _ksem_post "intptr_t id"
.Ft int
.Fn _ksem_wait "intptr_t id"
.Ft int
.Fn _ksem_timedwait "intptr_t id" "const struct timespec *abstime"
.Ft int
.Fn _ksem_trywait "intptr_t id"
.Sh DESCRIPTION
The
.Fn _ksem_*
family of system calls provide the kernel implementation of POSIX
semaphores.
.Sh RETURN VALUES
Successful calls to the
.Fn _ksem_*
system calls return a value of zero.
Otherwise, \-1 is returned and
.Va errno
is set to provide more information.
.Sh ERRORS
Please see the section 3 manual pages for specific error information.
.Sh SEE ALSO
.Xr sem_close 3 ,
.Xr sem_destroy 3 ,
.Xr sem_getvalue 3 ,
.Xr sem_init 3 ,
.Xr sem_open 3 ,
.Xr sem_post 3 ,
.Xr sem_unlink 3 ,
.Xr sem_wait 3 ,
.Xr sem 4
.Sh HISTORY
Most of the
.Fn _ksem_*
system calls first appeared in
.Nx 2.0 .
The
.Fn _ksem_timedwait
system call first appeared in
.Nx 5.0 .